Package org.hibernate.id
Class GUIDGenerator
- java.lang.Object
-
- org.hibernate.id.GUIDGenerator
-
- All Implemented Interfaces:
IdentifierGenerator
public class GUIDGenerator extends java.lang.Object implements IdentifierGenerator
Generates string values using the SQL Server NEWID() function.
-
-
Field Summary
-
Fields inherited from interface org.hibernate.id.IdentifierGenerator
ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
-
-
Constructor Summary
Constructors Constructor Description GUIDGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Serializablegenerate(SharedSessionContractImplementor session, java.lang.Object obj)Generate a new identifier.-
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
-
-
-
-
Method Detail
-
generate
public java.io.Serializable generate(SharedSessionContractImplementor session, java.lang.Object obj) throws HibernateException
Description copied from interface:IdentifierGeneratorGenerate a new identifier.- Specified by:
generatein 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
- Throws:
HibernateException- Indicates trouble generating the identifier
-
-