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

public Class MappingMetamodelImpl

extends QueryParameterBindingTypeResolverImpl
implements MappingMetamodelImplementor, MetamodelImplementor, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.metamodel.spi.MetamodelImplementor, org.hibernate.Metamodel, org.hibernate.metamodel.model.domain.JpaMetamodel, jakarta.persistence.metamodel.Metamodel, org.hibernate.metamodel.MappingMetamodel, org.hibernate.metamodel.spi.MappingMetamodelImplementor, org.hibernate.query.spi.QueryParameterBindingTypeResolver
Imports
java.io.Serializable, java.util.ArrayList, .Arrays, .HashSet, .List, .Locale, .Map, .Set, java.util.concurrent.ConcurrentHashMap, java.util.function.Consumer, .Function, java.util.stream.Stream, org.hibernate.EntityNameResolver, .HibernateException, .MappingException, .UnknownEntityTypeException, org.hibernate.boot.registry.classloading.spi.ClassLoaderService, .ClassLoadingException, org.hibernate.boot.spi.MetadataImplementor, org.hibernate.cache.spi.CacheImplementor, org.hibernate.cache.spi.access.CollectionDataAccess, .EntityDataAccess, .NaturalIdDataAccess, org.hibernate.graph.RootGraph, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.internal.EntityManagerMessageLogger, .HEMLogging, .QueryParameterBindingTypeResolverImpl, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.mapping.Collection, .Component, .MappedSuperclass, .PersistentClass, org.hibernate.metamodel.MappingMetamodel, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart, .EntityMappingType, .MappingModelExpressible, org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess, org.hibernate.metamodel.model.domain.BasicDomainType, .EmbeddableDomainType, .EntityDomainType, .ManagedDomainType, .NavigableRole, .TupleType, org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor, org.hibernate.metamodel.spi.EntityRepresentationStrategy, .MappingMetamodelImplementor, .MetamodelImplementor, .RuntimeModelCreationContext, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, .Queryable, org.hibernate.persister.spi.PersisterFactory, org.hibernate.query.BindableType, org.hibernate.query.derived.AnonymousTupleSqmPathSource, org.hibernate.query.sqm.SqmExpressible, org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.sqm.tree.expression.SqmFieldLiteral, org.hibernate.service.ServiceRegistry, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.tree.from.TableGroup, org.hibernate.type.BasicType, .ComponentType, .Type, org.hibernate.type.descriptor.java.JavaType, org.hibernate.type.descriptor.java.spi.JavaTypeRegistry, org.hibernate.type.descriptor.jdbc.JdbcType, org.hibernate.type.spi.TypeConfiguration, jakarta.persistence.metamodel.EmbeddableType, .EntityType, .ManagedType

Deprecated

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

Implementation of the JPA-defined contract jakarta.persistence.metamodel.Metamodel.

Really more of the mapping model than the domain model, though it does have reference to the org.hibernate.metamodel.model.domain.JpaMetamodel.

Authors
Steve Ebersole, Emmanuel Bernard, Andrea Boriero

Field Summary

Modifier and TypeField and Description
private final Map<String, CollectionPersister>
private final Map<String, Set<String>>
private final Map<NavigableRole, EmbeddableValuedModelPart>
private static final String[]
private final Set<EntityNameResolver>
private final EntityPersisterConcurrentMap
private final Map<Class<?>, String>
private final Map<String, String[]>
implementorsCache

That's not strictly correct in the JPA standard since for a given Java type we could have multiple instances of an embeddable type.

private final JpaMetamodelImplementor
private static final EntityManagerMessageLogger
private final Map<TupleType<?>, MappingModelExpressible<?>>

Constructor Summary

AccessConstructor and Description
public
MappingMetamodelImpl(TypeConfiguration typeConfiguration, ServiceRegistry serviceRegistry)

Method Summary

Modifier and TypeMethod and Description
public <T> void
public void
public CollectionPersister
collectionPersister(String
The role of the collection for which to retrieve the persister.
role
)

Overrides default org.hibernate.metamodel.spi.MetamodelImplementor.collectionPersister.

Get the persister object for a collection role.
public Map<String, CollectionPersister>
collectionPersisters()

Implements org.hibernate.metamodel.spi.MetamodelImplementor.collectionPersisters.

Get all collection persisters as a Map, which collection role as the key and the persister is the value.
public RootGraph<?>
public RootGraph<?>
public RootGraph<?>
public RootGraph<?>
private String[]
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(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 <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 EntityPersister
entityPersister(Class<?>
The entity class
entityClass
)

Overrides default org.hibernate.metamodel.spi.MetamodelImplementor.entityPersister.

Locate the persister for an entity by the entity class.
public EntityPersister
entityPersister(String
The name of the entity for which to retrieve the persister.
entityName
)

Overrides default org.hibernate.metamodel.spi.MetamodelImplementor.entityPersister.

Locate the persister for an entity by the entity-name
public Map<String, EntityPersister>
entityPersisters()

Implements org.hibernate.metamodel.spi.MetamodelImplementor.entityPersisters.

Get all entity persisters as a Map, which entity name its the key and the persister is the value.
public CollectionPersister
findCollectionDescriptor(NavigableRole role)

Implements org.hibernate.metamodel.MappingMetamodel.findCollectionDescriptor.

Find a collection mapping descriptor based on its role.
public CollectionPersister
findCollectionDescriptor(String role)

Implements org.hibernate.metamodel.MappingMetamodel.findCollectionDescriptor.

Find a collection mapping descriptor based on its role.
public EntityPersister
findEntityDescriptor(String entityName)

Implements org.hibernate.metamodel.MappingMetamodel.findEntityDescriptor.

Find an entity mapping descriptor based on its Hibernate entity-name.
public EntityPersister
findEntityDescriptor(Class<?> entityJavaType)

Implements org.hibernate.metamodel.MappingMetamodel.findEntityDescriptor.

Find an entity mapping descriptor based on its Class.
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 RootGraph<?>
public List<RootGraph<?>>
public List<RootGraph<?>>
public List<RootGraph<?>>
public void
finishInitialization(RuntimeModelCreationContext context)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.
public void
forEachCollectionDescriptor(Consumer<CollectionPersister> action)

Implements org.hibernate.metamodel.MappingMetamodel.forEachCollectionDescriptor.

Visit the mapping descriptors for all collections defined in the model
public void
forEachEntityDescriptor(Consumer<EntityPersister> action)

Implements org.hibernate.metamodel.MappingMetamodel.forEachEntityDescriptor.

Visit all entity mapping descriptors defined in the model
public void
public String[]
getAllCollectionRoles()

Implements org.hibernate.metamodel.spi.MetamodelImplementor.getAllCollectionRoles.

Get the names of all collections known to this Metamodel
public String[]
getAllEntityNames()

Implements org.hibernate.metamodel.spi.MetamodelImplementor.getAllEntityNames.

Get the names of all entities known to this Metamodel
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 CollectionPersister
getCollectionDescriptor(String role)

Implements org.hibernate.metamodel.MappingMetamodel.getCollectionDescriptor.

Get a collection mapping descriptor based on its role
public CollectionPersister
getCollectionDescriptor(NavigableRole role)

Implements org.hibernate.metamodel.MappingMetamodel.getCollectionDescriptor.

Get a collection mapping descriptor based on its role
public Set<String>
getCollectionRolesByEntityParticipant(String
The entity name for which to get the collection roles.
entityName
)

Implements org.hibernate.metamodel.spi.MappingMetamodelImplementor.getCollectionRolesByEntityParticipant, org.hibernate.metamodel.spi.MetamodelImplementor.getCollectionRolesByEntityParticipant.

Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.
public Set<EmbeddableType<?>>
getEmbeddables()

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

Return the metamodel embeddable types.
public EmbeddableValuedModelPart
getEmbeddableValuedModelPart(NavigableRole role)

Implements org.hibernate.metamodel.MappingMetamodel.getEmbeddableValuedModelPart.

Get an EmbeddableMappingType based on its NavigableRole.
public Set<EntityType<?>>
getEntities()

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

Return the metamodel entity types.
public EntityPersister
getEntityDescriptor(String entityName)

Implements org.hibernate.metamodel.MappingMetamodel.getEntityDescriptor.

Get an entity mapping descriptor based on its Hibernate entity-name
public EntityPersister
getEntityDescriptor(NavigableRole name)

Implements org.hibernate.metamodel.MappingMetamodel.getEntityDescriptor.

Get an entity mapping descriptor based on its NavigableRole.
public EntityPersister
getEntityDescriptor(Class<?> entityJavaType)

Implements org.hibernate.metamodel.MappingMetamodel.getEntityDescriptor.

Get an entity mapping descriptor based on its Class.
public Collection<EntityNameResolver>
getEntityNameResolvers()

Implements org.hibernate.metamodel.spi.MappingMetamodelImplementor.getEntityNameResolvers, org.hibernate.metamodel.spi.MetamodelImplementor.getEntityNameResolvers.

Access to the EntityNameResolver instance that Hibernate is configured to use for determining the entity descriptor from an instance of an entity
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 String[]
getImplementors(String
The name of the entity class
className
)

Implements org.hibernate.Metamodel.getImplementors.

Given the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.
public String
public JpaCompliance
public JpaMetamodelImplementor
public Set<ManagedType<?>>
public MappingMetamodel
public ServiceRegistry
public TypeConfiguration
public boolean
public EntityPersister
locateEntityDescriptor(Class<?> byClass)

Implements org.hibernate.metamodel.MappingMetamodel.locateEntityDescriptor.

Locate an entity mapping descriptor by Class.
public EntityPersister
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.
private void
processBootCollections(Collection<Collection> collectionBindings, CacheImplementor cacheImplementor, PersisterFactory persisterFactory, RuntimeModelCreationContext modelCreationContext)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.
private void
processBootEntities(Collection<PersistentClass> entityBindings, CacheImplementor cacheImplementor, PersisterFactory persisterFactory, RuntimeModelCreationContext modelCreationContext)

Deprecated as a consequence of RuntimeModelCreationContext being deprecated.
public String
private void
registerEmbeddableMappingType(MetadataImplementor bootModel)

Deprecated as a consequence of MetadataImplementor being deprecated.
private static void
private static void
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
public MappingModelExpressible<?>
public <T> BindableType<T>
resolveQueryParameterType(Class<T> javaClass)

Implements org.hibernate.metamodel.MappingMetamodel.resolveQueryParameterType.

Given a Java type, determine the corresponding BindableType to use implicitly
public Stream<CollectionPersister>
public Stream<EntityPersister>
Inherited from org.hibernate.internal.QueryParameterBindingTypeResolverImpl:
resolveParameterBindTyperesolveParameterBindType