Hi all,
I've setup my "ContactJob" entity to relate to "Numbers" and
"Address" entities, and to own the relationships. Both are to-one
relationships with foreign keys in ContactJob, that do not have the
inverse relationship modeled. From my understanding this should cause
new "Numbers" and "Address" EOs to be created, inserted, and related
to the "ContactJob" as soon as I create and insert an instance of
"ContactJob". Am I wrong?
Coding with the above assumption, I get a NullPointerException
thrown when I try to access the relationships. I do this soon after
the creation of the "ContactJob", once I set the GUI values on it. I
call validateForSave() on the ContactJob, which is overriden to call
validateForSave() on the "address" and "numbers" relationships. I
need to do this coz Address and Numbers have per EO custom validation
rules.
I've triple checked my model. The foreign key to Numbers and Address
are set to not null. The relationships are both setup as mandatory,
cascading, and owns relationship. The only peculiarity of the
situation is that the inverse relationships are not modeled, but I
can't see how that matters. I've not overriden awakeFromInsertion()
in ContactJob...
Any ideas???
Flor
If this is normal and I just misunderstand, then I suppose I can
create and insert the Numbers and Address in ContactJob's
awakeFromInsertion(), and relate them, so I guess it's fixable.
Still, it does not seem normal to me.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]