Hello,
I just ran into a strange situation with partial entities. I have a
NotificationTransaction base class in a framework, and an
RNotificationTransaction partial entity in an application which has only a
single additional relationship to an application-level School entity. Here is
a WOUnit test:
@Test
public void transactionShouldBeSaveableWithSchoolSet() {
trans.setDateStart(new DateTime());
trans.setRecipient("foo");
trans.setStatus(Status.COMPLETE_SUCCESS);
trans.setUuid("foo");
trans.partialForClass(RNotificationTransaction.class)
.setSchoolRelationship(school);
confirm(trans, canBeSaved());
return;
}
If RNotificationTransaction.school is marked mandatory in the model, that fails
with a NullPropertyException on the schoolID attribute (which is _not_ marked
as a class property). If I flip it to optional, it passes. (And in the actual
application, I can confirm that even when it's optional, the appropriate
schoolID _is_ written out to the database.)
I'm not sure how many people are using partial entities all that heavily, but
has anyone seen this? Can anyone suggest what might be going on? (How late
would a foreign key attribute like this normally be set?)
--
Paul Hoadley
http://logicsquad.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]