[OJB-developers] Optimistic Locking default values
Brought to you by:
thma
From: Jakob B. <jbr...@ho...> - 2002-02-07 07:28:41
|
hi, the following patch to the method bindInsert() of class StatementManager provides default values for the locking fields. /** * binds the values of the object obj to the statements parameters */ public void bindInsert(PreparedStatement stmt, ClassDescriptor cld, Object obj) throws java.sql.SQLException { Object[] values; cld.updateLockingValues(obj); // BRJ : provide useful defaults for locking fields values = cld.getAllValues(obj); for (int i = 0; i < values.length; i++) { Object val = values[i]; if (val != null) stmt.setObject(i + 1, val); else stmt.setNull(i + 1, JdbcAccess.getSqlTypeAll(cld, i)); } } jakob |