Class TurUuidGenerator

java.lang.Object
com.viglet.turing.persistence.utils.TurUuidGenerator
All Implemented Interfaces:
Serializable, org.hibernate.generator.AnnotationBasedGenerator<TurAssignableUuidGenerator>, org.hibernate.generator.BeforeExecutionGenerator, org.hibernate.generator.Generator

public class TurUuidGenerator extends Object implements org.hibernate.generator.BeforeExecutionGenerator, org.hibernate.generator.AnnotationBasedGenerator<TurAssignableUuidGenerator>
Custom UUID generator that allows pre-assigned identifiers. * Updated to Hibernate 6 compatibility using AnnotationBasedGenerator.
Since:
0.3.9
Author:
Alexandre Oliveira
See Also:
  • Constructor Details

    • TurUuidGenerator

      public TurUuidGenerator()
  • Method Details

    • initialize

      public void initialize(TurAssignableUuidGenerator annotation, Member member, org.hibernate.generator.GeneratorCreationContext context)
      Specified by:
      initialize in interface org.hibernate.generator.AnnotationBasedGenerator<TurAssignableUuidGenerator>
    • generate

      public Object generate(org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner, Object currentValue, org.hibernate.generator.EventType eventType)
      Specified by:
      generate in interface org.hibernate.generator.BeforeExecutionGenerator
    • generatedOnExecution

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

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

      public EnumSet<org.hibernate.generator.EventType> getEventTypes()
      Specified by:
      getEventTypes in interface org.hibernate.generator.Generator