Re: When Does a New Object get its Primary Key?

2004-05-27 Thread Thomas Mahler
Hi Chris,
Chris Lewington wrote:
Hi all,
A couple of quick questions:
1) When persisting a new object, does the in-memory one get its PK set
automatically by OJB after the operation has committed, or do I have to
search for it afterwards to get at the PK?
The in-memory objected is automatically assigned with the PK. (Of course 
only if you use the autoincrement="true" setting.

2) As OJB does updates as 'delete+insert', 
no.
if I have a proxied
Collection inside an object but not yet materialized, and then change
and store the parent object, will the Collection get created, deleted
and then re-inserted or will it not be touched at all (the second would
be preferable for me)?
it will not be touched at all. OJB is clever enough to determine that no 
changes have been made.

Thomas
Cheers,
Chris
-
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]


When Does a New Object get its Primary Key?

2004-05-27 Thread Chris Lewington
Hi all,

A couple of quick questions:

1) When persisting a new object, does the in-memory one get its PK set
automatically by OJB after the operation has committed, or do I have to
search for it afterwards to get at the PK?

2) As OJB does updates as 'delete+insert', if I have a proxied
Collection inside an object but not yet materialized, and then change
and store the parent object, will the Collection get created, deleted
and then re-inserted or will it not be touched at all (the second would
be preferable for me)?

Cheers,

Chris


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