Package org.hibernate.metamodel.spi
Interface MetamodelImplementor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description <T> voidaddNamedEntityGraph(java.lang.String graphName, EntityGraph<T> entityGraph)Deprecated.UseaddNamedEntityGraph(String, RootGraphImplementor)instead.<T> voidaddNamedEntityGraph(java.lang.String graphName, RootGraphImplementor<T> entityGraph)voidclose()CollectionPersistercollectionPersister(java.lang.String role)Get the persister object for a collection role.java.util.Map<java.lang.String,CollectionPersister>collectionPersisters()Get all collection persisters as a Map, which collection role as the key and the persister is the value.<X> EmbeddedTypeDescriptor<X>embeddable(java.lang.Class<X> cls)<X> EntityTypeDescriptor<X>entity(java.lang.Class<X> cls)<X> EntityTypeDescriptor<X>entity(java.lang.String entityName)Access to an entity supporting Hibernate's entity-name featureEntityPersisterentityPersister(java.lang.Class entityClass)Locate the persister for an entity by the entity class.EntityPersisterentityPersister(java.lang.String entityName)Locate the persister for an entity by the entity-namejava.util.Map<java.lang.String,EntityPersister>entityPersisters()Get all entity persisters as a Map, which entity name its the key and the persister is the value.<T> RootGraphImplementor<T>findEntityGraphByName(java.lang.String name)<T> java.util.List<RootGraphImplementor<? super T>>findEntityGraphsByJavaType(java.lang.Class<T> entityClass)default <T> java.util.List<EntityGraph<? super T>>findEntityGraphsByType(java.lang.Class<T> entityClass)Deprecated.UsefindEntityGraphsByJavaType(Class)instead.java.lang.String[]getAllCollectionRoles()Get the names of all collections known to this Metamodeljava.lang.String[]getAllEntityNames()Get the names of all entities known to this Metamodeljava.util.Set<java.lang.String>getCollectionRolesByEntityParticipant(java.lang.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.java.util.Collection<EntityNameResolver>getEntityNameResolvers()default EntityTypeDescriptorgetEntityTypeByName(java.lang.String entityName)SessionFactoryImplementorgetSessionFactory()Access to the SessionFactory that this Metamodel instance is bound to.TypeConfigurationgetTypeConfiguration()Access to the TypeConfiguration in effect for this SessionFactory/MetamodelEntityPersisterlocateEntityPersister(java.lang.Class byClass)Locate an EntityPersister by the entity class.EntityPersisterlocateEntityPersister(java.lang.String byName)Locate the entity persister by name.<X> ManagedTypeDescriptor<X>managedType(java.lang.Class<X> cls)-
Methods inherited from interface javax.persistence.metamodel.Metamodel
getEmbeddables, getEntities, getManagedTypes
-
Methods inherited from interface org.hibernate.Metamodel
getImplementors, getImportedClassName
-
-
-
-
Method Detail
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()
Access to the TypeConfiguration in effect for this SessionFactory/Metamodel- Returns:
- Access to the TypeConfiguration
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()
Description copied from interface:MetamodelAccess to the SessionFactory that this Metamodel instance is bound to.- Specified by:
getSessionFactoryin interfaceMetamodel- Returns:
- The SessionFactory
-
getEntityNameResolvers
java.util.Collection<EntityNameResolver> getEntityNameResolvers()
-
locateEntityPersister
EntityPersister locateEntityPersister(java.lang.Class byClass)
Locate an EntityPersister by the entity class. The passed Class might refer to either the entity name directly, or it might name a proxy interface for the entity. This method accounts for both, preferring the direct named entity name.- Parameters:
byClass- The concrete Class or proxy interface for the entity to locate the persister for.- Returns:
- The located EntityPersister, never
null - Throws:
UnknownEntityTypeException- If a matching EntityPersister cannot be located
-
locateEntityPersister
EntityPersister locateEntityPersister(java.lang.String byName)
Locate the entity persister by name.- Parameters:
byName- The entity name- Returns:
- The located EntityPersister, never
null - Throws:
UnknownEntityTypeException- If a matching EntityPersister cannot be located
-
entityPersister
EntityPersister entityPersister(java.lang.Class entityClass)
Locate the persister for an entity by the entity class.- Parameters:
entityClass- The entity class- Returns:
- The entity persister
- Throws:
MappingException- Indicates persister for that class could not be found.
-
entityPersister
EntityPersister entityPersister(java.lang.String entityName)
Locate the persister for an entity by the entity-name- 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.
-
entityPersisters
java.util.Map<java.lang.String,EntityPersister> entityPersisters()
Get all entity persisters as a Map, which entity name its the key and the persister is the value.- Returns:
- The Map contains all entity persisters.
-
collectionPersister
CollectionPersister collectionPersister(java.lang.String role)
Get the persister object for a collection role.- Parameters:
role- The role of the collection for which to retrieve the persister.- Returns:
- The persister
- Throws:
MappingException- Indicates persister could not be found with that role.
-
collectionPersisters
java.util.Map<java.lang.String,CollectionPersister> collectionPersisters()
Get all collection persisters as a Map, which collection role as the key and the persister is the value.- Returns:
- The Map contains all collection persisters.
-
getCollectionRolesByEntityParticipant
java.util.Set<java.lang.String> getCollectionRolesByEntityParticipant(java.lang.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.- 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
java.lang.String[] getAllEntityNames()
Get the names of all entities known to this Metamodel- Returns:
- All of the entity names
-
getAllCollectionRoles
java.lang.String[] getAllCollectionRoles()
Get the names of all collections known to this Metamodel- Returns:
- All of the entity names
-
addNamedEntityGraph
<T> void addNamedEntityGraph(java.lang.String graphName, RootGraphImplementor<T> entityGraph)
-
addNamedEntityGraph
@Deprecated <T> void addNamedEntityGraph(java.lang.String graphName, EntityGraph<T> entityGraph)Deprecated.UseaddNamedEntityGraph(String, RootGraphImplementor)instead.
-
findEntityGraphByName
<T> RootGraphImplementor<T> findEntityGraphByName(java.lang.String name)
-
findEntityGraphsByJavaType
<T> java.util.List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(java.lang.Class<T> entityClass)
-
findEntityGraphsByType
@Deprecated default <T> java.util.List<EntityGraph<? super T>> findEntityGraphsByType(java.lang.Class<T> entityClass)
Deprecated.UsefindEntityGraphsByJavaType(Class)instead.
-
close
void close()
-
entity
<X> EntityTypeDescriptor<X> entity(java.lang.String entityName)
Description copied from interface:MetamodelAccess to an entity supporting Hibernate's entity-name feature
-
entity
<X> EntityTypeDescriptor<X> entity(java.lang.Class<X> cls)
-
managedType
<X> ManagedTypeDescriptor<X> managedType(java.lang.Class<X> cls)
- Specified by:
managedTypein interfaceMetamodel
-
embeddable
<X> EmbeddedTypeDescriptor<X> embeddable(java.lang.Class<X> cls)
- Specified by:
embeddablein interfaceMetamodel
-
getEntityTypeByName
default EntityTypeDescriptor getEntityTypeByName(java.lang.String entityName)
- Specified by:
getEntityTypeByNamein interfaceMetamodel
-
-