eclipselink
eclipselink copied to clipboard
Support for Statement.getGeneratedKeys for Identity - Oracle platform
Based on #1480 there should be another fix/improvement implemented.
Line 1607 statement = nativeConnection.prepareStatement(call.getSQLString(), Statement.RETURN_GENERATED_KEYS);
in org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor
should contain instead of Statement.RETURN_GENERATED_KEYS
an array of column names indicating the columns that should be returned from the inserted row or rows.
Something like nativeConnection.prepareStatement(call.getSQLString(), new String[] {"ID"});
(this is just for example - list of the DB columns is hardcoded).
What should be tricky there is pass information about columns to the DatabaseAccessor
level.
Oracle DB/JDBC driver return for ...prepareStatement(call.getSQLString(), Statement.RETURN_GENERATED_KEYS)...
ROWID instead of primary key(s).