java.lang.Object
com.broadleafcommerce.auth.repository.provider.hibernate.generation.ULIDGenerationStrategy
All Implemented Interfaces:
Serializable, org.hibernate.boot.model.relational.ExportableProducer, org.hibernate.generator.BeforeExecutionGenerator, org.hibernate.generator.Generator, org.hibernate.id.Configurable, org.hibernate.id.IdentifierGenerator

public class ULIDGenerationStrategy extends Object implements org.hibernate.id.IdentifierGenerator, org.hibernate.id.Configurable
A generation strategy that generates a ULID for a primary key. This assumes that the property the ULID is generated for is a String. For more information about the advantages of ULIDs over UUIDs for primary keys see the docs.
Author:
Phillip Verheyden (phillipuniverse)
See Also:
  • Field Summary

    Fields inherited from interface org.hibernate.id.IdentifierGenerator

    CONTRIBUTOR_NAME, ENTITY_NAME, GENERATOR_NAME, JPA_ENTITY_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    generate(org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.hibernate.generator.BeforeExecutionGenerator

    generatedOnExecution

    Methods inherited from interface org.hibernate.id.Configurable

    configure, initialize

    Methods inherited from interface org.hibernate.generator.Generator

    allowMutation, generatedBeforeExecution, generatedOnExecution, generatesOnForceIncrement, generatesOnInsert, generatesOnUpdate, generatesSometimes, getGeneratedType

    Methods inherited from interface org.hibernate.id.IdentifierGenerator

    configure, generate, getEventTypes, registerExportables
  • Constructor Details

    • ULIDGenerationStrategy

      public ULIDGenerationStrategy()
  • Method Details

    • generate

      public Serializable generate(org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws org.hibernate.HibernateException
      Specified by:
      generate in interface org.hibernate.id.IdentifierGenerator
      Throws:
      org.hibernate.HibernateException
    • allowAssignedIdentifiers

      public boolean allowAssignedIdentifiers()
      Specified by:
      allowAssignedIdentifiers in interface org.hibernate.generator.Generator