Best code examples for Hibernate ORM UUIDHexGenerator class (org.hibernate.id.UUIDHexGenerator)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM UUIDHexGenerator class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Hibernate ORM UUIDHexGenerator examples from Open Source projects
This code example shows how to use the following methods: format, getCount, getHiTime, getIP, getJVM
 
    @Override 
    public BigInteger generate(SessionImplementor session, Object obj) {
 
        final String str = new StringBuilder(32)
                .append(format((short) 0))
                .append(format(getIP()))
                .append(format((short) (getJVM() >>> 16)))
                .append(format(getHiTime()))
                .append(format(getLoTime()))
                .append(format(getCount()))
                .toString();
 
        return new BigInteger(str, 16);
    } 
} 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
import org.hibernate.id.UUIDHexGenerator;
 
/** 
 * Custom identifier generator that preserves an existing value. 
 */ 
public class ReportingEventIdGenerator extends UUIDHexGenerator {
  @Override 
  public Serializable generate( final SessionImplementor session,
                                final Object object ) throws HibernateException {
    final Serializable id = session.getEntityPersister(null, object)
        .getClassMetadata().getIdentifier(object, session);
    return id != null ? id : super.generate(session, object);
  } 
} 
Full Snippet Info
3
CodeRank