Hi,
I try to use the ODMG API of OJB.
I noticed that, if I read an object from the database, then modify a property
that is declared as a primary key (in the mapping) and save the object to the
database, a new row is created as if it was a new object inserted.
Is there a way to modify an
Why would you want to do that ? The primary key identifies the object
uniquely, so if you change the value of the corresponding java
field(s), then OJB and the database think that you have created a new
instance of the class/new row in the table.
Tom
in the java object, it is still the same
object and not a new one.
-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 9 février 2005 13:28
À : OJB Users List
Objet : Re: [newbie] ODMG API : updating an object's primary key.
Why would you want to do
But as far as OJB and the database is concerned, it is a new one,
because they cannot determine to which 'old' one it corresponds. The
problem here is that OJB and the database use object equality (if two
objects are equal as determined by equals()/hashCode()) whereas you
want to use identity
ok. Thank you.
-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 9 février 2005 13:52
À : OJB Users List
Objet : Re: [newbie] ODMG API : updating an object's primary key.
But as far as OJB and the database is concerned, it is a new one,
because