站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

IdentifierGenerator (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.id
Interface IdentifierGenerator

All Known Subinterfaces:
PersistentIdentifierGenerator
All Known Implementing Classes:
Assigned, CounterGenerator, ForeignGenerator, IdentityGenerator, IncrementGenerator, SequenceGenerator, TableGenerator, UUIDGenerator

public interface IdentifierGenerator

The 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 threadsafe

Author:
Gavin King
See Also:
PersistentIdentifierGenerator, Configurable

Method Summary
 Serializable generate(SessionImplementor session, Object object)
          Generate a new identifier.
 

Method Detail

generate

public Serializable generate(SessionImplementor session,
                             Object object)
                      throws SQLException,
                             HibernateException
Generate a new identifier.

Parameters:
session -
object - the entity or toplevel collection for which the id is being generated
Returns:
Serializable a new identifier
Throws:
SQLException
IdentifierGenerationException
HibernateException