Re: setting values
Re: setting values
- Subject: Re: setting values
- From: Ricardo Strausz <email@hidden>
- Date: Wed, 19 Feb 2003 17:56:29 -0600
hola atsushi,
in EOModeler you most generate the Java files for each entity
(Property>Generate Java Files...)
if you look to that sources, you will find methods of the form:
public Number no() {
return (Number)storedValueForKey("no");
}
public void setNo(Number value) {
takeStoredValueForKey(value, "no");
}
so, too assign such a valu you need a line of the form
objectA.setNo(objectB.no());
I think this is the easiest way to do it...
you can also use generic methods like "setValueForKey" and
"takeValueForKey" but that means you will write more code... EOModeler
does that for you!!!
Suerte!
dino
On miircoles, febr 19, 2003, at 16:40 America/Mexico_City, A. Uchida
wrote:
Hi there,
MacOS 10.1.5 & WO5.0
I'm just staring to use WO recently and also a beginner of Java
programming.
I would like to have your advices for my qestion.
What I am trying to do in WO application is
1. Create a new record in an entityA using display group insert().
2. Save the new record in the entityA using saveChanges().
3. Create a new record in an entityB using insert().
4. set a value of an attribute of entityA to an attribute of the
entityB
5. saveChanges() of entityB.
I want to do the process 2 to 4 by an action on a WO component.
What I did to set the value was to add
entityB.aData = entityA.aData;
in the action method in the java file.
Both entityA and B was produced as a key using the entities.
And it doesn't allow me to finish the build.
I think I had to use a method, something like "takeValueForKey".
But I don't know how to use it.
Question1 : what method can be used to set a value of an entity to a
field
of the other entity?
Question 2 : I am learning WO by myself and had read some books for WO
but
when I get lost like this case, what kind of documents, do you think,
are usefull?
I checked the documents of the WO: EOControl, Java reference for Java
etc.
But I don't think it is useful.
Any comments would be appreciated.
Thanks in advance.
Atsushi Uchida
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
Dino
http://homepage.mac.com/strausz
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.