> Using opaque database mechanisms for the primary key generation was
> intentionally "overlooked" in Cayenne. The reason being a problem of
> retrieving the value, that was just assigned to the inserted row, back
> into the object on the Java side. This is absolutely essential for the O/R.
The baseline is absolutely simlpe: it will never ever work.
The purpose of a primary key is to uniquely identify a database row. If
you don't know the PK, you don't know the identity of that row.
Suppose you insert a new row into the database with colums a, b and c.
If you just select from table where a = <value of a> and b = <value of
b> and c = <value of c> you can't be sure that there isn't more than one
row in the DB with these values. How do you decide which one is the
newly created row?
Even worse: this problem does not only apply to O/R mapping. How would
you handle such a problem when programming plain JDBC?
-dirk
This archive was generated by hypermail 2.0.0 : Sat Jan 04 2003 - 00:24:21 EST