程序包 org.hibernate.id
类 MultipleHiLoPerTableGenerator
- java.lang.Object
-
- org.hibernate.id.MultipleHiLoPerTableGenerator
-
@Deprecated public class MultipleHiLoPerTableGenerator extends Object implements PersistentIdentifierGenerator, Configurable
已过时。UseTableGeneratorinstead.A hilo IdentifierGenerator that returns a Long, constructed using a hi/lo algorithm. The hi value MUST be fetched in a separate transaction to the Session transaction so the generator must be able to obtain a new connection and commit it. Hence this implementation may not be used when the user is supplying connections. In this case a SequenceHiLoGenerator would be a better choice (where supported).
A hilo IdentifierGenerator that uses a database table to store the last generated values. A table can contains several hi values. They are distinct from each other through a keyThis implementation is not compliant with a user connection
Allowed parameters (all of them are optional):
- table: table name (default hibernate_sequences)
- primary_key_column: key column name (default sequence_name)
- value_column: hi value column name(default sequence_next_hi_value)
- primary_key_value: key value for the current entity (default to the entity's primary table name)
- primary_key_length: length of the key column in DB represented as a varchar (default to 255)
- max_lo: max low value before increasing hi (default to Short.MAX_VALUE)
- 作者:
- Emmanuel Bernard, Klaus Richarz.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringDEFAULT_TABLE已过时。static StringID_TABLE已过时。static StringMAX_LO已过时。static StringPK_COLUMN_NAME已过时。static StringPK_LENGTH_NAME已过时。static StringPK_VALUE_NAME已过时。static StringVALUE_COLUMN_NAME已过时。-
从接口继承的字段 org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
从接口继承的字段 org.hibernate.id.PersistentIdentifierGenerator
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES
-
-
构造器概要
构造器 构造器 说明 MultipleHiLoPerTableGenerator()已过时。
-
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 voidconfigure(Type type, Properties params, ServiceRegistry serviceRegistry)已过时。Configure this instance, given the value of parameters specified by the user as <param> elements.protected QualifiedNamedetermineGeneratorTableName(Properties params, JdbcEnvironment jdbcEnvironment)已过时。protected StringdetermineSegmentColumnName(Properties params, JdbcEnvironment jdbcEnvironment)已过时。protected StringdetermineValueColumnName(Properties params, JdbcEnvironment jdbcEnvironment)已过时。Serializablegenerate(SharedSessionContractImplementor session, Object obj)已过时。Generate a new identifier.ObjectgeneratorKey()已过时。Return a key unique to the underlying database objects.voidregisterExportables(Database database)已过时。Register the contained exportable things to theDatabaseString[]sqlCreateStrings(Dialect dialect)已过时。The SQL required to create the underlying database objects.String[]sqlDropStrings(Dialect dialect)已过时。The SQL required to remove the underlying database objects.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
方法详细资料
-
generate
public Serializable generate(SharedSessionContractImplementor session, Object obj)
已过时。从接口复制的说明:IdentifierGeneratorGenerate a new identifier.- 指定者:
generate在接口中IdentifierGenerator- 参数:
session- The session from which the request originatesobj- the entity or collection (idbag) for which the id is being generated- 返回:
- a new identifier
-
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
-
determineGeneratorTableName
protected QualifiedName determineGeneratorTableName(Properties params, JdbcEnvironment jdbcEnvironment)
已过时。
-
determineSegmentColumnName
protected String determineSegmentColumnName(Properties params, JdbcEnvironment jdbcEnvironment)
已过时。
-
determineValueColumnName
protected String determineValueColumnName(Properties params, JdbcEnvironment jdbcEnvironment)
已过时。
-
registerExportables
public void registerExportables(Database database)
已过时。从接口复制的说明:ExportableProducerRegister the contained exportable things to theDatabase- 指定者:
registerExportables在接口中ExportableProducer- 参数:
database- The database instance
-
sqlCreateStrings
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException
已过时。从接口复制的说明:PersistentIdentifierGeneratorThe SQL required to create the underlying database objects.- 指定者:
sqlCreateStrings在接口中PersistentIdentifierGenerator- 参数:
dialect- The dialect against which to generate the create command(s)- 返回:
- The create command(s)
- 抛出:
HibernateException- problem creating the create command(s)
-
sqlDropStrings
public String[] sqlDropStrings(Dialect dialect) throws HibernateException
已过时。从接口复制的说明:PersistentIdentifierGeneratorThe SQL required to remove the underlying database objects.- 指定者:
sqlDropStrings在接口中PersistentIdentifierGenerator- 参数:
dialect- The dialect against which to generate the drop command(s)- 返回:
- The drop command(s)
- 抛出:
HibernateException- problem creating the drop command(s)
-
generatorKey
public Object generatorKey()
已过时。从接口复制的说明:PersistentIdentifierGeneratorReturn a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.- 指定者:
generatorKey在接口中PersistentIdentifierGenerator- 返回:
- Object an identifying key for this generator
-
-