Top Inners Fields Constructors Methods
org.hibernate.metamodel.model.domain.internal

public Class JpaMetamodelImpl

extends Object
implements JpaMetamodelImplementor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor, org.hibernate.metamodel.model.domain.JpaMetamodel, jakarta.persistence.metamodel.Metamodel
Imports
java.io.ObjectStreamException, .Serializable, java.util.ArrayList, .Collection, .HashMap, .HashSet, .List, .Map, .Set, .TreeMap, java.util.concurrent.ConcurrentHashMap, org.hibernate.boot.model.NamedEntityGraphDefinition, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, .ClassLoadingException, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.graph.internal.RootGraphImpl, org.hibernate.graph.spi.AttributeNodeImplementor, .GraphImplementor, .RootGraphImplementor, .SubGraphImplementor, org.hibernate.internal.EntityManagerMessageLogger, .HEMLogging, org.hibernate.internal.util.StringHelper, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.mapping.MappedSuperclass, .PersistentClass, org.hibernate.metamodel.MappingMetamodel, org.hibernate.metamodel.internal.JpaMetaModelPopulationSetting, .JpaStaticMetaModelPopulationSetting, .MetadataContext, org.hibernate.metamodel.mapping.EntityMappingType, org.hibernate.metamodel.model.domain.EmbeddableDomainType, .EntityDomainType, .IdentifiableDomainType, .JpaMetamodel, .ManagedDomainType, .MappedSuperclassDomainType, org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor, org.hibernate.metamodel.spi.RuntimeModelCreationContext, org.hibernate.query.sqm.EntityTypeException, org.hibernate.query.sqm.tree.domain.SqmPolymorphicRootDescriptor, org.hibernate.service.ServiceRegistry, org.hibernate.type.descriptor.java.EnumJavaType, .JavaType, org.hibernate.type.descriptor.java.spi.DynamicModelJavaType, .EntityJavaType, org.hibernate.type.spi.TypeConfiguration, jakarta.persistence.EntityGraph, .NamedAttributeNode, .NamedEntityGraph, .NamedSubgraph, jakarta.persistence.metamodel.Attribute, .EmbeddableType, .EntityType, .ManagedType, .Type

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, Map<Class<?>, Enum<?>>>
private final transient Map<String, RootGraphImplementor<?>>
private final Map<Class<?>, String>
private final Set<EmbeddableDomainType<?>>
private final Map<String, EntityDomainType<?>>
private final Map<Class<?>, ManagedDomainType<?>>
private final Set<ManagedDomainType<?>>
private final Map<String, Object>
private static final EntityManagerMessageLogger
private final MappingMetamodel
private final Map<String, JpaMetamodelImpl.ImportInfo<?>>
private final Map<Class<?>, SqmPolymorphicRootDescriptor<?>>
private final ServiceRegistry
private final TypeConfiguration

Constructor Summary

AccessConstructor and Description
public
JpaMetamodelImpl(TypeConfiguration typeConfiguration, MappingMetamodel mappingMetamodel, ServiceRegistry serviceRegistry)

Method Summary

Modifier and TypeMethod and Description
public <T> void
private void
applyNamedAttributeNodes(NamedAttributeNode[] namedAttributeNodes, NamedEntityGraph namedEntityGraph, GraphImplementor<?> graphNode)

private void
private void
applyNamedSubgraphs(NamedEntityGraph namedEntityGraph, String subgraphName, SubGraphImplementor<?> subgraph)

private EntityTypeImpl<?>
buildEntityType(PersistentClass persistentClass, MetadataContext context, TypeConfiguration typeConfiguration)

private MappedSuperclassTypeImpl<?>
buildMappedSuperclassType(MappedSuperclass mappedSuperclass, MetadataContext context, TypeConfiguration typeConfiguration)

public <X> EmbeddableDomainType<X>
embeddable(Class<X>
the type of the represented embeddable class
cls
)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.embeddable.

