• 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
Problem deleting an object with a flattened relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem deleting an object with a flattened relationship


  • Subject: Problem deleting an object with a flattened relationship
  • From: Greg Lappen <email@hidden>
  • Date: Thu, 13 Mar 2008 14:14:26 -0400

Hello-

I am having a strange problem with our application on WebObjects 5.4 (not sure if it was present on 5.3, just giving some background).

The error occurs when I attempt to delete an object which has a flattened relationship.  The error I get is:

 java.lang.IllegalStateException: A valid global ID could not be obtained for entity named UnknownStatusPolicyReportItem, relationship named policies, primary key dictionary {policyID = 169; reportID = 15; }.

FileLine#MethodPackage

EODatabaseContext.java4867databaseOperationForIntermediateRowFromSourceObjectcom.webobjects.eoaccess
EODatabaseContext.java4891recordDeleteForIntermediateRowFromSourceObjectRelationshipDestinationObjectcom.webobjects.eoaccess
EODatabaseContext.java4944nullifyAttributesInRelationshipSourceObjectDestinationObjectcom.webobjects.eoaccess
EODatabaseContext.java4970nullifyAttributesInRelationshipSourceObjectDestinationObjectscom.webobjects.eoaccess
EODatabaseContext.java5882recordChangesInEditingContextcom.webobjects.eoaccess
EOObjectStoreCoordinator.java373saveChangesInEditingContextcom.webobjects.eocontrol
EOEditingContext.java3176saveChangescom.webobjects.eocontrol
ReportChooser.java26deleteReport

The model classes involved are Policy, UnknownStatusPolicyReport, and UnknownStatusPolicyReportItem.  UnknownStatusPolicyReport is a subclass (using single-table inheritance) of Report.  A UnknownStatusPolicyReport has a to-many relationship to UnknownStatusPolicyReportItem, and UnknownStatusPolicyReportItem has a to-one relationship to Policy (each item in the report points to an insurance policy).  I defined a flattened to-many relationship on UnknownStatusPolicyReport called policies which is defined as "items.policy".  I also set the delete rule on the UnknownStatusPolicyReport items relationship to Cascade so the UnknownStatusPolicyReportItems get deleted when the UnknownStatusPolicyReport is deleted.  The code that does the delete:

public WOComponent deleteReport() {
        Session s = (Session) session();
        s.user().removeFromReports((Report)entity);
        session().defaultEditingContext().deleteObject((EOEnterpriseObject) entity);
        session().defaultEditingContext().saveChanges();
        return null;
}

Any assistance would be greatly appreciated....I am sure I'm missing something fundamental here about how EOF works.

Thanks,

Greg     
 _______________________________________________
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

  • Follow-Ups:
    • Re: Problem deleting an object with a flattened relationship
      • From: Chuck Hill <email@hidden>
  • Prev by Date: String Qualifier for Number
  • Next by Date: Re: Problem deleting an object with a flattened relationship
  • Previous by thread: Re: String Qualifier for Number
  • Next by thread: Re: Problem deleting an object with a flattened relationship
  • Index(es):
    • Date
    • Thread