/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }