Hi Gary,

Have a look here:
http://db.apache.org/ojb/docu/guides/basic-technique.html#Link+references

Cheers,
 Vasily

On 7/30/06, Gary Bartlett <[EMAIL PROTECTED]> wrote:
Greetings

I am working on upgrading an application that was
built using OJB 0.94 to release 1.0.4.  I am running
into some difficulties getting a primary key assigned
for a newly created persistent object before the
object is actually stored into the database.

Under 0.94 it seemed I could just create a new
instance of my persistent object and then call

      Identity id = new Identity(object);

passing the newly created object.

I did not have to do anything with the returned
Identity (id) --- but a side effect of calling this
was that the primaryKey of the newly created object
was populated.

In 1.04 the above call is not available - so I changed
it to

        Identity id = new
IdentityFactoryImpl(getBroker()).buildIdentity(object);

This does not seem to have the same side effect - and
I am unsure if I can even get the primaryKey from the
returned Identity.

So I guess my question is whether or not there is a
way to get a primaryKey for a newly created object
prior to the object being stored into the database.

Thanks,

Gary Bartlett





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------------------------------------------------
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