程序包 org.hibernate.id
类 UUIDGenerator
- java.lang.Object
-
- org.hibernate.id.UUIDGenerator
-
- 所有已实现的接口:
Configurable,IdentifierGenerator
public class UUIDGenerator extends Object implements IdentifierGenerator, Configurable
AnIdentifierGeneratorwhich generatesUUIDvalues using a pluggablegeneration strategy. The values this generator can return includeUUID,Stringand byte[16] Supports 2 config parameters:UUID_GEN_STRATEGY- names theUUIDGenerationStrategyinstance to useUUID_GEN_STRATEGY_CLASS- names theUUIDGenerationStrategyclass to use
UUIDGenerationStrategy:StandardRandomStrategy(the default, if none specified)CustomVersionOneStrategy
- 作者:
- Steve Ebersole
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringUUID_GEN_STRATEGYstatic StringUUID_GEN_STRATEGY_CLASS-
从接口继承的字段 org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
构造器概要
构造器 构造器 说明 UUIDGenerator()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static UUIDGeneratorbuildSessionFactoryUniqueIdentifierGenerator()voidconfigure(Type type, Properties params, ServiceRegistry serviceRegistry)Configure this instance, given the value of parameters specified by the user as <param> elements.Serializablegenerate(SharedSessionContractImplementor session, Object object)Generate a new identifier.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
方法详细资料
-
buildSessionFactoryUniqueIdentifierGenerator
public static UUIDGenerator buildSessionFactoryUniqueIdentifierGenerator()
-
configure
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException
从接口复制的说明:ConfigurableConfigure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.- 指定者:
configure在接口中Configurable- 参数:
type- The id property type descriptorparams- param values, keyed by parameter nameserviceRegistry- Access to service that may be needed.- 抛出:
MappingException
-
generate
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
从接口复制的说明:IdentifierGeneratorGenerate a new identifier.- 指定者:
generate在接口中IdentifierGenerator- 参数:
session- The session from which the request originatesobject- the entity or collection (idbag) for which the id is being generated- 返回:
- a new identifier
- 抛出:
HibernateException- Indicates trouble generating the identifier
-
-