org.hibernate.id
Class IdentifierGeneratorFactory

java.lang.Object
  extended by org.hibernate.id.IdentifierGeneratorFactory

public final class IdentifierGeneratorFactory
extends 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT_CIRCUIT_INDICATOR

public static final Serializable SHORT_CIRCUIT_INDICATOR

POST_INSERT_INDICATOR

public static final Serializable POST_INSERT_INDICATOR
Method Detail

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:
SQLException - Can be thrown while accessing the result set
HibernateException - Indicates a problem reading back a generated identity value.

get

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

create

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

getIdentifierGeneratorClass

public static Class getIdentifierGeneratorClass(String strategy,
                                                Dialect dialect)

createNumber

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


Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved