程序包 org.hibernate.id
接口 IdentifierGenerator
-
- 所有已知子接口:
BulkInsertionCapableIdentifierGenerator,PersistentIdentifierGenerator,PostInsertIdentifierGenerator
- 所有已知实现类:
AbstractPostInsertGenerator,AbstractUUIDGenerator,Assigned,CompositeNestedGeneratedValueGenerator,ForeignGenerator,GUIDGenerator,IdentityGenerator,IncrementGenerator,MultipleHiLoPerTableGenerator,SelectGenerator,SequenceGenerator,SequenceHiLoGenerator,SequenceIdentityGenerator,SequenceStyleGenerator,TableGenerator,UUIDGenerator,UUIDHexGenerator
public interface IdentifierGeneratorThe general contract between a class that generates unique identifiers and the Session. It is not intended that this interface ever be exposed to the application. It is intended that users implement this interface to provide custom identifier generation strategies.
Implementors should provide a public default constructor.
Implementations that accept configuration parameters should also implement Configurable.
Implementors must be thread-safe- 作者:
- Gavin King
- 另请参阅:
PersistentIdentifierGenerator,Configurable
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringENTITY_NAMEThe configuration parameter holding the entity namestatic StringGENERATOR_NAMEUsed as a key to pass the name used asGeneratedValue.generator()to theIdentifierGeneratoras it is configured.static StringJPA_ENTITY_NAMEThe configuration parameter holding the JPA entity name
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 Serializablegenerate(SharedSessionContractImplementor session, Object object)Generate a new identifier.default booleansupportsJdbcBatchInserts()Check if JDBC batch inserts are supported.
-
-
-
字段详细资料
-
ENTITY_NAME
static final String ENTITY_NAME
The configuration parameter holding the entity name- 另请参阅:
- 常量字段值
-
JPA_ENTITY_NAME
static final String JPA_ENTITY_NAME
The configuration parameter holding the JPA entity name- 另请参阅:
- 常量字段值
-
GENERATOR_NAME
static final String GENERATOR_NAME
Used as a key to pass the name used asGeneratedValue.generator()to theIdentifierGeneratoras it is configured.- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
generate
Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException
Generate a new identifier.- 参数:
session- The session from which the request originatesobject- the entity or collection (idbag) for which the id is being generated- 返回:
- a new identifier
- 抛出:
HibernateException- Indicates trouble generating the identifier
-
supportsJdbcBatchInserts
default boolean supportsJdbcBatchInserts()
Check if JDBC batch inserts are supported.- 返回:
- JDBC batch inserts are supported.
-
-