Class TsidValueGenerator

java.lang.Object
io.hypersistence.utils.hibernate.id.TsidValueGenerator
All Implemented Interfaces:
Serializable, org.hibernate.generator.AnnotationBasedGenerator, org.hibernate.generator.BeforeExecutionGenerator, org.hibernate.generator.Generator

public class TsidValueGenerator extends Object implements org.hibernate.generator.AnnotationBasedGenerator, org.hibernate.generator.BeforeExecutionGenerator
Hibernate ValueGenerator for generating TSID values on non-ID entity fields.

Supports automatic TSID generation for regular columns annotated with Tsid, unlike TsidGenerator which is for entity IDs only.

Author:
Donghun Kim
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    generate(org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o, Object o1, org.hibernate.generator.EventType eventType)
     
    EnumSet<org.hibernate.generator.EventType>
     
    void
    initialize(Annotation annotation, Member member, org.hibernate.generator.GeneratorCreationContext generatorCreationContext)
     

    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.generator.Generator

    allowAssignedIdentifiers, generatedOnExecution, generatesOnInsert, generatesOnUpdate, generatesSometimes
  • Constructor Details

    • TsidValueGenerator

      public TsidValueGenerator()
  • Method Details

    • initialize

      public void initialize(Annotation annotation, Member member, org.hibernate.generator.GeneratorCreationContext generatorCreationContext)
      Specified by:
      initialize in interface org.hibernate.generator.AnnotationBasedGenerator
    • generate

      public Object generate(org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o, Object o1, org.hibernate.generator.EventType eventType)
      Specified by:
      generate in interface org.hibernate.generator.BeforeExecutionGenerator
    • getEventTypes

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