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:
mdb
2006-12-20 21:51:46 +00:00
parent 7b64416eeb
commit bad40f8a0b
@@ -41,7 +41,7 @@ public class TableKeyGenerator implements KeyGenerator
_pkColumnValue = defStr(annotation.pkColumnValue(), "default");
_valueColumnName = defStr(annotation.valueColumnName(), "value");
_allocationSize = annotation.allocationSize();
_initialValue = _allocationSize > 0 ? _allocationSize : 1;
_initialValue = annotation.initialValue();
}
// from interface KeyGenerator
@@ -72,9 +72,8 @@ public class TableKeyGenerator implements KeyGenerator
JDBCUtil.close(stmt);
stmt = null;
stmt = conn.prepareStatement(
"INSERT INTO " + _table + " SET " + _pkColumnName + " = ?, " +
_valueColumnName + " = ? ");
stmt = conn.prepareStatement("INSERT INTO " + _table + " SET " +
_pkColumnName + " = ?, " + _valueColumnName + " = ?");
stmt.setString(1, _pkColumnValue);
stmt.setInt(2, _initialValue);
stmt.executeUpdate();