Package org.openbravo.base.session
Class DalUUIDGenerator
- java.lang.Object
-
- org.hibernate.id.UUIDGenerator
-
- org.openbravo.base.session.DalUUIDGenerator
-
- All Implemented Interfaces:
org.hibernate.id.Configurable
,org.hibernate.id.IdentifierGenerator
public class DalUUIDGenerator extends org.hibernate.id.UUIDGenerator
Extends the standard Hibernate UUIDGenerator. This is needed because:- the standard Hibernate UUIDGenerator will overwrite the id even if the object already has one. The goal is to try to keep an id if it has been assigned to an object. This is important in case of imports.
- the standard uuidgenerator will generate uuid strings of length 36 with the - as a separator, the length should be 32
- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description DalUUIDGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serializable
generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj)
-
Methods inherited from class org.hibernate.id.UUIDGenerator
buildSessionFactoryUniqueIdentifierGenerator, configure
-
-
-
-
Method Detail
-
generate
public Serializable generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object obj) throws org.hibernate.HibernateException
- Specified by:
generate
in interfaceorg.hibernate.id.IdentifierGenerator
- Overrides:
generate
in classorg.hibernate.id.UUIDGenerator
- Throws:
org.hibernate.HibernateException
-
-