• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Partial entities and mandatory relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Partial entities and mandatory relationships


  • Subject: Partial entities and mandatory relationships
  • From: Paul Hoadley <email@hidden>
  • Date: Thu, 26 Mar 2015 12:57:28 +1030

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: ERXExistsQualifier and IERXChainableQualifier
  • Next by Date: Help On Ponder
  • Previous by thread: Re: ERXExistsQualifier and IERXChainableQualifier
  • Next by thread: Re: Deploying on Amazon EC
  • Index(es):
    • Date
    • Thread