TableKeyGenerator was not using the annotation specified initial value.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2002 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -41,7 +41,7 @@ public class TableKeyGenerator implements KeyGenerator
|
|||||||
_pkColumnValue = defStr(annotation.pkColumnValue(), "default");
|
_pkColumnValue = defStr(annotation.pkColumnValue(), "default");
|
||||||
_valueColumnName = defStr(annotation.valueColumnName(), "value");
|
_valueColumnName = defStr(annotation.valueColumnName(), "value");
|
||||||
_allocationSize = annotation.allocationSize();
|
_allocationSize = annotation.allocationSize();
|
||||||
_initialValue = _allocationSize > 0 ? _allocationSize : 1;
|
_initialValue = annotation.initialValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// from interface KeyGenerator
|
// from interface KeyGenerator
|
||||||
@@ -72,9 +72,8 @@ public class TableKeyGenerator implements KeyGenerator
|
|||||||
|
|
||||||
JDBCUtil.close(stmt);
|
JDBCUtil.close(stmt);
|
||||||
stmt = null;
|
stmt = null;
|
||||||
stmt = conn.prepareStatement(
|
stmt = conn.prepareStatement("INSERT INTO " + _table + " SET " +
|
||||||
"INSERT INTO " + _table + " SET " + _pkColumnName + " = ?, " +
|
_pkColumnName + " = ?, " + _valueColumnName + " = ?");
|
||||||
_valueColumnName + " = ? ");
|
|
||||||
stmt.setString(1, _pkColumnValue);
|
stmt.setString(1, _pkColumnValue);
|
||||||
stmt.setInt(2, _initialValue);
|
stmt.setInt(2, _initialValue);
|
||||||
stmt.executeUpdate();
|
stmt.executeUpdate();
|
||||||
|
|||||||
Reference in New Issue
Block a user