Class QuarkusMutableIdentifierGeneratorFactory

java.lang.Object
io.quarkus.hibernate.orm.runtime.service.QuarkusMutableIdentifierGeneratorFactory
All Implemented Interfaces:
Serializable, org.hibernate.id.factory.IdentifierGeneratorFactory, org.hibernate.service.Service

public final class QuarkusMutableIdentifierGeneratorFactory extends Object implements org.hibernate.id.factory.IdentifierGeneratorFactory, Serializable
Wraps the default DefaultIdentifierGeneratorFactory so to make sure we store the Class references of any IdentifierGenerator which is accessed during the build of the Metadata. This is not to register them for reflection access: all reflective instantiation is performed during the build of the Metadata and is therefore safe even in native mode; however we still need the Class instances as some runtime operations will need these, and will look them up by either fully qualified name (and then reflection) or strategy name. Since all IdentifierGenerator types used by a model are accessed during the Metadata creation, just watching for these will provide the full list of Class instances we need to keep.
See Also:
  • Constructor Details

    • QuarkusMutableIdentifierGeneratorFactory

      public QuarkusMutableIdentifierGeneratorFactory(org.hibernate.service.ServiceRegistry serviceRegistry)
  • Method Details

    • getDialect

      public org.hibernate.dialect.Dialect getDialect()
      Specified by:
      getDialect in interface org.hibernate.id.factory.IdentifierGeneratorFactory
    • createIdentifierGenerator

      public org.hibernate.generator.Generator createIdentifierGenerator(String strategy, org.hibernate.type.Type type, Properties config)
      Specified by:
      createIdentifierGenerator in interface org.hibernate.id.factory.IdentifierGeneratorFactory
    • register

      public void register(String strategy, Class generatorClass)
    • getIdentifierGeneratorClass

      public Class getIdentifierGeneratorClass(String strategy)
      Specified by:
      getIdentifierGeneratorClass in interface org.hibernate.id.factory.IdentifierGeneratorFactory
    • createIdentifierGenerator

      public org.hibernate.id.IdentifierGenerator createIdentifierGenerator(jakarta.persistence.GenerationType generationType, String generatedValueGeneratorName, String generatorName, org.hibernate.type.descriptor.java.JavaType<?> javaType, Properties config, org.hibernate.id.factory.spi.GeneratorDefinitionResolver definitionResolver)
      Specified by:
      createIdentifierGenerator in interface org.hibernate.id.factory.IdentifierGeneratorFactory