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 theMetadataImpl.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 methodsgetSessionFactoryBuilder()andbuildSessionFactory()are unavailable, as these would normally trigger an additional validation phase: we can actually boot Quarkus in a simpler way.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.hibernate.query.spi.NamedQueryRepositorybuildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)org.hibernate.SessionFactorybuildSessionFactory()org.hibernate.boot.internal.SessionFactoryOptionsBuilderbuildSessionFactoryOptionsBuilder()Collection<org.hibernate.mapping.Table>collectTableMappings()org.hibernate.mapping.CollectiongetCollectionBinding(String role)Collection<org.hibernate.mapping.Collection>getCollectionBindings()org.hibernate.boot.model.relational.DatabasegetDatabase()org.hibernate.mapping.PersistentClassgetEntityBinding(String entityName)Collection<org.hibernate.mapping.PersistentClass>getEntityBindings()org.hibernate.mapping.FetchProfilegetFetchProfile(String name)Collection<org.hibernate.mapping.FetchProfile>getFetchProfiles()org.hibernate.engine.spi.FilterDefinitiongetFilterDefinition(String name)Map<String,org.hibernate.engine.spi.FilterDefinition>getFilterDefinitions()org.hibernate.boot.model.IdentifierGeneratorDefinitiongetIdentifierGenerator(String name)org.hibernate.id.factory.IdentifierGeneratorFactorygetIdentifierGeneratorFactory()Deprecated.StringgetIdentifierPropertyName(String className)org.hibernate.type.TypegetIdentifierType(String className)Map<String,String>getImports()Set<org.hibernate.mapping.MappedSuperclass>getMappedSuperclassMappingsCopy()org.hibernate.boot.spi.MetadataBuildingOptionsgetMetadataBuildingOptions()org.hibernate.cfg.annotations.NamedEntityGraphDefinitiongetNamedEntityGraph(String name)Map<String,org.hibernate.cfg.annotations.NamedEntityGraphDefinition>getNamedEntityGraphs()org.hibernate.engine.spi.NamedSQLQueryDefinitiongetNamedNativeQueryDefinition(String name)Collection<org.hibernate.engine.spi.NamedSQLQueryDefinition>getNamedNativeQueryDefinitions()Collection<org.hibernate.cfg.annotations.NamedProcedureCallDefinition>getNamedProcedureCallDefinitions()org.hibernate.engine.spi.NamedQueryDefinitiongetNamedQueryDefinition(String name)Collection<org.hibernate.engine.spi.NamedQueryDefinition>getNamedQueryDefinitions()org.hibernate.type.TypegetReferencedPropertyType(String className, String propertyName)org.hibernate.engine.ResultSetMappingDefinitiongetResultSetMapping(String name)Map<String,org.hibernate.engine.ResultSetMappingDefinition>getResultSetMappingDefinitions()org.hibernate.boot.SessionFactoryBuildergetSessionFactoryBuilder()Map<String,org.hibernate.dialect.function.SQLFunction>getSqlFunctionMap()org.hibernate.type.spi.TypeConfigurationgetTypeConfiguration()org.hibernate.boot.model.TypeDefinitiongetTypeDefinition(String typeName)org.hibernate.type.TypeResolvergetTypeResolver()UUIDgetUUID()voidinitSessionFactory(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor)voidvalidate()static PrevalidatedQuarkusMetadatavalidateAndWrap(org.hibernate.boot.internal.MetadataImpl original)
-
-
-
Method Detail
-
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:
getSessionFactoryBuilderin interfaceorg.hibernate.boot.Metadata
-
buildSessionFactory
public org.hibernate.SessionFactory buildSessionFactory()
- Specified by:
buildSessionFactoryin interfaceorg.hibernate.boot.Metadata
-
validate
public void validate() throws org.hibernate.MappingException- Specified by:
validatein interfaceorg.hibernate.boot.spi.MetadataImplementor- Throws:
org.hibernate.MappingException
-
getUUID
public UUID getUUID()
- Specified by:
getUUIDin interfaceorg.hibernate.boot.Metadata
-
getDatabase
public org.hibernate.boot.model.relational.Database getDatabase()
- Specified by:
getDatabasein interfaceorg.hibernate.boot.Metadata
-
getEntityBindings
public Collection<org.hibernate.mapping.PersistentClass> getEntityBindings()
- Specified by:
getEntityBindingsin interfaceorg.hibernate.boot.Metadata
-
getEntityBinding
public org.hibernate.mapping.PersistentClass getEntityBinding(String entityName)
- Specified by:
getEntityBindingin interfaceorg.hibernate.boot.Metadata
-
getCollectionBindings
public Collection<org.hibernate.mapping.Collection> getCollectionBindings()
- Specified by:
getCollectionBindingsin interfaceorg.hibernate.boot.Metadata
-
getCollectionBinding
public org.hibernate.mapping.Collection getCollectionBinding(String role)
- Specified by:
getCollectionBindingin interfaceorg.hibernate.boot.Metadata
-
getImports
public Map<String,String> getImports()
- Specified by:
getImportsin interfaceorg.hibernate.boot.Metadata
-
getNamedQueryDefinition
public org.hibernate.engine.spi.NamedQueryDefinition getNamedQueryDefinition(String name)
- Specified by:
getNamedQueryDefinitionin interfaceorg.hibernate.boot.Metadata
-
getNamedQueryDefinitions
public Collection<org.hibernate.engine.spi.NamedQueryDefinition> getNamedQueryDefinitions()
- Specified by:
getNamedQueryDefinitionsin interfaceorg.hibernate.boot.Metadata
-
getNamedNativeQueryDefinition
public org.hibernate.engine.spi.NamedSQLQueryDefinition getNamedNativeQueryDefinition(String name)
- Specified by:
getNamedNativeQueryDefinitionin interfaceorg.hibernate.boot.Metadata
-
getNamedNativeQueryDefinitions
public Collection<org.hibernate.engine.spi.NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
- Specified by:
getNamedNativeQueryDefinitionsin interfaceorg.hibernate.boot.Metadata
-
getNamedProcedureCallDefinitions
public Collection<org.hibernate.cfg.annotations.NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
- Specified by:
getNamedProcedureCallDefinitionsin interfaceorg.hibernate.boot.Metadata
-
getResultSetMapping
public org.hibernate.engine.ResultSetMappingDefinition getResultSetMapping(String name)
- Specified by:
getResultSetMappingin interfaceorg.hibernate.boot.Metadata
-
getResultSetMappingDefinitions
public Map<String,org.hibernate.engine.ResultSetMappingDefinition> getResultSetMappingDefinitions()
- Specified by:
getResultSetMappingDefinitionsin interfaceorg.hibernate.boot.Metadata
-
getTypeDefinition
public org.hibernate.boot.model.TypeDefinition getTypeDefinition(String typeName)
- Specified by:
getTypeDefinitionin interfaceorg.hibernate.boot.Metadata
-
getFilterDefinitions
public Map<String,org.hibernate.engine.spi.FilterDefinition> getFilterDefinitions()
- Specified by:
getFilterDefinitionsin interfaceorg.hibernate.boot.Metadata
-
getFilterDefinition
public org.hibernate.engine.spi.FilterDefinition getFilterDefinition(String name)
- Specified by:
getFilterDefinitionin interfaceorg.hibernate.boot.Metadata
-
getFetchProfile
public org.hibernate.mapping.FetchProfile getFetchProfile(String name)
- Specified by:
getFetchProfilein interfaceorg.hibernate.boot.Metadata
-
getFetchProfiles
public Collection<org.hibernate.mapping.FetchProfile> getFetchProfiles()
- Specified by:
getFetchProfilesin interfaceorg.hibernate.boot.Metadata
-
getNamedEntityGraph
public org.hibernate.cfg.annotations.NamedEntityGraphDefinition getNamedEntityGraph(String name)
- Specified by:
getNamedEntityGraphin interfaceorg.hibernate.boot.Metadata
-
getNamedEntityGraphs
public Map<String,org.hibernate.cfg.annotations.NamedEntityGraphDefinition> getNamedEntityGraphs()
- Specified by:
getNamedEntityGraphsin interfaceorg.hibernate.boot.Metadata
-
getIdentifierGenerator
public org.hibernate.boot.model.IdentifierGeneratorDefinition getIdentifierGenerator(String name)
- Specified by:
getIdentifierGeneratorin interfaceorg.hibernate.boot.Metadata
-
collectTableMappings
public Collection<org.hibernate.mapping.Table> collectTableMappings()
- Specified by:
collectTableMappingsin interfaceorg.hibernate.boot.Metadata
-
getSqlFunctionMap
public Map<String,org.hibernate.dialect.function.SQLFunction> getSqlFunctionMap()
- Specified by:
getSqlFunctionMapin interfaceorg.hibernate.boot.Metadata
-
getIdentifierGeneratorFactory
@Deprecated public org.hibernate.id.factory.IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Deprecated.- Specified by:
getIdentifierGeneratorFactoryin interfaceorg.hibernate.engine.spi.Mapping
-
getIdentifierType
public org.hibernate.type.Type getIdentifierType(String className) throws org.hibernate.MappingException
- Specified by:
getIdentifierTypein interfaceorg.hibernate.engine.spi.Mapping- Throws:
org.hibernate.MappingException
-
getIdentifierPropertyName
public String getIdentifierPropertyName(String className) throws org.hibernate.MappingException
- Specified by:
getIdentifierPropertyNamein 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:
getReferencedPropertyTypein interfaceorg.hibernate.engine.spi.Mapping- Throws:
org.hibernate.MappingException
-
getMetadataBuildingOptions
public org.hibernate.boot.spi.MetadataBuildingOptions getMetadataBuildingOptions()
- Specified by:
getMetadataBuildingOptionsin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getTypeConfiguration
public org.hibernate.type.spi.TypeConfiguration getTypeConfiguration()
- Specified by:
getTypeConfigurationin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getTypeResolver
public org.hibernate.type.TypeResolver getTypeResolver()
- Specified by:
getTypeResolverin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
buildNamedQueryRepository
public org.hibernate.query.spi.NamedQueryRepository buildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)
- Specified by:
buildNamedQueryRepositoryin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
getMappedSuperclassMappingsCopy
public Set<org.hibernate.mapping.MappedSuperclass> getMappedSuperclassMappingsCopy()
- Specified by:
getMappedSuperclassMappingsCopyin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
initSessionFactory
public void initSessionFactory(org.hibernate.engine.spi.SessionFactoryImplementor sessionFactoryImplementor)
- Specified by:
initSessionFactoryin interfaceorg.hibernate.boot.spi.MetadataImplementor
-
-