Re: Adding primary & secondary simultaneously
Re: Adding primary & secondary simultaneously
- Subject: Re: Adding primary & secondary simultaneously
- From: Kieran Kelleher <email@hidden>
- Date: Wed, 10 Dec 2003 23:31:11 -0500
Drew,
Your code is not the same "pattern" as the tutorial code. Look
carefully .... newBook.setAuthor(author) is taking author as a
reference to an Author object (or class instance) whereas your code
shows a different pattern using setClientId(Number clientId) instead of
setClient(Client newClient).
In other words it seems you are passing a reference of object type
Client to a method named setClientId in the Address class that is
defined to take a type Number as an argument.
It might be worthwhile to re-examine your EOModel attributes and
relationships and compare in detail to the tutorial as a "pattern" to
follow.
-K
____________________________________
OS X 10.3.1 / WO 5.2.2 / MySQL 4.0.16
On Dec 9, 2003, at 11:04 PM, Drew Thoeni wrote:
I'm trying to add a new record to my client table and, from the same
form and in the same transaction, add the client's address to a
separate address table. The address table is a to-many relationship
from the client table.
Modeling my code after the example in the WO "Web Applications"
tutorial (below)
TUTORIAL
author.addToBooks(newBook);
newBook.setAuthor(author);
MY CODE
newClient.addToAddress(newAddress);
newAddress.setClientId(newClient);
I get an error "Register1.java:44: setClientId(java.lang.Number) in
Address cannot be applied to (Client)"
I have also tried:
newClient.addObjectToBothSidesOfRelationshipWithKey("Address"); With
similar results.
Can anyone suggest a better example/documentation to work from (other
than the Web Applications tutorial)? I am assuming it is possible to
add both sides of a one-to-many relationship from one form (in a
single trip to the server).
Regards,
Drew
_______________________________________________
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.
_______________________________________________
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.