Hello, well I putted in the db that attribute as unique...
so what I was thinking is that I will capture the excpetion and see
the message, to see if there is a duplicate entry.
I did this becuase i see nothing in EOModeler to set a unique key, i
do know if I did good doing this..
Gus
On Mar 24, 2008, at 10:53 AM, Gustavo Pizano wrote:
Ok finally it worked I corrected the model and I used this method
person.setStudyLevelRelationship(personStudyLvl);
which internally calls the method
getPerson
().addObjectToBothSidesOfRelationshipWithKey
( getSelectedStudyLevel(), Person.STUDY_LEVEL_KEY );
and its funny, after I looked at the db I saw another table called
EO_PK_TABLE which store the last regsiter data
what im wondering no its, the document attribute shouldn't be more
than 1 time in the table, that's why at the begingin of my design I
set this attribute as pk, but then well you make me realize that
this attribute its important to me later, so shouldn't be a pk, so
with the actual model I can register 1 person more than once in the
table, something that shouldn't be accepted, what can I do? it this
case?? set it as unique in the db? or...
thanksGustavo
On Mar 24, 2008, at 1:39 AM, John Baldwin wrote:
It sounds like your problem is that you're leaving study_table_id
as a class property when you shouldn't. That's handled by WO.
You want to do something like:
myPerson.setStudyLevel(selectedStudyLevel);
and be done with it. If you're trying something like:
myPerson.setStudyLevelID(12);
Then you're doing it wrong.
WO knows the id of the study level, and updates the database
correctly when you save. But in your programs, you are dealing with
objects, and object properties (not database keys). No primary keys
or foreign keys should be class properties under normal
circumstances, and you shouldn't be trying to set them in code.
John
On Sunday Mar 23, 2008 10:11 PM, at 10:11 PM, Gustavo Pizano wrote:
Ok Im gonan work on it tomorrow, I mess it up in the component
class and now i don't even understand myself what im doing.
I left the getters and setter, as art said, for me its better that
way too, if somethings comes wrong I can debug it and see where
the hell the vale went.
Just for the test I have only Person and StudyLeve tables and
Entities in EOmodeler, with their relationship, but something is
comeing worng it says me something like give id_study_level a
value or somehting like that... I know why its says that, but I
don't get it when am I puttin it. thinking better maybe I have a
mistake in the model. I will check it tomorrow.
Thanks
Guys
TTU tomorrow
Gus
On Mar 23, 2008, at 10:58 PM, Lachlan Deck wrote:
On 24/03/2008, at 2:48 PM, Gustavo Pizano wrote:
OH NO NO NO I was wrong I can't do that. in the _Person EO,
the name() will return me the name of the current instance..
hehehe
What I meant was you can do this:
PopUpButton : WOPopUpButton {
list = studyLevelOptions;
item = studyLevelItem;
displayString = studyLevelItem.name;
noSelectionString = "------------------" ;
selection = person.studyLevel; // get/set the studyLevel
relation on person.
}
so i do need at least the setters
Not if you binding selection to person.studyLevel. Otherwise, if
you bind selection to selectedStudyLevel then you do.
with regards,
--
Lachlan Deck
_______________________________________________
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/gustavpicora%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/jgilmorebaldwin%40mac.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]