Author: steve.ebersole(a)jboss.com
Date: 2007-01-31 18:46:11 -0500 (Wed, 31 Jan 2007)
New Revision: 11123
Modified:
trunk/Hibernate3/src/org/hibernate/id/TableHiLoGenerator.java
Log:
HHH-2393 : generated properties resultset
Modified: trunk/Hibernate3/src/org/hibernate/id/TableHiLoGenerator.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/id/TableHiLoGenerator.java 2007-01-31 20:16:47 UTC
(rev 11122)
+++ trunk/Hibernate3/src/org/hibernate/id/TableHiLoGenerator.java 2007-01-31 23:46:11 UTC
(rev 11123)
@@ -54,11 +54,12 @@
throws HibernateException {
if (maxLo < 1) {
//keep the behavior consistent even for boundary usages
- int val = ( (Integer) super.generate(session, obj) ).intValue();
+ long val = ( (Number) super.generate(session, obj) ).longValue();
+ if (val == 0) val = ( (Number) super.generate(session, obj) ).longValue();
return IdentifierGeneratorFactory.createNumber( val, returnClass );
}
if (lo>maxLo) {
- int hival = ( (Integer) super.generate(session, obj) ).intValue();
+ long hival = ( (Number) super.generate(session, obj) ).longValue();
lo = (hival == 0) ? 1 : 0;
hi = hival * (maxLo+1);
log.debug("new hi value: " + hival);
Show replies by date