Package org.hibernate.metamodel
Interface MappingMetamodel
-
- All Known Subinterfaces:
MappingMetamodelImplementor,MetamodelImplementor
@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> voidaddNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)RootGraph<?>defaultGraph(Class entityJavaType)RootGraph<?>defaultGraph(String entityName)RootGraph<?>defaultGraph(EntityDomainType<?> entityDomainType)RootGraph<?>defaultGraph(EntityPersister entityDescriptor)CollectionPersisterfindCollectionDescriptor(String role)Find a collection mapping descriptor based on its role.CollectionPersisterfindCollectionDescriptor(NavigableRole role)Find a collection mapping descriptor based on its role.EntityPersisterfindEntityDescriptor(Class<?> entityJavaType)Find an entity mapping descriptor based on its Class.EntityPersisterfindEntityDescriptor(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)voidforEachCollectionDescriptor(Consumer<CollectionPersister> action)Visit the mapping descriptors for all collections defined in the modelvoidforEachEntityDescriptor(Consumer<EntityPersister> action)Visit all entity mapping descriptors defined in the modelvoidforEachNamedGraph(Consumer<RootGraph<?>> action)CollectionPersistergetCollectionDescriptor(String role)Get a collection mapping descriptor based on its roleCollectionPersistergetCollectionDescriptor(NavigableRole role)Get a collection mapping descriptor based on its roleEmbeddableValuedModelPartgetEmbeddableValuedModelPart(NavigableRole role)Get an EmbeddableMappingType based on its NavigableRole.EntityPersistergetEntityDescriptor(Class<?> entityJavaType)Get an entity mapping descriptor based on its Class.EntityPersistergetEntityDescriptor(String entityName)Get an entity mapping descriptor based on its Hibernate entity-nameEntityPersistergetEntityDescriptor(NavigableRole name)Get an entity mapping descriptor based on its NavigableRole.StringgetImportedName(String name)TypeConfigurationgetTypeConfiguration()TheTypeConfigurationthis metamodel is associated withbooleanisEntityClass(Class<?> entityJavaType)EntityPersisterlocateEntityDescriptor(Class<?> byClass)Locate an entity mapping descriptor by Class.default EntityPersisterlocateEntityPersister(Class<?> byClass)Deprecated.uselocateEntityDescriptor(Class)insteadEntityPersisterlocateEntityPersister(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()
TheTypeConfigurationthis 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
nullrather than throwing exception
-
findEntityDescriptor
EntityPersister findEntityDescriptor(Class<?> entityJavaType)
Find an entity mapping descriptor based on its Class.- API Note:
- Returns
nullrather 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. Returnsnullif the role does not refer to a collection
-
findCollectionDescriptor
CollectionPersister findCollectionDescriptor(String role)
Find a collection mapping descriptor based on its role. Returnsnullif 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)
-
-