Package org.hibernate.metamodel
Interface MappingMetamodel
-
- All Known Subinterfaces:
MappingMetamodelImplementor
,MetamodelImplementor
- All Known Implementing Classes:
MappingMetamodelImpl
@Incubating public interface MappingMetamodel
Access to information about the runtime relational O/R mapping model.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description <T> void
addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)
RootGraph<?>
defaultGraph(Class entityJavaType)
RootGraph<?>
defaultGraph(String entityName)
RootGraph<?>
defaultGraph(EntityDomainType<?> entityDomainType)
RootGraph<?>
defaultGraph(EntityPersister entityDescriptor)
CollectionPersister
findCollectionDescriptor(String role)
Find a collection mapping descriptor based on its role.CollectionPersister
findCollectionDescriptor(NavigableRole role)
Find a collection mapping descriptor based on its role.EntityPersister
findEntityDescriptor(Class<?> entityJavaType)
Find an entity mapping descriptor based on its Class.EntityPersister
findEntityDescriptor(String entityName)
Find an entity mapping descriptor based on its Hibernate entity-name.RootGraph<?>
findNamedGraph(String name)
List<RootGraph<?>>
findRootGraphsForType(Class baseEntityJavaType)
List<RootGraph<?>>
findRootGraphsForType(String baseEntityName)
List<RootGraph<?>>
findRootGraphsForType(EntityPersister baseEntityDescriptor)
void
forEachCollectionDescriptor(Consumer<CollectionPersister> action)
Visit the mapping descriptors for all collections defined in the modelvoid
forEachEntityDescriptor(Consumer<EntityPersister> action)
Visit all entity mapping descriptors defined in the modelvoid
forEachNamedGraph(Consumer<RootGraph<?>> action)
CollectionPersister
getCollectionDescriptor(String role)
Get a collection mapping descriptor based on its roleCollectionPersister
getCollectionDescriptor(NavigableRole role)
Get a collection mapping descriptor based on its roleEmbeddableValuedModelPart
getEmbeddableValuedModelPart(NavigableRole role)
Get an EmbeddableMappingType based on its NavigableRole.EntityPersister
getEntityDescriptor(Class<?> entityJavaType)
Get an entity mapping descriptor based on its Class.EntityPersister
getEntityDescriptor(String entityName)
Get an entity mapping descriptor based on its Hibernate entity-nameEntityPersister
getEntityDescriptor(NavigableRole name)
Get an entity mapping descriptor based on its NavigableRole.String
getImportedName(String name)
TypeConfiguration
getTypeConfiguration()
TheTypeConfiguration
this metamodel is associated withboolean
isEntityClass(Class<?> entityJavaType)
EntityPersister
locateEntityDescriptor(Class<?> byClass)
Locate an entity mapping descriptor by Class.default EntityPersister
locateEntityPersister(Class<?> byClass)
Deprecated.uselocateEntityDescriptor(Class)
insteadEntityPersister
locateEntityPersister(String byName)
Deprecated.- usegetEntityDescriptor(String)
insteadMappingModelExpressible<?>
resolveMappingExpressible(SqmExpressible<?> sqmExpressible, Function<NavigablePath,TableGroup> tableGroupLocator)
<T> BindableType<T>
resolveQueryParameterType(Class<T> javaType)
Given a Java type, determine the corresponding BindableType to use implicitlyStream<CollectionPersister>
streamCollectionDescriptors()
Stream<EntityPersister>
streamEntityDescriptors()
-
-
-
Method Detail
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()
TheTypeConfiguration
this metamodel is associated with
-
resolveMappingExpressible
MappingModelExpressible<?> resolveMappingExpressible(SqmExpressible<?> sqmExpressible, Function<NavigablePath,TableGroup> tableGroupLocator)
-
resolveQueryParameterType
<T> BindableType<T> resolveQueryParameterType(Class<T> javaType)
Given a Java type, determine the corresponding BindableType to use implicitly
-
forEachEntityDescriptor
void forEachEntityDescriptor(Consumer<EntityPersister> action)
Visit all entity mapping descriptors defined in the model
-
streamEntityDescriptors
Stream<EntityPersister> streamEntityDescriptors()
-
getEntityDescriptor
EntityPersister getEntityDescriptor(String entityName)
Get an entity mapping descriptor based on its Hibernate entity-name- Throws:
IllegalArgumentException
- if the name does not refer to an entity- See Also:
findEntityDescriptor(java.lang.String)
-
getEntityDescriptor
EntityPersister getEntityDescriptor(NavigableRole name)
Get an entity mapping descriptor based on its NavigableRole.- Throws:
IllegalArgumentException
- if the name does not refer to an entity- See Also:
findEntityDescriptor(java.lang.String)
-
getEmbeddableValuedModelPart
EmbeddableValuedModelPart getEmbeddableValuedModelPart(NavigableRole role)
Get an EmbeddableMappingType based on its NavigableRole.- Throws:
IllegalArgumentException
- if the role does not refer to an entity- See Also:
findEntityDescriptor(java.lang.String)
-
getEntityDescriptor
EntityPersister getEntityDescriptor(Class<?> entityJavaType)
Get an entity mapping descriptor based on its Class.- Throws:
IllegalArgumentException
- if the name does not refer to an entity- See Also:
findEntityDescriptor(java.lang.String)
-
findEntityDescriptor
EntityPersister findEntityDescriptor(String entityName)
Find an entity mapping descriptor based on its Hibernate entity-name.- API Note:
- Returns
null
rather than throwing exception
-
findEntityDescriptor
EntityPersister findEntityDescriptor(Class<?> entityJavaType)
Find an entity mapping descriptor based on its Class.- API Note:
- Returns
null
rather than throwing exception
-
isEntityClass
boolean isEntityClass(Class<?> entityJavaType)
-
locateEntityDescriptor
EntityPersister locateEntityDescriptor(Class<?> byClass)
Locate 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.- Throws:
UnknownEntityTypeException
- If a matching EntityPersister cannot be located
-
locateEntityPersister
@Deprecated(since="6.0") default EntityPersister locateEntityPersister(Class<?> byClass)
Deprecated.uselocateEntityDescriptor(Class)
instead
-
locateEntityPersister
@Deprecated(since="6.0") EntityPersister locateEntityPersister(String byName)
Deprecated.- usegetEntityDescriptor(String)
insteadLocate the entity persister by name.- Returns:
- The located EntityPersister, never
null
- Throws:
UnknownEntityTypeException
- If a matching EntityPersister cannot be located
-
forEachCollectionDescriptor
void forEachCollectionDescriptor(Consumer<CollectionPersister> action)
Visit the mapping descriptors for all collections defined in the model
-
streamCollectionDescriptors
Stream<CollectionPersister> streamCollectionDescriptors()
-
getCollectionDescriptor
CollectionPersister getCollectionDescriptor(String role)
Get a collection mapping descriptor based on its role- Throws:
IllegalArgumentException
- if the role does not refer to a collection- See Also:
findCollectionDescriptor(org.hibernate.metamodel.model.domain.NavigableRole)
-
getCollectionDescriptor
CollectionPersister getCollectionDescriptor(NavigableRole role)
Get a collection mapping descriptor based on its role- Throws:
IllegalArgumentException
- if the role does not refer to a collection- See Also:
findCollectionDescriptor(org.hibernate.metamodel.model.domain.NavigableRole)
-
findCollectionDescriptor
CollectionPersister findCollectionDescriptor(NavigableRole role)
Find a collection mapping descriptor based on its role. Returnsnull
if the role does not refer to a collection
-
findCollectionDescriptor
CollectionPersister findCollectionDescriptor(String role)
Find a collection mapping descriptor based on its role. Returnsnull
if the role does not refer to a collection
-
addNamedEntityGraph
<T> void addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)
-
defaultGraph
RootGraph<?> defaultGraph(EntityPersister entityDescriptor)
-
defaultGraph
RootGraph<?> defaultGraph(EntityDomainType<?> entityDomainType)
-
findRootGraphsForType
List<RootGraph<?>> findRootGraphsForType(EntityPersister baseEntityDescriptor)
-
-