Class PrevalidatedQuarkusMetadata

java.lang.Object
io.quarkus.hibernate.orm.runtime.recording.PrevalidatedQuarkusMetadata
All Implemented Interfaces:
org.hibernate.boot.Metadata, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.engine.spi.Mapping

public final class PrevalidatedQuarkusMetadata extends Object implements org.hibernate.boot.spi.MetadataImplementor
This is a Quarkus custom implementation of Metadata wrapping the original implementation from Hibernate ORM. The goal is to run the MetadataImpl.validate() method earlier than when it is normally performed, for two main reasons: further reduce the work that is still necessary when performing a runtime boot, and to be able to still use reflection as it's necessary e.g. to validate enum fields. We also make sure that methods getSessionFactoryBuilder() and buildSessionFactory() are unavailable, as these would normally trigger an additional validation phase: we can actually boot Quarkus in a simpler way.
  • Method Details

    • validateAndWrap

      public static PrevalidatedQuarkusMetadata validateAndWrap(org.hibernate.boot.internal.MetadataImpl original)
    • buildSessionFactoryOptionsBuilder

      public org.hibernate.boot.internal.SessionFactoryOptionsBuilder buildSessionFactoryOptionsBuilder()
    • getSessionFactoryBuilder

      public org.hibernate.boot.SessionFactoryBuilder getSessionFactoryBuilder()
      Specified by:
      getSessionFactoryBuilder in interface org.hibernate.boot.Metadata
    • buildSessionFactory

      public org.hibernate.SessionFactory buildSessionFactory()
      Specified by:
      buildSessionFactory in interface org.hibernate.boot.Metadata
    • validate

      public void validate() throws org.hibernate.MappingException
      Specified by:
      validate in interface org.hibernate.boot.spi.MetadataImplementor
      Throws:
      org.hibernate.MappingException
    • getUUID

      public UUID getUUID()
      Specified by:
      getUUID in interface org.hibernate.boot.Metadata
    • getDatabase

      public org.hibernate.boot.model.relational.Database getDatabase()
      Specified by:
      getDatabase in interface org.hibernate.boot.Metadata
    • getEntityBindings

      public Collection<org.hibernate.mapping.PersistentClass> getEntityBindings()
      Specified by:
      getEntityBindings in interface org.hibernate.boot.Metadata
    • getEntityBinding

      public org.hibernate.mapping.PersistentClass getEntityBinding(String entityName)
      Specified by:
      getEntityBinding in interface org.hibernate.boot.Metadata
    • getCollectionBindings

      public Collection<org.hibernate.mapping.Collection> getCollectionBindings()
      Specified by:
      getCollectionBindings in interface org.hibernate.boot.Metadata
    • getCollectionBinding

      public org.hibernate.mapping.Collection getCollectionBinding(String role)
      Specified by:
      getCollectionBinding in interface org.hibernate.boot.Metadata
    • getImports

      public Map<String,String> getImports()
      Specified by:
      getImports in interface org.hibernate.boot.Metadata
    • getNamedHqlQueryMapping

      public org.hibernate.boot.query.NamedHqlQueryDefinition getNamedHqlQueryMapping(String name)
      Specified by:
      getNamedHqlQueryMapping in interface org.hibernate.boot.Metadata
    • visitNamedHqlQueryDefinitions

      public void visitNamedHqlQueryDefinitions(Consumer<org.hibernate.boot.query.NamedHqlQueryDefinition> definitionConsumer)
      Specified by:
      visitNamedHqlQueryDefinitions in interface org.hibernate.boot.Metadata
    • getNamedNativeQueryMapping

      public org.hibernate.boot.query.NamedNativeQueryDefinition getNamedNativeQueryMapping(String name)
      Specified by:
      getNamedNativeQueryMapping in interface org.hibernate.boot.Metadata
    • visitNamedNativeQueryDefinitions

      public void visitNamedNativeQueryDefinitions(Consumer<org.hibernate.boot.query.NamedNativeQueryDefinition> definitionConsumer)
      Specified by:
      visitNamedNativeQueryDefinitions in interface org.hibernate.boot.Metadata
    • getNamedProcedureCallMapping

      public org.hibernate.boot.query.NamedProcedureCallDefinition getNamedProcedureCallMapping(String name)
      Specified by:
      getNamedProcedureCallMapping in interface org.hibernate.boot.Metadata
    • visitNamedProcedureCallDefinition

      public void visitNamedProcedureCallDefinition(Consumer<org.hibernate.boot.query.NamedProcedureCallDefinition> definitionConsumer)
      Specified by:
      visitNamedProcedureCallDefinition in interface org.hibernate.boot.Metadata
    • getResultSetMapping

      public org.hibernate.boot.query.NamedResultSetMappingDescriptor getResultSetMapping(String name)
      Specified by:
      getResultSetMapping in interface org.hibernate.boot.Metadata
    • visitNamedResultSetMappingDefinition

      public void visitNamedResultSetMappingDefinition(Consumer<org.hibernate.boot.query.NamedResultSetMappingDescriptor> definitionConsumer)
      Specified by:
      visitNamedResultSetMappingDefinition in interface org.hibernate.boot.Metadata
    • getTypeDefinition

      public org.hibernate.boot.model.TypeDefinition getTypeDefinition(String typeName)
      Specified by:
      getTypeDefinition in interface org.hibernate.boot.Metadata
    • getFilterDefinitions

      public Map<String,org.hibernate.engine.spi.FilterDefinition> getFilterDefinitions()
      Specified by:
      getFilterDefinitions in interface org.hibernate.boot.Metadata
    • getFilterDefinition

      public org.hibernate.engine.spi.FilterDefinition getFilterDefinition(String name)
      Specified by:
      getFilterDefinition in interface org.hibernate.boot.Metadata
    • getFetchProfile

      public org.hibernate.mapping.FetchProfile getFetchProfile(String name)
      Specified by:
      getFetchProfile in interface org.hibernate.boot.Metadata
    • getFetchProfiles

      public Collection<org.hibernate.mapping.FetchProfile> getFetchProfiles()
      Specified by:
      getFetchProfiles in interface org.hibernate.boot.Metadata
    • getNamedEntityGraph

      public org.hibernate.boot.model.NamedEntityGraphDefinition getNamedEntityGraph(String name)
      Specified by:
      getNamedEntityGraph in interface org.hibernate.boot.Metadata
    • getNamedEntityGraphs

      public Map<String,org.hibernate.boot.model.NamedEntityGraphDefinition> getNamedEntityGraphs()
      Specified by:
      getNamedEntityGraphs in interface org.hibernate.boot.Metadata
    • getIdentifierGenerator

      public org.hibernate.boot.model.IdentifierGeneratorDefinition getIdentifierGenerator(String name)
      Specified by:
      getIdentifierGenerator in interface org.hibernate.boot.Metadata
    • collectTableMappings

      public Collection<org.hibernate.mapping.Table> collectTableMappings()
      Specified by:
      collectTableMappings in interface org.hibernate.boot.Metadata
    • getSqlFunctionMap

      public Map<String,org.hibernate.query.sqm.function.SqmFunctionDescriptor> getSqlFunctionMap()
      Specified by:
      getSqlFunctionMap in interface org.hibernate.boot.Metadata
    • getContributors

      public Set<String> getContributors()
      Specified by:
      getContributors in interface org.hibernate.boot.Metadata
    • getIdentifierType

      public org.hibernate.type.Type getIdentifierType(String className) throws org.hibernate.MappingException
      Specified by:
      getIdentifierType in interface org.hibernate.engine.spi.Mapping
      Throws:
      org.hibernate.MappingException
    • getIdentifierPropertyName

      public String getIdentifierPropertyName(String className) throws org.hibernate.MappingException
      Specified by:
      getIdentifierPropertyName in interface org.hibernate.engine.spi.Mapping
      Throws:
      org.hibernate.MappingException
    • getReferencedPropertyType

      public org.hibernate.type.Type getReferencedPropertyType(String className, String propertyName) throws org.hibernate.MappingException
      Specified by:
      getReferencedPropertyType in interface org.hibernate.engine.spi.Mapping
      Throws:
      org.hibernate.MappingException
    • getMetadataBuildingOptions

      public org.hibernate.boot.spi.MetadataBuildingOptions getMetadataBuildingOptions()
      Specified by:
      getMetadataBuildingOptions in interface org.hibernate.boot.spi.MetadataImplementor
    • getTypeConfiguration

      public org.hibernate.type.spi.TypeConfiguration getTypeConfiguration()
      Specified by:
      getTypeConfiguration in interface org.hibernate.boot.spi.MetadataImplementor
    • getFunctionRegistry

      public org.hibernate.query.sqm.function.SqmFunctionRegistry getFunctionRegistry()
      Specified by:
      getFunctionRegistry in interface org.hibernate.boot.spi.MetadataImplementor
    • buildNamedQueryRepository

      public org.hibernate.query.named.NamedObjectRepository buildNamedQueryRepository(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory)
      Specified by:
      buildNamedQueryRepository in interface org.hibernate.boot.spi.MetadataImplementor
    • orderColumns

      public void orderColumns(boolean forceOrdering)
      Specified by:
      orderColumns in interface org.hibernate.boot.spi.MetadataImplementor
    • getMappedSuperclassMappingsCopy

      public Set<org.hibernate.mapping.MappedSuperclass> getMappedSuperclassMappingsCopy()
      Specified by:
      getMappedSuperclassMappingsCopy in interface org.hibernate.boot.spi.MetadataImplementor
    • initSessionFactory

      public void initSessionFactory(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor)
      Specified by:
      initSessionFactory in interface org.hibernate.boot.spi.MetadataImplementor
    • visitRegisteredComponents

      public void visitRegisteredComponents(Consumer<org.hibernate.mapping.Component> consumer)
      Specified by:
      visitRegisteredComponents in interface org.hibernate.boot.spi.MetadataImplementor
    • getGenericComponent

      public org.hibernate.mapping.Component getGenericComponent(Class<?> componentClass)
      Specified by:
      getGenericComponent in interface org.hibernate.boot.spi.MetadataImplementor
    • getEntityBindingMap

      public Map<String,org.hibernate.mapping.PersistentClass> getEntityBindingMap()
    • getCollectionBindingMap

      public Map<String,org.hibernate.mapping.Collection> getCollectionBindingMap()
    • getTypeDefinitionMap

      public Map<String,org.hibernate.boot.model.TypeDefinition> getTypeDefinitionMap()
    • getFetchProfileMap

      public Map<String,org.hibernate.mapping.FetchProfile> getFetchProfileMap()
    • getMappedSuperclassMap

      public Map<Class<?>,org.hibernate.mapping.MappedSuperclass> getMappedSuperclassMap()
    • getIdGeneratorDefinitionMap

      public Map<String,org.hibernate.boot.model.IdentifierGeneratorDefinition> getIdGeneratorDefinitionMap()
    • getNamedEntityGraphMap

      public Map<String,org.hibernate.boot.model.NamedEntityGraphDefinition> getNamedEntityGraphMap()
    • getBootstrapContext

      public org.hibernate.boot.spi.BootstrapContext getBootstrapContext()
    • getNamedQueryMap

      public Map<String,org.hibernate.boot.query.NamedHqlQueryDefinition> getNamedQueryMap()
    • getNamedNativeQueryMap

      public Map<String,org.hibernate.boot.query.NamedNativeQueryDefinition> getNamedNativeQueryMap()
    • getNamedProcedureCallMap

      public Map<String,org.hibernate.boot.query.NamedProcedureCallDefinition> getNamedProcedureCallMap()
    • getSqlResultSetMappingMap

      public Map<String,org.hibernate.boot.query.NamedResultSetMappingDescriptor> getSqlResultSetMappingMap()
    • getComposites

      public List<org.hibernate.mapping.Component> getComposites()