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, Configurable
Deprecated.UseTableGenerator
instead.A hilo IdentifierGenerator that returns a Long, constructed using a hi/lo algorithm. The hi value MUST be fetched in a seperate 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.Return a key unique to the underlying database objects.void
registerExportables(Database database)
Deprecated.Register the contained exportable things to theDatabase
java.lang.String[]
sqlCreateStrings(Dialect dialect)
Deprecated.The SQL required to create the underlying database objects.java.lang.String[]
sqlDropStrings(Dialect dialect)
Deprecated.The SQL required to remove the underlying database objects.-
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:Configurable
Configure this instance, given the value of parameters specified by the user as <param> elements. This method is called just once, following instantiation.- Specified by:
configure
in interfaceConfigurable
- Parameters:
type
- The id property type descriptorparams
- param values, keyed by parameter nameserviceRegistry
- Access to service that may be needed.- Throws:
MappingException
-
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:ExportableProducer
Register the contained exportable things to theDatabase
- Specified by:
registerExportables
in interfaceExportableProducer
- Parameters:
database
- The database instance
-
sqlCreateStrings
public java.lang.String[] sqlCreateStrings(Dialect dialect) throws HibernateException
Deprecated.Description copied from interface:PersistentIdentifierGenerator
The SQL required to create the underlying database objects.- Specified by:
sqlCreateStrings
in interfacePersistentIdentifierGenerator
- Parameters:
dialect
- The dialect against which to generate the create command(s)- Returns:
- The create command(s)
- Throws:
HibernateException
- problem creating the create command(s)
-
sqlDropStrings
public java.lang.String[] sqlDropStrings(Dialect dialect) throws HibernateException
Deprecated.Description copied from interface:PersistentIdentifierGenerator
The SQL required to remove the underlying database objects.- Specified by:
sqlDropStrings
in interfacePersistentIdentifierGenerator
- Parameters:
dialect
- The dialect against which to generate the drop command(s)- Returns:
- The drop command(s)
- Throws:
HibernateException
- problem creating the drop command(s)
-
generatorKey
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
-
-