Package org.hibernate.metamodel
Interface MappingMetamodel
-
- All Known Subinterfaces:
MetamodelImplementor
public interface MappingMetamodelAccess to information about Hibernate's runtime relational mapping model
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description 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)CollectionPersistergetCollectionDescriptor(String role)Get a collection mapping descriptor based on its roleCollectionPersistergetCollectionDescriptor(NavigableRole role)Get a collection mapping descriptor based on its roleEntityPersistergetEntityDescriptor(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()The TypeConfiguration this metamodel is associated withMappingModelExpressablelenientlyResolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath,TableGroup> tableGroupLocator)EntityPersisterlocateEntityDescriptor(Class byClass)Locate an entity mapping descriptor by Class.default EntityPersisterlocateEntityPersister(Class byClass)Deprecated.(since 6.0) uselocateEntityDescriptor(Class)insteadEntityPersisterlocateEntityPersister(String byName)Deprecated.(since 6.0) - usegetEntityDescriptor(String)insteadEntityPersisterresolveEntityDescriptor(EntityDomainType<?> entityDomainType)Given a JPA entity domain type, get the associated Hibernate entity descriptorMappingModelExpressableresolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath,TableGroup> tableGroupLocator)todo (6.0) : POC!!! Intended for use in SQM -> SQL translation<T> AllowableParameterType<T>resolveQueryParameterType(Class<T> javaType)Given a Java type, determine the corresponding AllowableParameterType to use implicitlyvoidvisitCollectionDescriptors(Consumer<CollectionPersister> action)Visit the mapping descriptors for all collections defined in the modelvoidvisitEntityDescriptors(Consumer<EntityPersister> action)Visit all entity mapping descriptors defined in the modelvoidvisitNamedGraphs(Consumer<RootGraph<?>> action)
-
-
-
Method Detail
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()
The TypeConfiguration this metamodel is associated with
-
resolveMappingExpressable
MappingModelExpressable resolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath,TableGroup> tableGroupLocator)
todo (6.0) : POC!!! Intended for use in SQM -> SQL translation
-
lenientlyResolveMappingExpressable
MappingModelExpressable lenientlyResolveMappingExpressable(SqmExpressable<?> sqmExpressable, Function<NavigablePath,TableGroup> tableGroupLocator)
-
resolveQueryParameterType
<T> AllowableParameterType<T> resolveQueryParameterType(Class<T> javaType)
Given a Java type, determine the corresponding AllowableParameterType to use implicitly
-
visitEntityDescriptors
void visitEntityDescriptors(Consumer<EntityPersister> action)
Visit all entity mapping descriptors defined in the model
-
resolveEntityDescriptor
EntityPersister resolveEntityDescriptor(EntityDomainType<?> entityDomainType)
Given a JPA entity domain type, get the associated Hibernate entity descriptor
-
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)
-
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
-
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 default EntityPersister locateEntityPersister(Class byClass)
Deprecated.(since 6.0) uselocateEntityDescriptor(Class)instead- See Also:
locateEntityDescriptor(java.lang.Class)
-
locateEntityPersister
@Deprecated EntityPersister locateEntityPersister(String byName)
Deprecated.(since 6.0) - usegetEntityDescriptor(String)insteadLocate the entity persister by name.- Returns:
- The located EntityPersister, never
null - Throws:
UnknownEntityTypeException- If a matching EntityPersister cannot be located
-
visitCollectionDescriptors
void visitCollectionDescriptors(Consumer<CollectionPersister> action)
Visit the mapping descriptors for all collections defined in the model
-
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
-
defaultGraph
RootGraph<?> defaultGraph(EntityPersister entityDescriptor)
-
defaultGraph
RootGraph<?> defaultGraph(EntityDomainType<?> entityDomainType)
-
findRootGraphsForType
List<RootGraph<?>> findRootGraphsForType(EntityPersister baseEntityDescriptor)
-
-