I think I have found the problem, but dunno why its happening..

I did the follwoing:

NSLog.out.appendln(status.status() + " " + workT.name()+ " "+ categ.name());

and a nullpointerException was raised... nothing of the above has something all is null.. and ofcourse I can not make any relation with null when mandatory in the EOModel.

Im binding those data as follow:

<div id ="statusDiv">
<span class = "labelDiv">Please Select a Status :</span><span class="infoUnits"> <wo:WOPopUpButton list = "$statusList" selectedValue = "$status" id = "status" item = "$theStatus" displayString = "$theStatus.status" /></ span>
</div>
<br />
<div class = "preTitle">Project's Work Type</div>
<div id = "statusDiv">
<span class = "labelDiv">Please Select a Work Type :</span><span class="infoUnits"> <wo:WOPopUpButton list = "$workTypeL" selectedValue = "$workT" id = "status" item = "$theWT" displayString = "$theWT.name" /></span>
</div>
<br />
<div class = "preTitle">Project's Category</div>
<div id = "statusDiv">
<span class = "labelDiv">Please Select the Category :</span><span class="infoUnits"> <wo:WOPopUpButton list = "$catList" selectedValue = "$categ" id = "status" item = "$theCat" displayString = "$theCat.name" /></span>
</div>
<br />


the list of the popupbuttons are being fetched as:

statusList = PROJECT_STATUS .fetchAllPROJECT_STATUSs(((Session)session()).defaultEditingContext()); workTypeL = WORK_TYPE .fetchAllWORK_TYPEs(((Session)session()).defaultEditingContext()); catList = PROJECT_CATEGORY .fetchAllPROJECT_CATEGORYs (((Session)session()).defaultEditingContext());


the list in the popup are ok, but somehow the bindings are not working...

Any clues.?

G.


Begin forwarded message:

From: Guido Neitzer <[email protected]>
Date: June 12, 2009 12:39:17 PM GMT+02:00
To: Gustavo Adolfo Pizano <[email protected]>
Subject: Re: NullPropertyExcetion when saveChanges() ???

On one of the related? I'm just guessing, it's pretty late and I'm tired ... ;-)

cug




On 12. Jun. 2009, at 03:35 , Gustavo Adolfo Pizano wrote:






<Picture 5.png>

Nop thats what I have.

On Jun 12, 2009, at 12:15 PM, Guido Neitzer wrote:

Is any of your primary or foreign key a class property (has the little diamond icon in Entity Modeler)?

cug

On 12. Jun. 2009, at 02:46 , Gustavo Adolfo Pizano wrote:


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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/guido.neitzer%40gmail.com

This email sent to [email protected]




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to