Return the metamodel embeddable type representing the embeddable class.
public <X> EntityDomainType<X>
entity(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.entity.

Access to an entity supporting Hibernate's entity-name feature
public <X> EntityDomainType<X>
entity(Class<X>
the type of the represented entity
cls
)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.entity.

Return the metamodel entity type representing the entity.
public <T> RootGraphImplementor<T>
public <T> List<RootGraphImplementor<? super T>>
public <X> EntityDomainType<X>
findEntityType(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findEntityType.

Same as entity except null is returned rather than throwing an exception
public <X> ManagedDomainType<X>
findManagedType(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findManagedType.

Same as managedType except null is returned rather than throwing an exception
public Map<String, Map<Class<?>, Enum<?>>>
getAllowedEnumLiteralTexts()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getAllowedEnumLiteralTexts.

Returns a map that gives access to the enum literal expressions that can be used in queries.
public Set<EmbeddableType<?>>
getEmbeddables()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getEmbeddables.

Return the metamodel embeddable types.
public Set<EntityType<?>>
getEntities()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getEntities.

Return the metamodel entity types.
public <X> EntityDomainType<X>
getHqlEntityReference(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getHqlEntityReference.

Specialized handling for resolving entity-name references in an HQL query
public JpaCompliance
public Set<ManagedType<?>>
public MappingMetamodel
public ServiceRegistry
public TypeConfiguration
getTypeConfiguration()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getTypeConfiguration.

todo (6.0) : should we expose JpaMetamodel from TypeConfiguration?
private void
private EntityDomainType<?>
locateOrBuildEntityType(PersistentClass persistentClass, MetadataContext context, TypeConfiguration typeConfiguration)

private MappedSuperclassDomainType<?>
public <X> ManagedDomainType<X>
managedType(Class<X>
the type of the represented managed class
cls
)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.managedType.

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.
public void
processJpa(MetadataImplementor bootMetamodel, MappingMetamodel mappingMetamodel, Map<Class<?>, String> entityProxyInterfaceMap, JpaStaticMetaModelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting, Collection<NamedEntityGraphDefinition> namedEntityGraphDefinitions, RuntimeModelCreationContext runtimeModelCreationContext)

Deprecated as a consequence of MetadataImplementor and RuntimeModelCreationContext being deprecated.
public String
public <T> EntityDomainType<T>
public <X> EntityDomainType<X>
resolveHqlEntityReference(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.resolveHqlEntityReference.

Specialized handling for resolving entity-name references in an HQL query
private <T> JpaMetamodelImpl.ImportInfo<T>
resolveImport(final String name)

private <X> Class<X>
private Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowedEnumLiteralTextsback to summary
private final Map<String, Map<Class<?>, Enum<?>>> allowedEnumLiteralTexts
entityGraphMapback to summary
private final transient Map<String, RootGraphImplementor<?>> entityGraphMap
entityProxyInterfaceMapback to summary
private final Map<Class<?>, String> entityProxyInterfaceMap
jpaEmbeddablesback to summary
private final Set<EmbeddableDomainType<?>> jpaEmbeddables
jpaEntityTypeMapback to summary
private final Map<String, EntityDomainType<?>> jpaEntityTypeMap
jpaManagedTypeMapback to summary
private final Map<Class<?>, ManagedDomainType<?>> jpaManagedTypeMap
jpaManagedTypesback to summary
private final Set<ManagedDomainType<?>> jpaManagedTypes
knownInvalidnameToImportMapback to summary
private final Map<String, Object> knownInvalidnameToImportMap
logback to summary
private static final EntityManagerMessageLogger log
mappingMetamodelback to summary
private final MappingMetamodel mappingMetamodel
nameToImportMapback to summary
private final Map<String, JpaMetamodelImpl.ImportInfo<?>> nameToImportMap
polymorphicEntityReferenceMapback to summary
private final Map<Class<?>, SqmPolymorphicRootDescriptor<?>> polymorphicEntityReferenceMap
serviceRegistryback to summary
private final ServiceRegistry serviceRegistry
typeConfigurationback to summary
private final TypeConfiguration typeConfiguration

Constructor Detail

JpaMetamodelImplback to summary
public JpaMetamodelImpl(TypeConfiguration typeConfiguration, MappingMetamodel mappingMetamodel, ServiceRegistry serviceRegistry)

Method Detail

addNamedEntityGraphback to summary
public <T> void addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.addNamedEntityGraph.

Annotations
@Override
applyNamedAttributeNodesback to summary
private void applyNamedAttributeNodes(NamedAttributeNode[] namedAttributeNodes, NamedEntityGraph namedEntityGraph, GraphImplementor<?> graphNode)
applyNamedEntityGraphsback to summary
private void applyNamedEntityGraphs(Collection<NamedEntityGraphDefinition> namedEntityGraphs)
Annotations
@SuppressWarnings:unchecked
applyNamedSubgraphsback to summary
private void applyNamedSubgraphs(NamedEntityGraph namedEntityGraph, String subgraphName, SubGraphImplementor<?> subgraph)
buildEntityTypeback to summary
private EntityTypeImpl<?> buildEntityType(PersistentClass persistentClass, MetadataContext context, TypeConfiguration typeConfiguration)
Annotations
@SuppressWarnings:unchecked
buildMappedSuperclassTypeback to summary
private MappedSuperclassTypeImpl<?> buildMappedSuperclassType(MappedSuperclass mappedSuperclass, MetadataContext context, TypeConfiguration typeConfiguration)
Annotations
@SuppressWarnings:unchecked
embeddableback to summary
public <X> EmbeddableDomainType<X> embeddable(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.embeddable.

Doc from jakarta.persistence.metamodel.Metamodel.embeddable.

Return the metamodel embeddable type representing the embeddable class.

Parameters
cls:Class<X>

the type of the represented embeddable class

Returns:EmbeddableDomainType<X>

the metamodel embeddable type

Annotations
@Override
entityback to summary
public <X> EntityDomainType<X> entity(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.entity.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.entity.

Access to an entity supporting Hibernate's entity-name feature

Annotations
@Override
entityback to summary
public <X> EntityDomainType<X> entity(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.entity.

Doc from jakarta.persistence.metamodel.Metamodel.entity.

Return the metamodel entity type representing the entity.

Parameters
cls:Class<X>

the type of the represented entity

Returns:EntityDomainType<X>

the metamodel entity type

Annotations
@Override
findEntityGraphByNameback to summary
public <T> RootGraphImplementor<T> findEntityGraphByName(String name)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findEntityGraphByName.

Annotations
@Override
findEntityGraphsByJavaTypeback to summary
public <T> List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> entityClass)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findEntityGraphsByJavaType.

Annotations
@Override
findEntityTypeback to summary
public <X> EntityDomainType<X> findEntityType(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findEntityType.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.findEntityType.

Same as entity except null is returned rather than throwing an exception

Annotations
@Override
findManagedTypeback to summary
public <X> ManagedDomainType<X> findManagedType(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.findManagedType.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.findManagedType.

Same as managedType except null is returned rather than throwing an exception

Annotations
@Override
getAllowedEnumLiteralTextsback to summary
public Map<String, Map<Class<?>, Enum<?>>> getAllowedEnumLiteralTexts()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getAllowedEnumLiteralTexts.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.getAllowedEnumLiteralTexts.

Returns a map that gives access to the enum literal expressions that can be used in queries. The key is the shorthand enum literal. The value is a map, from enum class to the actual enum value. This is needed for parsing shorthand enum literals that don't use FQNs.

Annotations
@Override
getEmbeddablesback to summary
public Set<EmbeddableType<?>> getEmbeddables()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getEmbeddables.

Doc from jakarta.persistence.metamodel.Metamodel.getEmbeddables.

Return the metamodel embeddable types. Returns empty set if there are no embeddable types.

Returns:Set<EmbeddableType<?>>

the metamodel embeddable types

Annotations
@Override
getEntitiesback to summary
public Set<EntityType<?>> getEntities()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getEntities.

Doc from jakarta.persistence.metamodel.Metamodel.getEntities.

Return the metamodel entity types.

Returns:Set<EntityType<?>>

the metamodel entity types

Annotations
@Override
getHqlEntityReferenceback to summary
public <X> EntityDomainType<X> getHqlEntityReference(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getHqlEntityReference.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.getHqlEntityReference.

Specialized handling for resolving entity-name references in an HQL query

Annotations
@Override
getJpaComplianceback to summary
public JpaCompliance getJpaCompliance()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getJpaCompliance.

Annotations
@Override
getManagedTypesback to summary
public Set<ManagedType<?>> getManagedTypes()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getManagedTypes.

Doc from jakarta.persistence.metamodel.Metamodel.getManagedTypes.

Return the metamodel managed types.

Returns:Set<ManagedType<?>>

the metamodel managed types

Annotations
@Override
getMappingMetamodelback to summary
public MappingMetamodel getMappingMetamodel()

Implements org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor.getMappingMetamodel.

Annotations
@Override
getServiceRegistryback to summary
public ServiceRegistry getServiceRegistry()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getServiceRegistry.

Annotations
@Override
getTypeConfigurationback to summary
public TypeConfiguration getTypeConfiguration()

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.getTypeConfiguration.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.getTypeConfiguration.

todo (6.0) : should we expose JpaMetamodel from TypeConfiguration?

Annotations
@Override
handleUnusedMappedSuperclassesback to summary
private void handleUnusedMappedSuperclasses(MetadataContext context, TypeConfiguration typeConfiguration)
locateOrBuildEntityTypeback to summary
private EntityDomainType<?> locateOrBuildEntityType(PersistentClass persistentClass, MetadataContext context, TypeConfiguration typeConfiguration)
locateOrBuildMappedSuperclassTypeback to summary
private MappedSuperclassDomainType<?> locateOrBuildMappedSuperclassType(MappedSuperclass mappedSuperclass, MetadataContext context, TypeConfiguration typeConfiguration)
managedTypeback to summary
public <X> ManagedDomainType<X> managedType(Class<X> cls)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.managedType.

Doc from jakarta.persistence.metamodel.Metamodel.managedType.

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.

Parameters
cls:Class<X>

the type of the represented managed class

Returns:ManagedDomainType<X>

the metamodel managed type

Annotations
@Override
processJpaback to summary
public void processJpa(MetadataImplementor bootMetamodel, MappingMetamodel mappingMetamodel, Map<Class<?>, String> entityProxyInterfaceMap, JpaStaticMetaModelPopulationSetting jpaStaticMetaModelPopulationSetting, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting, Collection<NamedEntityGraphDefinition> namedEntityGraphDefinitions, RuntimeModelCreationContext runtimeModelCreationContext)

Deprecated

as a consequence of MetadataImplementor and RuntimeModelCreationContext being deprecated. See corresponding docs for further information.

qualifyImportableNameback to summary
public String qualifyImportableName(String queryName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.qualifyImportableName.

Annotations
@Override
resolveEntityReferenceback to summary
public <T> EntityDomainType<T> resolveEntityReference(Class<T> javaType)
Annotations
@SuppressWarnings:unchecked
resolveHqlEntityReferenceback to summary
public <X> EntityDomainType<X> resolveHqlEntityReference(String entityName)

Implements org.hibernate.metamodel.model.domain.JpaMetamodel.resolveHqlEntityReference.

Doc from org.hibernate.metamodel.model.domain.JpaMetamodel.resolveHqlEntityReference.

Specialized handling for resolving entity-name references in an HQL query

Annotations
@Override
resolveImportback to summary
private <T> JpaMetamodelImpl.ImportInfo<T> resolveImport(final String name)
resolveRequestedClassback to summary
private <X> Class<X> resolveRequestedClass(String entityName)
writeReplaceback to summary
private Object writeReplace() throws ObjectStreamException
org.hibernate.metamodel.model.domain.internal back to summary

private Class JpaMetamodelImpl.ImportInfo<T>

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.ImportInfo

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv Class<T>

Constructor Summary

AccessConstructor and Description
pack-priv
ImportInfo(String importedName, Class<T> loadedClass)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

importedNameback to summary
pack-priv final String importedName
loadedClassback to summary
pack-priv Class<T> loadedClass

Constructor Detail

ImportInfoback to summary
pack-priv ImportInfo(String importedName, Class<T> loadedClass)
org.hibernate.metamodel.model.domain.internal back to summary

private Class JpaMetamodelImpl.SerialForm

extends Object
implements Serializable
Class Inheritance
  • java.lang.Object
  • org.hibernate.metamodel.model.domain.internal.JpaMetamodelImpl.SerialForm
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Constructor Summary

AccessConstructor and Description
public
SerialForm(SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
private Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Constructor Detail

SerialFormback to summary
public SerialForm(SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

readResolveback to summary
private Object readResolve()