• 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
Re: NullPropertyExcetion when saveChanges() ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NullPropertyExcetion when saveChanges() ???


  • Subject: Re: NullPropertyExcetion when saveChanges() ???
  • From: Gustavo Adolfo Pizano <email@hidden>
  • Date: Fri, 12 Jun 2009 11:46:29 +0200


Hello I was able to save just the main data, without relationships.. when I try to save 1 relation ship, it generates no error, but at the same time there is no relationship made.. I have done this:

PROJECT theProject = new PROJECT();
session().defaultEditingContext().insertObject(theProject);
theProject.setDescription(description);
theProject.setDue_date(dueDate);
theProject.setReceived_date(receivedDate);
//theProject.setINVOICE(null);
theProject.setName(name);
theProject.setPid(id);
theProject.setSpecial_notes(specialNotes);
theProject.setPROJECT_STATUSRelationship(status);
//theProject.addObjectToBothSidesOfRelationshipWithKey(status, PROJECT.P_ROJEC_T_STATUS_KEY);

when savingChanges(), no relationship is save.. I mean I went and check in the database, and I see in the fkcolumn that points to the PROJECT_STATUS table, null. .. what am I doing wrong?

is ist something in the model?


G



On Jun 12, 2009, at 10:55 AM, Gustavo Pizano wrote:

Hello I dunno why Im getting this ...
 

 <er.extensions.validation.ERXValidationException object: <xws.locXMan.eo.PROJECT pk:"null">; propertyKey: received_date; type: NullPropertyException; additionalExceptions: (<er.extensions.validation.ERXValidationException object: <xws.locXMan.eo.PROJECT pk:"null">; propertyKey: special_notes; type: NullPropertyException; additionalExceptions: ()>, <er.extensions.validation.ERXValidationException object: <xws.locXMan.eo.PROJECT pk:"null">; propertyKey: pROJECT_CATEGORY; type: MandatoryToOneRelationshipException; additionalExceptions: ()>, <er.extensions.validation.ERXValidationException object: <xws.locXMan.eo.PROJECT pk:"null">; propertyKey: pROJECT_STATUS; type: MandatoryToOneRelationshipException; additionalExceptions: ()>, <er.extensions.validation.ERXValidationException object: <xws.locXMan.eo.PROJECT pk:"null">; propertyKey: wORK_TYPE; type: MandatoryToOneRelationshipException; additionalExceptions: ()>)>

I have the following code .. I commented the lines to check btu still the same... sometimes this gives me a headache.. I checked in another projects i did, and I fowllow as I did ther and nothing..


public WOActionResults saveInfo() {



PROJECT theProject = new PROJECT();
session().defaultEditingContext().insertObject(theProject);


theProject.setDescription(description);
theProject.setDue_date(dueDate);
//theProject.setINVOICE(null);
theProject.setName(name);
theProject.setPid(id);
//theProject.setPROJECT_STATUSRelationship(status); //2nd attempt
//theProject.addObjectToBothSidesOfRelationshipWithKey(status, PROJECT.P_ROJEC_T_STATUS_KEY); // I try this first
//theProject.addObjectToBothSidesOfRelationshipWithKey(categ, PROJECT.P_ROJEC_T_CATEGORY_KEY);  // I try this first
//theProject.setPROJECT_CATEGORYRelationship(categ); //2nd attempt
//theProject.setReceived_date(receivedDate);
//theProject.setSpecial_notes(specialNotes);
//theProject.setWORK_TYPE(workT);
// theProject.addObjectToBothSidesOfRelationshipWithKey(workT(), PROJECT.W_OR_K_TYPE_KEY);
//theProject.setWORK_TYPERelationship(workT); //2nd attempt
//theProject.addObjectsToBothSidesOfRelationshipWithKey(unitsList,PROJECT.U_NIT_S_OTHER_SS_KEY );
NSLog.out.appendln("HERE SO far so good");


((Session)session()).defaultEditingContext().saveChanges();
NSLog.out.appendln("the datawas sasved");
return null;
}

I attach a schema of my model... some things like names change but the relationships are the same... 

GRR!!!

Thanks for the help

Gustavo



<Picture 4.png>

 _______________________________________________
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

References: 
 >NullPropertyExcetion when saveChanges() ??? (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: WOAction Constructor
  • Next by Date: Re: Ant install wo app with debug
  • Previous by thread: NullPropertyExcetion when saveChanges() ???
  • Next by thread: Fwd: NullPropertyExcetion when saveChanges() ???
  • Index(es):
    • Date
    • Thread