Package org.hibernate.id
Class MultipleHiLoPerTableGenerator
- java.lang.Object
-
- org.hibernate.id.MultipleHiLoPerTableGenerator
-
- All Implemented Interfaces:
ExportableProducer
,Configurable
,IdentifierGenerator
,PersistentIdentifierGenerator
@Deprecated public class MultipleHiLoPerTableGenerator extends java.lang.Object implements PersistentIdentifierGenerator
Deprecated.UseTableGenerator
instead.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)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_TABLE
Deprecated.static java.lang.String
ID_TABLE
Deprecated.static java.lang.String
MAX_LO
Deprecated.static java.lang.String
PK_COLUMN_NAME
Deprecated.static java.lang.String
PK_LENGTH_NAME
Deprecated.static java.lang.String
PK_VALUE_NAME
Deprecated.static java.lang.String
VALUE_COLUMN_NAME
Deprecated.-
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator
CATALOG, IDENTIFIER_NORMALIZER, PK, SCHEMA, TABLE, TABLES
-
-
Constructor Summary
Constructors Constructor Description MultipleHiLoPerTableGenerator()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry)
Deprecated.Configure this instance, given the value of parameters specified by the user as <param> elements.protected QualifiedName
determineGeneratorTableName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.protected java.lang.String
determineSegmentColumnName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.protected java.lang.String
determineValueColumnName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.java.io.Serializable
generate(SharedSessionContractImplementor session, java.lang.Object obj)
Deprecated.Generate a new identifier.java.lang.Object
generatorKey()
Deprecated.void
initialize(SqlStringGenerationContext context)
Deprecated.Initializes this instance, in particular pre-generates SQL as necessary.void
registerExportables(Database database)
Deprecated.Register database objects used by this identifier generator, e.g.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.id.IdentifierGenerator
supportsJdbcBatchInserts
-
-
-
-
Field Detail
-
ID_TABLE
public static final java.lang.String ID_TABLE
Deprecated.- See Also:
- Constant Field Values
-
PK_COLUMN_NAME
public static final java.lang.String PK_COLUMN_NAME
Deprecated.- See Also:
- Constant Field Values
-
PK_VALUE_NAME
public static final java.lang.String PK_VALUE_NAME
Deprecated.- See Also:
- Constant Field Values
-
VALUE_COLUMN_NAME
public static final java.lang.String VALUE_COLUMN_NAME
Deprecated.- See Also:
- Constant Field Values
-
PK_LENGTH_NAME
public static final java.lang.String PK_LENGTH_NAME
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_TABLE
public static final java.lang.String DEFAULT_TABLE
Deprecated.- See Also:
- Constant Field Values
-
MAX_LO
public static final java.lang.String MAX_LO
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
generate
public java.io.Serializable generate(SharedSessionContractImplementor session, java.lang.Object obj)
Deprecated.Description copied from interface:IdentifierGenerator
Generate a new identifier.- Specified by:
generate
in interfaceIdentifierGenerator
- Parameters:
session
- The session from which the request originatesobj
- the entity or collection (idbag) for which the id is being generated- Returns:
- a new identifier
-
configure
public void configure(Type type, java.util.Properties params, ServiceRegistry serviceRegistry) throws MappingException
Deprecated.Description copied from interface:IdentifierGenerator
Configure this instance, given the value of parameters specified by the user as <param> elements.This method is called just once, following instantiation, and before
IdentifierGenerator.registerExportables(Database)
.- Specified by:
configure
in interfaceConfigurable
- Specified by:
configure
in interfaceIdentifierGenerator
- Parameters:
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
- If configuration fails.
-
determineGeneratorTableName
protected QualifiedName determineGeneratorTableName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.
-
determineSegmentColumnName
protected java.lang.String determineSegmentColumnName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.
-
determineValueColumnName
protected java.lang.String determineValueColumnName(java.util.Properties params, JdbcEnvironment jdbcEnvironment)
Deprecated.
-
registerExportables
public void registerExportables(Database database)
Deprecated.Description copied from interface:IdentifierGenerator
Register database objects used by this identifier generator, e.g. sequences, tables, etc.This method is called just once, after
IdentifierGenerator.configure(Type, Properties, ServiceRegistry)
.- Specified by:
registerExportables
in interfaceExportableProducer
- Specified by:
registerExportables
in interfaceIdentifierGenerator
- Parameters:
database
- The database instance
-
initialize
public void initialize(SqlStringGenerationContext context)
Deprecated.Description copied from interface:IdentifierGenerator
Initializes this instance, in particular pre-generates SQL as necessary.This method is called after
IdentifierGenerator.registerExportables(Database)
, before first use.- Specified by:
initialize
in interfaceIdentifierGenerator
- Parameters:
context
- A context to help generate SQL strings
-
generatorKey
@Deprecated public java.lang.Object generatorKey()
Deprecated.Description copied from interface:PersistentIdentifierGenerator
Return a key unique to the underlying database objects. Prevents us from trying to create/remove them multiple times.- Specified by:
generatorKey
in interfacePersistentIdentifierGenerator
- Returns:
- Object an identifying key for this generator
-
-