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/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to