private IntegralDataTypeHolder makeValue() { return IdentifierGeneratorHelper.getIntegralDataTypeHolder( numberType ); }
@Override protected Serializable getResult( SharedSessionContractImplementor session, ResultSet rs, Object object) throws SQLException { return IdentifierGeneratorHelper.getGeneratedIdentity( rs, persister.getRootTableKeyColumnNames()[0], persister.getIdentifierType(), session.getJdbcServices().getJdbcEnvironment().getDialect() ); } }
public IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor) { checkInitialized(); value = value.multiply( extractBigDecimal( factor ) ); return this; }
public IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor) { checkInitialized(); value = value.multiply( extractBigInteger( factor ) ); return this; }
public boolean eq(IntegralDataTypeHolder other) { return eq( extractLong( other ) ); }
/** * Get the generated identifier when using identity columns * * @param rs The result set from which to extract the the generated identity. * @param identifier The name of the identifier column * @param type The expected type mapping for the identity value. * @param dialect The current database dialect. * * @return The generated identity value * * @throws SQLException Can be thrown while accessing the result set * @throws HibernateException Indicates a problem reading back a generated identity value. */ public static Serializable getGeneratedIdentity(ResultSet rs, String identifier, Type type, Dialect dialect) throws SQLException, HibernateException { if ( !rs.next() ) { throw new HibernateException( "The database returned no natively generated identity value" ); } final Serializable id = get( rs, identifier, type, dialect ); LOG.debugf( "Natively generated identity: %s", id ); return id; }
return extractIdentifier( rs, identifier, type, clazz ); return extractIdentifier( rs, StringHelper.unquote( identifier, dialect ), type, clazz );
public boolean eq(IntegralDataTypeHolder other) { checkInitialized(); return value.compareTo( extractBigInteger( other ) ) == 0; }
public IntegralDataTypeHolder multiplyBy(IntegralDataTypeHolder factor) { return multiplyBy( extractLong( factor ) ); }
/** * Get the generated identifier when using identity columns * * @param rs The result set from which to extract the the generated identity. * @param identifier The name of the identifier column * @param type The expected type mapping for the identity value. * * @return The generated identity value * * @throws SQLException Can be thrown while accessing the result set * @throws HibernateException Indicates a problem reading back a generated identity value. */ public static Serializable getGeneratedIdentity(ResultSet rs, String identifier, Type type) throws SQLException, HibernateException { if ( !rs.next() ) { throw new HibernateException( "The database returned no natively generated identity value" ); } final Serializable id = get( rs, identifier, type ); LOG.debugf( "Natively generated identity: %s", id ); return id; }
return extractIdentifier( rs, identifier, type, clazz ); return extractIdentifier( rs, StringHelper.unquote( identifier, dialect ), type, clazz );
protected IntegralDataTypeHolder makeHolder() { return IdentifierGeneratorHelper.getIntegralDataTypeHolder( BigDecimal.class ); } }
@Override protected Serializable executeAndExtract(PreparedStatement insert, SharedSessionContractImplementor session) throws SQLException { session.getJdbcCoordinator().getResultSetReturn().executeUpdate( insert ); return IdentifierGeneratorHelper.getGeneratedIdentity( insert.getGeneratedKeys(), getPersister().getRootTableKeyColumnNames()[0], getPersister().getIdentifierType(), session.getJdbcServices().getJdbcEnvironment().getDialect() ); } }
public boolean lt(IntegralDataTypeHolder other) { checkInitialized(); return value.compareTo( extractBigInteger( other ) ) < 0; }
public boolean eq(IntegralDataTypeHolder other) { checkInitialized(); return value.compareTo( extractBigDecimal( other ) ) == 0; }
public boolean lt(IntegralDataTypeHolder other) { return lt( extractLong( other ) ); }
/** * Get the generated identifier when using identity columns * * @param rs The result set from which to extract the the generated identity. * @param identifier The name of the identifier column * @param type The expected type mapping for the identity value. * * @return The generated identity value * * @throws SQLException Can be thrown while accessing the result set * @throws HibernateException Indicates a problem reading back a generated identity value. */ public static Serializable getGeneratedIdentity(ResultSet rs, String identifier, Type type) throws SQLException, HibernateException { if ( !rs.next() ) { throw new HibernateException( "The database returned no natively generated identity value" ); } final Serializable id = get( rs, identifier, type ); LOG.debugf( "Natively generated identity: %s", id ); return id; }
protected IntegralDataTypeHolder buildHolder() { return IdentifierGeneratorHelper.getIntegralDataTypeHolder( identifierType.getReturnedClass() ); }
@Override public Serializable executeAndExtract(PreparedStatement insert, SharedSessionContractImplementor session) throws SQLException { session.getJdbcCoordinator().getResultSetReturn().executeUpdate( insert ); ResultSet rs = null; try { rs = insert.getGeneratedKeys(); return IdentifierGeneratorHelper.getGeneratedIdentity( rs, persister.getRootTableKeyColumnNames()[0], persister.getIdentifierType(), session.getJdbcServices().getJdbcEnvironment().getDialect() ); } finally { if ( rs != null ) { session.getJdbcCoordinator().getLogicalConnection().getResourceRegistry().release( rs, insert ); } } } }
public boolean gt(IntegralDataTypeHolder other) { checkInitialized(); return value.compareTo( extractBigInteger( other ) ) > 0; }