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 Summary
Modifier and TypeMethodDescriptionorg.hibernate.query.named.NamedObjectRepository
buildNamedQueryRepository
(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) org.hibernate.SessionFactory
org.hibernate.boot.internal.SessionFactoryOptionsBuilder
Collection<org.hibernate.mapping.Table>
org.hibernate.boot.spi.BootstrapContext
org.hibernate.mapping.Collection
getCollectionBinding
(String role) Collection<org.hibernate.mapping.Collection>
List<org.hibernate.mapping.Component>
org.hibernate.boot.model.relational.Database
org.hibernate.mapping.PersistentClass
getEntityBinding
(String entityName) Collection<org.hibernate.mapping.PersistentClass>
org.hibernate.mapping.FetchProfile
getFetchProfile
(String name) Collection<org.hibernate.mapping.FetchProfile>
org.hibernate.engine.spi.FilterDefinition
getFilterDefinition
(String name) org.hibernate.query.sqm.function.SqmFunctionRegistry
org.hibernate.mapping.Component
getGenericComponent
(Class<?> componentClass) org.hibernate.boot.model.IdentifierGeneratorDefinition
getIdentifierGenerator
(String name) getIdentifierPropertyName
(String className) org.hibernate.type.Type
getIdentifierType
(String className) Set<org.hibernate.mapping.MappedSuperclass>
org.hibernate.boot.spi.MetadataBuildingOptions
org.hibernate.boot.model.NamedEntityGraphDefinition
getNamedEntityGraph
(String name) org.hibernate.boot.query.NamedHqlQueryDefinition
org.hibernate.boot.query.NamedNativeQueryDefinition
org.hibernate.boot.query.NamedProcedureCallDefinition
org.hibernate.type.Type
getReferencedPropertyType
(String className, String propertyName) org.hibernate.boot.query.NamedResultSetMappingDescriptor
getResultSetMapping
(String name) org.hibernate.boot.SessionFactoryBuilder
org.hibernate.type.spi.TypeConfiguration
org.hibernate.boot.model.TypeDefinition
getTypeDefinition
(String typeName) getUUID()
void
initSessionFactory
(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor) void
orderColumns
(boolean forceOrdering) void
validate()
static PrevalidatedQuarkusMetadata
validateAndWrap
(org.hibernate.boot.internal.MetadataImpl original) void
visitNamedHqlQueryDefinitions
(Consumer<org.hibernate.boot.query.NamedHqlQueryDefinition> definitionConsumer) void
visitNamedNativeQueryDefinitions
(Consumer<org.hibernate.boot.query.NamedNativeQueryDefinition> definitionConsumer) void
visitNamedProcedureCallDefinition
(Consumer<org.hibernate.boot.query.NamedProcedureCallDefinition> definitionConsumer) void
visitNamedResultSetMappingDefinition
(Consumer<org.hibernate.boot.query.NamedResultSetMappingDescriptor> definitionConsumer) void
visitRegisteredComponents
(Consumer<org.hibernate.mapping.Component> consumer)
-
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 interfaceorg.hibernate.boot.Metadata
-
buildSessionFactory
public org.hibernate.SessionFactory buildSessionFactory()- Specified by:
buildSessionFactory
in interfaceorg.hibernate.boot.Metadata
-
validate
public void validate() throws org.hibernate.MappingException- Specified by:
validate
in interfaceorg.hibernate.boot.spi.MetadataImplementor
- Throws:
org.hibernate.MappingException
-
getUUID
- Specified by:
getUUID
in interfaceorg.hibernate.boot.Metadata
-
getDatabase
public org.hibernate.boot.model.relational.Database getDatabase()- Specified by:
getDatabase
in interfaceorg.hibernate.boot.Metadata
-
getEntityBindings
- Specified by:
getEntityBindings
in interfaceorg.hibernate.boot.Metadata
-
getEntityBinding
- Specified by:
getEntityBinding
in interfaceorg.hibernate.boot.Metadata
-
getCollectionBindings
- Specified by:
getCollectionBindings
in interfaceorg.hibernate.boot.Metadata
-
getCollectionBinding
- Specified by:
getCollectionBinding
in interfaceorg.hibernate.boot.Metadata
-
getImports
- Specified by:
getImports
in interfaceorg.hibernate.boot.Metadata
-
getNamedHqlQueryMapping
- Specified by:
getNamedHqlQueryMapping
in interfaceorg.hibernate.boot.Metadata
-
visitNamedHqlQueryDefinitions
public void visitNamedHqlQueryDefinitions(Consumer<org.hibernate.boot.query.NamedHqlQueryDefinition> definitionConsumer) - Specified by:
visitNamedHqlQueryDefinitions
in interfaceorg.hibernate.boot.Metadata
-
getNamedNativeQueryMapping
- Specified by:
getNamedNativeQueryMapping
in interfaceorg.hibernate.boot.Metadata
-
visitNamedNativeQueryDefinitions
public void visitNamedNativeQueryDefinitions(Consumer<org.hibernate.boot.query.NamedNativeQueryDefinition> definitionConsumer) - Specified by:
visitNamedNativeQueryDefinitions
in interfaceorg.hibernate.boot.Metadata
-
getNamedProcedureCallMapping
public org.hibernate.boot.query.NamedProcedureCallDefinition getNamedProcedureCallMapping(String name) - Specified by:
getNamedProcedureCallMapping
in interfaceorg.hibernate.boot.Metadata
-
visitNamedProcedureCallDefinition
public void visitNamedProcedureCallDefinition(Consumer<org.hibernate.boot.query.NamedProcedureCallDefinition> definitionConsumer) - Specified by:
visitNamedProcedureCallDefinition
in interfaceorg.hibernate.boot.Metadata
-
getResultSetMapping
- Specified by:
getResultSetMapping
in interfaceorg.hibernate.boot.Metadata
-
visitNamedResultSetMappingDefinition
public void visitNamedResultSetMappingDefinition(Consumer<org.hibernate.boot.query.NamedResultSetMappingDescriptor> definitionConsumer) - Specified by:
visitNamedResultSetMappingDefinition
in interfaceorg.hibernate.boot.Metadata
-
getTypeDefinition
- Specified by:
getTypeDefinition
in interfaceorg.hibernate.boot.Metadata
-
getFilterDefinitions
- Specified by:
getFilterDefinitions
in interfaceorg.hibernate.boot.Metadata
-
getFilterDefinition
- Specified by:
getFilterDefinition
in interfaceorg.hibernate.boot.Metadata
-
getFetchProfile
- Specified by:
getFetchProfile
in interfaceorg.hibernate.boot.Metadata
-
getFetchProfiles
- Specified by:
getFetchProfiles
in interfaceorg.hibernate.boot.Metadata
-
getNamedEntityGraph
- Specified by:
getNamedEntityGraph
in interfaceorg.hibernate.boot.Metadata
-
getNamedEntityGraphs
- Specified by:
getNamedEntityGraphs
in interfaceorg.hibernate.boot.Metadata
-
getIdentifierGenerator
- Specified by:
getIdentifierGenerator
in interfaceorg.hibernate.boot.Metadata
-
collectTableMappings
- Specified by:
collectTableMappings
in interfaceorg.hibernate.boot.Metadata
-
getSqlFunctionMap
- Specified by:
getSqlFunctionMap
in interfaceorg.hibernate.boot.Metadata
-
getContributors
- Specified by:
getContributors
in interfaceorg.hibernate.boot.Metadata
-
getIdentifierType
public org.hibernate.type.Type getIdentifierType(String className) throws org.hibernate.MappingException - Specified by:
getIdentifierType
in interfaceorg.hibernate.engine.spi.Mapping
- Throws:
org.hibernate.MappingException
-
getIdentifierPropertyName
- Specified by:
getIdentifierPropertyName
in interfaceorg.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 interfaceorg.hibernate.engine.spi.Mapping
- Throws:
org.hibernate.MappingException
-
getMetadataBuildingOptions
public org.hibernate.boot.spi.MetadataBuildingOptions getMetadataBuildingOptions()- Specified by:
getMetadataBuildingOptions
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getTypeConfiguration
public org.hibernate.type.spi.TypeConfiguration getTypeConfiguration()- Specified by:
getTypeConfiguration
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getFunctionRegistry
public org.hibernate.query.sqm.function.SqmFunctionRegistry getFunctionRegistry()- Specified by:
getFunctionRegistry
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
buildNamedQueryRepository
public org.hibernate.query.named.NamedObjectRepository buildNamedQueryRepository(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory) - Specified by:
buildNamedQueryRepository
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
orderColumns
public void orderColumns(boolean forceOrdering) - Specified by:
orderColumns
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getMappedSuperclassMappingsCopy
- Specified by:
getMappedSuperclassMappingsCopy
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
initSessionFactory
public void initSessionFactory(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor) - Specified by:
initSessionFactory
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
visitRegisteredComponents
- Specified by:
visitRegisteredComponents
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getGenericComponent
- Specified by:
getGenericComponent
in interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getEntityBindingMap
-
getCollectionBindingMap
-
getTypeDefinitionMap
-
getFetchProfileMap
-
getMappedSuperclassMap
-
getIdGeneratorDefinitionMap
-
getNamedEntityGraphMap
-
getBootstrapContext
public org.hibernate.boot.spi.BootstrapContext getBootstrapContext() -
getNamedQueryMap
-
getNamedNativeQueryMap
-
getNamedProcedureCallMap
-
getSqlResultSetMappingMap
-
getComposites
-