public synchronized Serializable generate(SessionImplementor session, Object obj) throws HibernateException { if (lo>maxLo) { long hival = ( (Number) super.generate(session, obj) ).longValue(); lo = 1; hi = hival * (maxLo+1); logger.debug("new hi value: " + hival); } return createNumber( hi + lo++, returnClass ); }
public synchronized Serializable generate(SessionImplementor session, Object object) throws HibernateException { int result = ( (Integer) doWorkInNewTransaction(session) ).intValue(); return new Integer(result); }
public synchronized Serializable generate(SessionImplementor session, Object object) { return generateHolder( session ).makeValue(); }
public void configure(Type type, Properties params, Dialect d) { super.configure(type, params, d); maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE); lo = maxLo + 1; // so we "clock over" on the first invocation returnClass = type.getReturnedClass(); }
@Override public IntegralDataTypeHolder execute(Connection connection) throws SQLException { IntegralDataTypeHolder value = buildHolder(); int rows; do {
@Override public String[] sqlCreateStrings(Dialect dialect) { String[] createTableStatements = super.sqlCreateStrings(dialect); for (int i = 0; i < createTableStatements.length; i++) { String createTableStatement = createTableStatements[i]; if (createTableStatement.startsWith(dialect.getCreateTableString())) { createTableStatements[i] = createTableStatement + dialect.getTableTypeString(); break; } } return createTableStatements; }
public void configure(Type type, Properties params, Dialect d) { super.configure(type, params, d); maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE); lo = maxLo + 1; // so we "clock over" on the first invocation returnClass = type.getReturnedClass(); }
@Override public IntegralDataTypeHolder execute(Connection connection) throws SQLException { IntegralDataTypeHolder value = buildHolder(); int rows; do {
public void configure(Type type, Properties params, Dialect d) { super.configure(type, params, d); maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE); lo = maxLo + 1; // so we "clock over" on the first invocation returnClass = type.getReturnedClass(); }
public synchronized Serializable generate(SessionImplementor session, Object obj) throws HibernateException { if (maxLo < 1) { //keep the behavior consistent even for boundary usages int val = ( (Integer) super.generate(session, obj) ).intValue(); return IdentifierGeneratorFactory.createNumber( val, returnClass ); } if (lo>maxLo) { int hival = ( (Integer) super.generate(session, obj) ).intValue(); lo = (hival == 0) ? 1 : 0; hi = hival * (maxLo+1); log.debug("new hi value: " + hival); } return IdentifierGeneratorFactory.createNumber( hi + lo++, returnClass ); }
public synchronized Serializable generate(SessionImplementor session, Object object) throws HibernateException { int result = ( (Integer) doWorkInNewTransaction(session) ).intValue(); return new Integer(result); }
public synchronized Serializable generate(SessionImplementor session, Object object) { return generateHolder( session ).makeValue(); }
public void configure(Type type, Properties params, Dialect d) { super.configure(type, params, d); maxLo = ConfigurationHelper.getInt(MAX_LO, params, Short.MAX_VALUE); if ( maxLo >= 1 ) { hiloOptimizer = new OptimizerFactory.LegacyHiLoAlgorithmOptimizer( type.getReturnedClass(), maxLo ); } }
public synchronized Serializable generate(SessionImplementor session, Object obj) throws HibernateException { if (maxLo < 2) { //keep the behavior consistent even for boundary usages int val = ( (Integer) super.generate(session, obj) ).intValue(); return IdentifierGeneratorFactory.createNumber( val, returnClass ); } if (lo>maxLo) { int hival = ( (Integer) super.generate(session, obj) ).intValue(); lo = (hival == 0) ? 1 : 0; hi = hival * (maxLo+1); log.debug("new hi value: " + hival); } return IdentifierGeneratorFactory.createNumber( hi + lo++, returnClass ); }
public void configure(Type type, Properties params, Dialect d) { super.configure(type, params, d); maxLo = ConfigurationHelper.getInt(MAX_LO, params, Short.MAX_VALUE); if ( maxLo >= 1 ) { hiloOptimizer = new OptimizerFactory.LegacyHiLoAlgorithmOptimizer( type.getReturnedClass(), maxLo ); } }