org.hibernate.id

Class IdentifierGeneratorFactory


public final class IdentifierGeneratorFactory
extends java.lang.Object

Factory and helper methods for IdentifierGenerator framework.
Author:
Gavin King

Field Summary

static Serializable
POST_INSERT_INDICATOR
static Serializable
SHORT_CIRCUIT_INDICATOR

Method Summary

static IdentifierGenerator
create(String strategy, Type type, Properties params, Dialect dialect)
static Number
createNumber(long value, Class clazz)
static Serializable
get(ResultSet rs, Type type)
static Serializable
getGeneratedIdentity(ResultSet rs, Type type)
Get the generated identifier when using identity columns
static Class
getIdentifierGeneratorClass(String strategy, Dialect dialect)

Field Details

POST_INSERT_INDICATOR

public static final Serializable POST_INSERT_INDICATOR

SHORT_CIRCUIT_INDICATOR

public static final Serializable SHORT_CIRCUIT_INDICATOR

Method Details

create

public static IdentifierGenerator create(String strategy,
                                         Type type,
                                         Properties params,
                                         Dialect dialect)
            throws MappingException

createNumber

public static Number createNumber(long value,
                                  Class clazz)
            throws IdentifierGenerationException

get

public static Serializable get(ResultSet rs,
                               Type type)
            throws SQLException,
                   IdentifierGenerationException

getGeneratedIdentity

public static Serializable getGeneratedIdentity(ResultSet rs,
                                                Type type)
            throws SQLException,
                   HibernateException
Get the generated identifier when using identity columns
Parameters:
rs - The result set from which to extract the the generated identity.
type - The expected type mapping for the identity value.
Returns:
The generated identity value
Throws:
HibernateException - Indicates a problem reading back a generated identity value.

getIdentifierGeneratorClass

public static Class getIdentifierGeneratorClass(String strategy,
                                                Dialect dialect)