Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.id.enhanced.SequenceStyleGenerator
public class SequenceStyleGenerator
extends java.lang.Object
implements PersistentIdentifierGenerator, Configurable
DatabaseStructure
interface internally.
General configuration parameters:
NAME | DEFAULT | DESCRIPTION |
SEQUENCE_PARAM | DEF_SEQUENCE_NAME | The name of the sequence/table to use to store/retrieve values |
INITIAL_PARAM | DEFAULT_INITIAL_VALUE | The initial value to be stored for the given segment; the effect in terms of storage varies based on Optimizer and DatabaseStructure |
INCREMENT_PARAM | DEFAULT_INCREMENT_SIZE | The increment size for the underlying segment; the effect in terms of storage varies based on Optimizer and DatabaseStructure |
OPT_PARAM | depends on defined increment size | Allows explicit definition of which optimization strategy to use | FORCE_TBL_PARAM | false | Allows explicit definition of which optimization strategy to use |
NAME | DEFAULT | DESCRIPTION |
VALUE_COLUMN_PARAM | DEF_VALUE_COLUMN | The name of column which holds the sequence value for the given segment |
Field Summary | |
static int | |
static int | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String | |
static String |
Fields inherited from interface org.hibernate.id.IdentifierGenerator | |
ENTITY_NAME |
Fields inherited from interface org.hibernate.id.PersistentIdentifierGenerator | |
CATALOG , PK , SCHEMA , SQL_STATEMENT_LOGGER , TABLE , TABLES |
Method Summary | |
void | |
Serializable |
|
Object | |
DatabaseStructure | |
Type | |
Optimizer | |
String[] |
|
String[] |
|
public static final int DEFAULT_INCREMENT_SIZE
- Field Value:
- 1
public static final int DEFAULT_INITIAL_VALUE
- Field Value:
- 1
public static final String DEF_SEQUENCE_NAME
public static final String DEF_VALUE_COLUMN
public static final String FORCE_TBL_PARAM
public static final String INCREMENT_PARAM
public static final String INITIAL_PARAM
public static final String OPT_PARAM
public static final String SEQUENCE_PARAM
public static final String VALUE_COLUMN_PARAM
public void configure(Type type, Properties params, Dialect dialect) throws MappingException
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 interface Configurable
- Parameters:
params
- param values, keyed by parameter name
public Serializable generate(SessionImplementor session, Object object) throws HibernateException
Generate a new identifier.
- Specified by:
- generate in interface IdentifierGenerator
- Parameters:
session
-object
- the entity or toplevel collection for which the id is being generated
- Returns:
- a new identifier
- Throws:
HibernateException
-
public Object generatorKey()
- Specified by:
- generatorKey in interface PersistentIdentifierGenerator
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException
- Specified by:
- sqlCreateStrings in interface PersistentIdentifierGenerator
public String[] sqlDropStrings(Dialect dialect) throws HibernateException
- Specified by:
- sqlDropStrings in interface PersistentIdentifierGenerator