I suspect your code. If it is newly inserted and saved (and even unsaved I think) they should be an empty array, not null.
On 2016-04-13, 10:12 AM, "webobjects-dev-bounces+chill=gevityinc....@lists.apple.com on behalf of OC" <webobjects-dev-bounces+chill=gevityinc....@lists.apple.com on behalf of o...@ocs.cz> wrote: >Hi there, > >with ERXEOControlUtilities.objectCountForToManyRelationship I have bumped into >a weird problem — with newly created EOs it fails, yelling that “... is not a >toMany relationship! Expected an NSArray, but got null” (exact copy below). > >Now, perhaps I do something wrong, but it seems to me it is perfectly normal >in EOF that all to-manys of a newly created EO are null? At the very least, >whenever I checked, they were. > >So far, the only fix I have found is to refault the newly created object >immediately, which helps (fetch replaces those nulls by empty arrays), but it >is pretty ugly: > >=== > DBDataBlock bc=... create new EO and insert it into an EC ... > ... set it up ... > if (!ec.saveChanges()) return ERROR... > bc.editingContext.refaultObject(bc) // <==== this helps. Without this > line, to-manys are nulls now >=== > >Is there any better solution? > >And what am I overlooking? To me, the check for null in >objectCountForToManyRelationship looks like a bug. > >Thanks a lot, >OC > >=== >18:53:43.124 WARN <er.extensions.appserver.ERXComponentRequestHandler>: >Exception occurred while handling request: >java.lang.IllegalArgumentException: The attribute named 'actions' in the >entity named 'DBDataBlock' is not a toMany relationship! Expected an NSArray, >but got null. //log:NSLog [WorkerThread0] >[2016-4-13 18:53:43 CEST] <WorkerThread0> java.lang.IllegalArgumentException: >The attribute named 'actions' in the entity named 'DBDataBlock' is not a >toMany relationship! Expected an NSArray, but got null. > at > er.extensions.eof.ERXEOControlUtilities.objectCountForToManyRelationship(ERXEOControlUtilities.java:802) >... >=== > _______________________________________________ >Do not post admin requests to the list. They will be ignored. >Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >Help/Unsubscribe/Update your Subscription: >https://lists.apple.com/mailman/options/webobjects-dev/chill%40gevityinc.com > >This email sent to ch...@gevityinc.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com