Author: cbredesen
Date: 2008-10-07 16:47:28 -0400 (Tue, 07 Oct 2008)
New Revision: 15261
Modified:
core/patches/v313_HHH-2397/src/org/hibernate/id/TableHiLoGenerator.java
Log:
HHH-2397
Modified: core/patches/v313_HHH-2397/src/org/hibernate/id/TableHiLoGenerator.java
===================================================================
--- core/patches/v313_HHH-2397/src/org/hibernate/id/TableHiLoGenerator.java 2008-10-07
20:09:58 UTC (rev 15260)
+++ core/patches/v313_HHH-2397/src/org/hibernate/id/TableHiLoGenerator.java 2008-10-07
20:47:28 UTC (rev 15261)
@@ -54,11 +54,12 @@
throws HibernateException {
if (maxLo < 2) {
//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