Hi Jason,

I don't believe that this kind of object reconstruction can be avoided.
I see not much harm in your code.

cheers,
Thomas

Jason Hale wrote:
Hi Thomas,

This may be a bit off topic....


I use OJB exclusively in a web application environment. When a web form posts to one of my actions I only pass the ids of any dependent objects (from a list box etc...). I would like to set this id on my target object and then store it. Of course, this does not work. So currently I do something like.

A a = new a();
B b = new b();
b.setID(dependentID);
a.setB(b);

pb.store(a);

Is there a better way to do this?  Using the OID of the dependent object
to send on the post seems ideal, but I have to do some extra coding to
"reconstruct" my object in my action class.

-Jason Hale
Wingate Web


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 12:29 PM
To: OJB Users List
Subject: Re: Anybody else have this problem?/Feature Idea

I absolutely agree with Charles!
the automatic handling of foreign keys was build to let developers
concentrate on business objects and not on rdbms details.

Thomas

Charles Anthony wrote:

Hi,

Developer should only ever set foo, and should never set fooId.

OJB manages all foreign keys.

In our app, we don't generate setters for any id fields (primary or
foreign), and we only have a getter for the PK. Therefore, the

developers


find it much harder to fiddle with the keys.

Cheers,

Charles.







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to