Really not the answer that I wanted. Personally,
I think that it is a bug in EO, if the relationship is defined as NOT mandatory,
and it encounters a EOObjectNotAvailableException it should return null.
However, I want to continue to use EOGenericRecords since it is mainly a
reporting type application. Does anyone know where the Fault is triggered
inside the EO stack so that I might be able to trap the operation with
AspectJ? This would also require that I have the EORelationship that
triggered the fault.
Thanks
Garry
Garry,
EOF is not happy with such situations - if the key is not null, it expects
the to-one to exist.
There are a few workarounds - the simplest is to turn the relationship into
a to-many and check the object count before returning null or the one object in
the array.
Ken
On Jul 25, 2006, at 10:57 AM, Watkins, Garry wrote:
I am getting EOObjectNotAvailableException when I have optional relationships that
are linked by a primary key. I do not control the
data entry that is associated with these records,
so I cannot automatically create empty ones Is there a way for me
to trap these exceptions and just get a null
back.
This is a run down of my
scenario:
I have Client,
ClientExtensionAsbestos, ClientExtensionSilica entities. They all have a primary key of
A_Client. Both of the Extension entities are
optional depending on the clients case type. A client may have one or
more extension records but they are all optional relationships. If I trigger the fault extensionSilica (or any other extension) and it
does not exist, I want to receive null
back.
Any pointers would be
appreciated.
Thanks,
Garry
Confidential &
Privileged
Unless otherwise
indicated or obvious from its nature, the information contained in this
communication is attorney-client privileged and confidential information/work
product. This communication is intended for the use of the individual or
entity named above. If the reader of this communication is not the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If
you have received this communication in error or are not sure whether it is
privileged, please immediately notify us by return e-mail and destroy any
copies--electronic, paper or otherwise--which you may have of this
communication.
_______________________________________________
Do not post admin requests to the list. They will be
ignored.
Help/Unsubscribe/Update your Subscription:
Confidential & Privileged
Unless otherwise indicated or obvious from its nature, the information contained in this communication is attorney-client privileged and confidential information/work product. This communication is intended for the use of the individual or entity named above. If the reader of this communication is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies--electronic, paper or otherwise--which you may have of this communication.
|