Thanks.  I did use an "after insert" type solution to update the field.

-----Original Message-----
From: Martin Kal�n [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 28, 2005 3:56 AM
To: OJB Users List
Subject: Re: 1-1 Relationship Both ways


Lemke, Wesley wrote:
> Our problem occurs when we save a GenericGroup.  It will first save 
> the ClientBillingInfo object, so it puts -1 in the generic_grp_id 
> field of the client_billing table (We are using database generated 
> keys).

If I understand you correctly, your problem is that your DB will set the key 
without OJB noticing this - right?

In that case you could either try to map the OJB repository so that OJB gets 
the sequence from the DB (depends on exactly how your DB is generating the id, 
sequence, trigger, stored procedure, ...).

Or you could use the PB-API afterStore hook to read the value back from DB and 
update the POJO/DAO and OJB cache memory values to match any "magic" that 
happened in your DB. There was a number of recent posts re this, so I am not 
re-iterating the whole thing until I am sure that this is what you want to do. 
;)

Cheers,
  Martin


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