|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.engine.TransactionHelper org.hibernate.id.enhanced.TableGenerator
A "segmented" version of the enhanced table generator. The term "segmented" refers to the fact that this table can hold multiple value generators, segmented by a key.
Configuration parameters:NAME | DEFAULT | DESCRIPTION |
TABLE_PARAM |
DEF_TABLE |
The name of the table to use to store/retrieve values |
VALUE_COLUMN_PARAM |
DEF_VALUE_COLUMN |
The name of column which holds the sequence value for the given segment |
SEGMENT_COLUMN_PARAM |
DEF_SEGMENT_COLUMN |
The name of the column which holds the segment key |
SEGMENT_VALUE_PARAM |
DEF_SEGMENT_VALUE |
The value indicating which segment is used by this generator; refers to values in the SEGMENT_COLUMN_PARAM column |
SEGMENT_LENGTH_PARAM |
DEF_SEGMENT_LENGTH |
The data length of the SEGMENT_COLUMN_PARAM column; used for schema creation |
INITIAL_PARAM |
DEFAULT_INITIAL_VALUE |
The initial value to be stored for the given segment |
INCREMENT_PARAM |
DEFAULT_INCREMENT_SIZE |
The increment size for the underlying segment; see the discussion on Optimizer for more details. |
OPT_PARAM |
depends on defined increment size | Allows explicit definition of which optimization strategy to use |
Field Summary | |
static String |
DEF_SEGMENT_COLUMN
|
static int |
DEF_SEGMENT_LENGTH
|
static String |
DEF_SEGMENT_VALUE
|
static String |
DEF_TABLE
|
static String |
DEF_VALUE_COLUMN
|
static int |
DEFAULT_INCREMENT_SIZE
|
static int |
DEFAULT_INITIAL_VALUE
|
static String |
INCREMENT_PARAM
|
static String |
INITIAL_PARAM
|
static String |
OPT_PARAM
|
static String |
SEGMENT_COLUMN_PARAM
|
static String |
SEGMENT_LENGTH_PARAM
|
static String |
SEGMENT_VALUE_PARAM
|
static String |
TABLE_PARAM
|
static String |
VALUE_COLUMN_PARAM
|
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator |
CATALOG, PK, SCHEMA, SQL, TABLE, TABLES |
Fields inherited from interface org.hibernate.id.IdentifierGenerator |
ENTITY_NAME |
Constructor Summary | |
TableGenerator()
|
Method Summary | |
void |
configure(Type type,
Properties params,
Dialect dialect)
Configure this instance, given the value of parameters specified by the user as <param> elements. |
Serializable |
doWorkInCurrentTransaction(Connection conn,
String sql)
The work to be done |
Serializable |
generate(SessionImplementor session,
Object obj)
Generate a new identifier. |
Object |
generatorKey()
Return a key unique to the underlying database objects. |
Type |
getIdentifierType()
|
int |
getIncrementSize()
|
int |
getInitialValue()
|
Optimizer |
getOptimizer()
|
String |
getSegmentColumnName()
|
String |
getSegmentValue()
|
int |
getSegmentValueLength()
|
long |
getTableAccessCount()
|
String |
getTableName()
|
String |
getValueColumnName()
|
String[] |
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. |
Methods inherited from class org.hibernate.engine.TransactionHelper |
doWorkInNewTransaction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String TABLE_PARAM
public static final String DEF_TABLE
public static final String VALUE_COLUMN_PARAM
public static final String DEF_VALUE_COLUMN
public static final String SEGMENT_COLUMN_PARAM
public static final String DEF_SEGMENT_COLUMN
public static final String SEGMENT_VALUE_PARAM
public static final String DEF_SEGMENT_VALUE
public static final String SEGMENT_LENGTH_PARAM
public static final int DEF_SEGMENT_LENGTH
public static final String INITIAL_PARAM
public static final int DEFAULT_INITIAL_VALUE
public static final String INCREMENT_PARAM
public static final int DEFAULT_INCREMENT_SIZE
public static final String OPT_PARAM
Constructor Detail |
public TableGenerator()
Method Detail |
public String getTableName()
public String getSegmentColumnName()
public String getSegmentValue()
public int getSegmentValueLength()
public String getValueColumnName()
public Type getIdentifierType()
public int getInitialValue()
public int getIncrementSize()
public Optimizer getOptimizer()
public long getTableAccessCount()
public void configure(Type type, Properties params, Dialect dialect) throws MappingException
Configurable
configure
in interface Configurable
params
- param values, keyed by parameter name
MappingException
public Serializable generate(SessionImplementor session, Object obj)
IdentifierGenerator
generate
in interface IdentifierGenerator
session
- obj
- the entity or toplevel collection for which the id is being generated
public Serializable doWorkInCurrentTransaction(Connection conn, String sql) throws SQLException
TransactionHelper
doWorkInCurrentTransaction
in class TransactionHelper
SQLException
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
sqlCreateStrings
in interface PersistentIdentifierGenerator
dialect
-
HibernateException
public String[] sqlDropStrings(Dialect dialect) throws HibernateException
PersistentIdentifierGenerator
sqlDropStrings
in interface PersistentIdentifierGenerator
dialect
-
HibernateException
public Object generatorKey()
PersistentIdentifierGenerator
generatorKey
in interface PersistentIdentifierGenerator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |