Class MappingMetamodelImpl
java.lang.Object
org.hibernate.internal.QueryParameterBindingTypeResolverImpl
org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl
- All Implemented Interfaces:
Metamodel,Serializable,Metamodel,MappingMetamodel,JpaMetamodel,MappingMetamodelImplementor,MetamodelImplementor,QueryParameterBindingTypeResolver
public class MappingMetamodelImpl
extends QueryParameterBindingTypeResolverImpl
implements MappingMetamodelImplementor, MetamodelImplementor, Serializable
Implementation of the JPA-defined contract
Metamodel.
Really more of the mapping model than the domain model, though
it does have reference to the JpaMetamodel.
- Author:
- Steve Ebersole, Emmanuel Bernard, Andrea Boriero
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMappingMetamodelImpl(TypeConfiguration typeConfiguration, ServiceRegistry serviceRegistry) -
Method Summary
Modifier and TypeMethodDescription<T> voidaddNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph) voidclose()collectionPersister(String role) Get the persister object for a collection role.Get all collection persisters as a Map, which collection role as the key and the persister is the value.RootGraph<?>defaultGraph(Class entityJavaType) RootGraph<?>defaultGraph(String entityName) RootGraph<?>defaultGraph(EntityDomainType<?> entityDomainType) RootGraph<?>defaultGraph(EntityPersister entityDescriptor) <X> EmbeddableDomainType<X>embeddable(Class<X> cls) Return the metamodel embeddable type representing the embeddable class.<X> EmbeddableDomainType<X>embeddable(String embeddableName) Access to an embeddable type from FQN<X> EntityDomainType<X>Return the metamodel entity type representing the entity.<X> EntityDomainType<X>Access to an entity supporting Hibernate's entity-name featureentityPersister(Class<?> entityClass) Locate the persister for an entity by the entity class.entityPersister(String entityName) Locate the persister for an entity by the entity-nameGet all entity persisters as a Map, which entity name its the key and the persister is the value.<E extends Enum<E>>
EenumValue(EnumJavaType<E> enumType, String enumValueName) Find a collection mapping descriptor based on its role.Find a collection mapping descriptor based on its role.findEntityDescriptor(Class<?> entityJavaType) Find an entity mapping descriptor based on its Class.findEntityDescriptor(String entityName) Find an entity mapping descriptor based on its Hibernate entity-name.<T> RootGraphImplementor<T>findEntityGraphByName(String name) <T> List<RootGraphImplementor<? super T>>findEntityGraphsByJavaType(Class<T> entityClass) <X> EntityDomainType<X>findEntityType(Class<X> cls) Same asJpaMetamodel.entity(java.lang.String)exceptnullis returned rather than throwing an exception<X> ManagedDomainType<X>findManagedType(Class<X> cls) Same asJpaMetamodel.managedType(java.lang.String)exceptnullis returned rather than throwing an exceptionRootGraph<?>findNamedGraph(String name) findRootGraphsForType(Class baseEntityJavaType) findRootGraphsForType(String baseEntityName) findRootGraphsForType(EntityPersister baseEntityDescriptor) voidvoidVisit the mapping descriptors for all collections defined in the modelvoidVisit all entity mapping descriptors defined in the modelvoidforEachNamedGraph(Consumer<RootGraph<?>> action) String[]Get the names of all collections known to this MetamodelString[]Get the names of all entities known to this MetamodelGet a collection mapping descriptor based on its roleGet a collection mapping descriptor based on its rolegetCollectionRolesByEntityParticipant(String entityName) Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.Set<EmbeddableType<?>>Return the metamodel embeddable types.Get an EmbeddableMappingType based on its NavigableRole.Set<EntityType<?>>Return the metamodel entity types.getEntityDescriptor(Class<?> entityJavaType) Get an entity mapping descriptor based on its Class.getEntityDescriptor(String entityName) Get an entity mapping descriptor based on its Hibernate entity-nameGet an entity mapping descriptor based on its NavigableRole.Access to the EntityNameResolver instance that Hibernate is configured to use for determining the entity descriptor from an instance of an entityEnumJavaType<?>getEnumType(String className) getEnumTypesForValue(String enumValue) <X> EntityDomainType<X>getHqlEntityReference(String entityName) Specialized handling for resolving entity-name references in an HQL queryString[]getImplementors(String className) Given the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.getImportedName(String name) <T> TgetJavaConstant(String className, String fieldName) JavaType<?>getJavaConstantType(String className, String fieldName) Set<ManagedType<?>>Return the metamodel managed types.TheTypeConfigurationthis metamodel is associated withbooleanisEntityClass(Class<?> entityJavaType) locateEntityDescriptor(Class<?> byClass) Locate an entity mapping descriptor by Class.locateEntityPersister(String byName) Locate the entity persister by name.<X> ManagedDomainType<X>managedType(Class<X> cls) Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.<X> ManagedDomainType<X>managedType(String typeName) Access to a managed type through its namequalifyImportableName(String queryName) <X> EntityDomainType<X>resolveHqlEntityReference(String entityName) Specialized handling for resolving entity-name references in an HQL queryresolveMappingExpressible(SqmExpressible<?> sqmExpressible, Function<NavigablePath, TableGroup> tableGroupLocator) <T> BindableType<T>resolveQueryParameterType(Class<T> javaClass) Given a Java type, determine the corresponding BindableType to use implicitlyMethods inherited from class org.hibernate.internal.QueryParameterBindingTypeResolverImpl
resolveParameterBindType, resolveParameterBindTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.MappingMetamodel
locateEntityPersisterMethods inherited from interface org.hibernate.query.spi.QueryParameterBindingTypeResolver
resolveParameterBindType, resolveParameterBindType
-
Constructor Details
-
MappingMetamodelImpl
-
-
Method Details
-
getJpaMetamodel
-
finishInitialization
-
getEntityNameResolvers
Description copied from interface:MappingMetamodelImplementorAccess to the EntityNameResolver instance that Hibernate is configured to use for determining the entity descriptor from an instance of an entity- Specified by:
getEntityNameResolversin interfaceMappingMetamodelImplementor- Specified by:
getEntityNameResolversin interfaceMetamodelImplementor
-
getTypeConfiguration
Description copied from interface:MappingMetamodelTheTypeConfigurationthis metamodel is associated with- Specified by:
getTypeConfigurationin interfaceJpaMetamodel- Specified by:
getTypeConfigurationin interfaceMappingMetamodel- Specified by:
getTypeConfigurationin interfaceQueryParameterBindingTypeResolver
-
getMappingMetamodel
- Specified by:
getMappingMetamodelin interfaceQueryParameterBindingTypeResolver
-
getServiceRegistry
- Specified by:
getServiceRegistryin interfaceJpaMetamodel
-
forEachEntityDescriptor
Description copied from interface:MappingMetamodelVisit all entity mapping descriptors defined in the model- Specified by:
forEachEntityDescriptorin interfaceMappingMetamodel
-
streamEntityDescriptors
- Specified by:
streamEntityDescriptorsin interfaceMappingMetamodel
-
getEntityDescriptor
Description copied from interface:MappingMetamodelGet an entity mapping descriptor based on its Hibernate entity-name- Specified by:
getEntityDescriptorin interfaceMappingMetamodel- See Also:
-
findEntityDescriptor
Description copied from interface:MappingMetamodelFind an entity mapping descriptor based on its Hibernate entity-name.- Specified by:
findEntityDescriptorin interfaceMappingMetamodel
-
findEntityDescriptor
Description copied from interface:MappingMetamodelFind an entity mapping descriptor based on its Class.- Specified by:
findEntityDescriptorin interfaceMappingMetamodel
-
isEntityClass
- Specified by:
isEntityClassin interfaceMappingMetamodel
-
getEntityDescriptor
Description copied from interface:MappingMetamodelGet an entity mapping descriptor based on its Class.- Specified by:
getEntityDescriptorin interfaceMappingMetamodel- See Also:
-
locateEntityDescriptor
Description copied from interface:MappingMetamodelLocate an entity mapping descriptor by Class. The passed Class might refer to either the entity Class directly, or it might name a proxy interface for the entity. This method accounts for both, preferring the direct entity name.- Specified by:
locateEntityDescriptorin interfaceMappingMetamodel
-
entity
Description copied from interface:MetamodelReturn the metamodel entity type representing the entity.- Specified by:
entityin interfaceJpaMetamodel- Specified by:
entityin interfaceMetamodel- Parameters:
cls- the type of the represented entity- Returns:
- the metamodel entity type
-
managedType
Description copied from interface:MetamodelReturn the metamodel managed type representing the entity, mapped superclass, or embeddable class.- Specified by:
managedTypein interfaceJpaMetamodel- Specified by:
managedTypein interfaceMetamodel- Parameters:
cls- the type of the represented managed class- Returns:
- the metamodel managed type
-
embeddable
Description copied from interface:MetamodelReturn the metamodel embeddable type representing the embeddable class.- Specified by:
embeddablein interfaceJpaMetamodel- Specified by:
embeddablein interfaceMetamodel- Parameters:
cls- the type of the represented embeddable class- Returns:
- the metamodel embeddable type
-
getManagedTypes
Description copied from interface:MetamodelReturn the metamodel managed types.- Specified by:
getManagedTypesin interfaceJpaMetamodel- Specified by:
getManagedTypesin interfaceMetamodel- Returns:
- the metamodel managed types
-
getEntities
Description copied from interface:MetamodelReturn the metamodel entity types.- Specified by:
getEntitiesin interfaceJpaMetamodel- Specified by:
getEntitiesin interfaceMetamodel- Returns:
- the metamodel entity types
-
getEmbeddables
Description copied from interface:MetamodelReturn the metamodel embeddable types. Returns empty set if there are no embeddable types.- Specified by:
getEmbeddablesin interfaceJpaMetamodel- Specified by:
getEmbeddablesin interfaceMetamodel- Returns:
- the metamodel embeddable types
-
managedType
Description copied from interface:JpaMetamodelAccess to a managed type through its name- Specified by:
managedTypein interfaceJpaMetamodel
-
entity
Description copied from interface:JpaMetamodelAccess to an entity supporting Hibernate's entity-name feature- Specified by:
entityin interfaceJpaMetamodel
-
embeddable
Description copied from interface:JpaMetamodelAccess to an embeddable type from FQN- Specified by:
embeddablein interfaceJpaMetamodel
-
getHqlEntityReference
Description copied from interface:JpaMetamodelSpecialized handling for resolving entity-name references in an HQL query- Specified by:
getHqlEntityReferencein interfaceJpaMetamodel
-
resolveHqlEntityReference
Description copied from interface:JpaMetamodelSpecialized handling for resolving entity-name references in an HQL query- Specified by:
resolveHqlEntityReferencein interfaceJpaMetamodel
-
findManagedType
Description copied from interface:JpaMetamodelSame asJpaMetamodel.managedType(java.lang.String)exceptnullis returned rather than throwing an exception- Specified by:
findManagedTypein interfaceJpaMetamodel
-
findEntityType
Description copied from interface:JpaMetamodelSame asJpaMetamodel.entity(java.lang.String)exceptnullis returned rather than throwing an exception- Specified by:
findEntityTypein interfaceJpaMetamodel
-
qualifyImportableName
- Specified by:
qualifyImportableNamein interfaceJpaMetamodel
-
getEnumTypesForValue
- Specified by:
getEnumTypesForValuein interfaceJpaMetamodel
-
getJavaConstantType
- Specified by:
getJavaConstantTypein interfaceJpaMetamodel
-
getJavaConstant
- Specified by:
getJavaConstantin interfaceJpaMetamodel
-
getEnumType
- Specified by:
getEnumTypein interfaceJpaMetamodel
-
enumValue
- Specified by:
enumValuein interfaceJpaMetamodel
-
getImplementors
Description copied from interface:MetamodelGiven the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.- Specified by:
getImplementorsin interfaceMetamodel- Parameters:
className- The name of the entity class- Returns:
- the names of all persistent (mapped) classes that extend or implement the given class or interface, accounting for implicit/explicit polymorphism settings and excluding mapped subclasses/joined-subclasses of other classes in the result.
- Throws:
MappingException
-
entityPersisters
Description copied from interface:MetamodelImplementorGet all entity persisters as a Map, which entity name its the key and the persister is the value.- Specified by:
entityPersistersin interfaceMetamodelImplementor- Returns:
- The Map contains all entity persisters.
-
collectionPersister
Description copied from interface:MetamodelImplementorGet the persister object for a collection role.- Specified by:
collectionPersisterin interfaceMetamodelImplementor- Parameters:
role- The role of the collection for which to retrieve the persister.- Returns:
- The persister
-
collectionPersisters
Description copied from interface:MetamodelImplementorGet all collection persisters as a Map, which collection role as the key and the persister is the value.- Specified by:
collectionPersistersin interfaceMetamodelImplementor- Returns:
- The Map contains all collection persisters.
-
entityPersister
Description copied from interface:MetamodelImplementorLocate the persister for an entity by the entity class.- Specified by:
entityPersisterin interfaceMetamodelImplementor- Parameters:
entityClass- The entity class- Returns:
- The entity persister
-
entityPersister
Description copied from interface:MetamodelImplementorLocate the persister for an entity by the entity-name- Specified by:
entityPersisterin interfaceMetamodelImplementor- Parameters:
entityName- The name of the entity for which to retrieve the persister.- Returns:
- The persister
- Throws:
MappingException- Indicates persister could not be found with that name.
-
locateEntityPersister
Description copied from interface:MappingMetamodelLocate the entity persister by name.- Specified by:
locateEntityPersisterin interfaceMappingMetamodel- Returns:
- The located EntityPersister, never
null
-
getImportedName
- Specified by:
getImportedNamein interfaceMappingMetamodel
-
forEachCollectionDescriptor
Description copied from interface:MappingMetamodelVisit the mapping descriptors for all collections defined in the model- Specified by:
forEachCollectionDescriptorin interfaceMappingMetamodel
-
streamCollectionDescriptors
- Specified by:
streamCollectionDescriptorsin interfaceMappingMetamodel
-
getCollectionDescriptor
Description copied from interface:MappingMetamodelGet a collection mapping descriptor based on its role- Specified by:
getCollectionDescriptorin interfaceMappingMetamodel- See Also:
-
findCollectionDescriptor
Description copied from interface:MappingMetamodelFind a collection mapping descriptor based on its role. Returnsnullif the role does not refer to a collection- Specified by:
findCollectionDescriptorin interfaceMappingMetamodel- See Also:
-
getCollectionRolesByEntityParticipant
Description copied from interface:MappingMetamodelImplementorRetrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.- Specified by:
getCollectionRolesByEntityParticipantin interfaceMappingMetamodelImplementor- Specified by:
getCollectionRolesByEntityParticipantin interfaceMetamodelImplementor- Parameters:
entityName- The entity name for which to get the collection roles.- Returns:
- set of all the collection roles in which the given entityName participates.
-
getAllEntityNames
Description copied from interface:MetamodelImplementorGet the names of all entities known to this Metamodel- Specified by:
getAllEntityNamesin interfaceMetamodelImplementor- Returns:
- All the entity names
-
getAllCollectionRoles
Description copied from interface:MetamodelImplementorGet the names of all collections known to this Metamodel- Specified by:
getAllCollectionRolesin interfaceMetamodelImplementor- Returns:
- All the entity names
-
addNamedEntityGraph
- Specified by:
addNamedEntityGraphin interfaceJpaMetamodel- Specified by:
addNamedEntityGraphin interfaceMappingMetamodel
-
findEntityGraphByName
- Specified by:
findEntityGraphByNamein interfaceJpaMetamodel
-
findEntityGraphsByJavaType
- Specified by:
findEntityGraphsByJavaTypein interfaceJpaMetamodel
-
getJpaCompliance
- Specified by:
getJpaCompliancein interfaceJpaMetamodel
-
findNamedGraph
- Specified by:
findNamedGraphin interfaceMappingMetamodel
-
forEachNamedGraph
- Specified by:
forEachNamedGraphin interfaceMappingMetamodel
-
defaultGraph
- Specified by:
defaultGraphin interfaceMappingMetamodel
-
defaultGraph
- Specified by:
defaultGraphin interfaceMappingMetamodel
-
defaultGraph
- Specified by:
defaultGraphin interfaceMappingMetamodel
-
defaultGraph
- Specified by:
defaultGraphin interfaceMappingMetamodel
-
findRootGraphsForType
- Specified by:
findRootGraphsForTypein interfaceMappingMetamodel
-
findRootGraphsForType
- Specified by:
findRootGraphsForTypein interfaceMappingMetamodel
-
findRootGraphsForType
- Specified by:
findRootGraphsForTypein interfaceMappingMetamodel
-
close
public void close()- Specified by:
closein interfaceMetamodelImplementor
-
resolveMappingExpressible
public MappingModelExpressible<?> resolveMappingExpressible(SqmExpressible<?> sqmExpressible, Function<NavigablePath, TableGroup> tableGroupLocator) - Specified by:
resolveMappingExpressiblein interfaceMappingMetamodel
-
resolveQueryParameterType
Description copied from interface:MappingMetamodelGiven a Java type, determine the corresponding BindableType to use implicitly- Specified by:
resolveQueryParameterTypein interfaceMappingMetamodel
-