public class MetamodelImpl extends Object implements MetamodelImplementor, Serializable
Metamodel
contract.Constructor and Description |
---|
MetamodelImpl(SessionFactoryImplementor sessionFactory,
TypeConfiguration typeConfiguration) |
Modifier and Type | Method and Description |
---|---|
<T> void |
addNamedEntityGraph(String graphName,
EntityGraph<T> entityGraph) |
void |
close() |
CollectionPersister |
collectionPersister(String role)
Get the persister object for a collection role.
|
Map<String,CollectionPersister> |
collectionPersisters()
Get all collection persisters as a Map, which collection role as the key and the persister is the value.
|
<X> EmbeddableType<X> |
embeddable(Class<X> cls)
Return the metamodel embeddable type representing the
embeddable class.
|
<X> EntityType<X> |
entity(Class<X> cls)
Return the metamodel entity type representing the entity.
|
<X> EntityType<X> |
entity(String entityName)
Access to an entity supporting Hibernate's entity-name feature
|
EntityPersister |
entityPersister(Class entityClass)
Locate the persister for an entity by the entity class.
|
EntityPersister |
entityPersister(String entityName)
Locate the persister for an entity by the entity-name
|
Map<String,EntityPersister> |
entityPersisters()
Get all entity persisters as a Map, which entity name its the key and the persister is the value.
|
<T> EntityGraph<T> |
findEntityGraphByName(String name) |
<T> List<EntityGraph<? super T>> |
findEntityGraphsByType(Class<T> entityClass) |
String[] |
getAllCollectionRoles()
Get the names of all collections known to this Metamodel
|
String[] |
getAllEntityNames()
Get the names of all entities known to this Metamodel
|
Set<String> |
getCollectionRolesByEntityParticipant(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<?>> |
getEmbeddables()
Return the metamodel embeddable types.
|
Set<EntityType<?>> |
getEntities()
Return the metamodel entity types.
|
Collection<EntityNameResolver> |
getEntityNameResolvers() |
String[] |
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.
|
String |
getImportedClassName(String className) |
Set<ManagedType<?>> |
getManagedTypes()
Return the metamodel managed types.
|
SessionFactoryImplementor |
getSessionFactory()
Access to the SessionFactory that this Metamodel instance is bound to.
|
TypeConfiguration |
getTypeConfiguration()
Access to the TypeConfiguration in effect for this SessionFactory/Metamodel
|
void |
initialize(MetadataImplementor mappingMetadata,
JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)
Prepare the metamodel using the information from the collection of Hibernate
PersistentClass models |
EntityPersister |
locateEntityPersister(Class byClass)
Locate an EntityPersister by the entity class.
|
EntityPersister |
locateEntityPersister(String byName)
Locate the entity persister by name.
|
<X> ManagedType<X> |
managedType(Class<X> cls)
Return the metamodel managed type representing the
entity, mapped superclass, or embeddable class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEntityTypeByName
public MetamodelImpl(SessionFactoryImplementor sessionFactory, TypeConfiguration typeConfiguration)
public void initialize(MetadataImplementor mappingMetadata, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)
PersistentClass
modelsmappingMetadata
- The mapping informationjpaMetaModelPopulationSetting
- Should the JPA Metamodel be built as well?public Collection<EntityNameResolver> getEntityNameResolvers()
getEntityNameResolvers
in interface MetamodelImplementor
public TypeConfiguration getTypeConfiguration()
MetamodelImplementor
getTypeConfiguration
in interface MetamodelImplementor
public SessionFactoryImplementor getSessionFactory()
Metamodel
getSessionFactory
in interface MetamodelImplementor
public <X> EntityType<X> entity(Class<X> cls)
Metamodel
public <X> ManagedType<X> managedType(Class<X> cls)
Metamodel
managedType
in interface Metamodel
cls
- the type of the represented managed classpublic <X> EmbeddableType<X> embeddable(Class<X> cls)
Metamodel
embeddable
in interface Metamodel
cls
- the type of the represented embeddable classpublic Set<ManagedType<?>> getManagedTypes()
Metamodel
getManagedTypes
in interface Metamodel
public Set<EntityType<?>> getEntities()
Metamodel
getEntities
in interface Metamodel
public Set<EmbeddableType<?>> getEmbeddables()
Metamodel
getEmbeddables
in interface Metamodel
public <X> EntityType<X> entity(String entityName)
Metamodel
entityName
- The entity-namepublic String[] getImplementors(String className) throws MappingException
Metamodel
className
- The name of the entity classMappingException
public Map<String,EntityPersister> entityPersisters()
MetamodelImplementor
entityPersisters
in interface MetamodelImplementor
public CollectionPersister collectionPersister(String role)
MetamodelImplementor
collectionPersister
in interface MetamodelImplementor
role
- The role of the collection for which to retrieve the persister.public Map<String,CollectionPersister> collectionPersisters()
MetamodelImplementor
collectionPersisters
in interface MetamodelImplementor
public EntityPersister entityPersister(Class entityClass)
MetamodelImplementor
entityPersister
in interface MetamodelImplementor
entityClass
- The entity classpublic EntityPersister entityPersister(String entityName) throws MappingException
MetamodelImplementor
entityPersister
in interface MetamodelImplementor
entityName
- The name of the entity for which to retrieve the persister.MappingException
- Indicates persister could not be found with that name.public EntityPersister locateEntityPersister(Class byClass)
MetamodelImplementor
locateEntityPersister
in interface MetamodelImplementor
byClass
- The concrete Class or proxy interface for the entity to locate the persister for.null
public EntityPersister locateEntityPersister(String byName)
MetamodelImplementor
locateEntityPersister
in interface MetamodelImplementor
byName
- The entity namenull
public Set<String> getCollectionRolesByEntityParticipant(String entityName)
MetamodelImplementor
getCollectionRolesByEntityParticipant
in interface MetamodelImplementor
entityName
- The entity name for which to get the collection roles.public String[] getAllEntityNames()
MetamodelImplementor
getAllEntityNames
in interface MetamodelImplementor
public String[] getAllCollectionRoles()
MetamodelImplementor
getAllCollectionRoles
in interface MetamodelImplementor
public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph)
addNamedEntityGraph
in interface MetamodelImplementor
public <T> EntityGraph<T> findEntityGraphByName(String name)
findEntityGraphByName
in interface MetamodelImplementor
public <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)
findEntityGraphsByType
in interface MetamodelImplementor
public void close()
close
in interface MetamodelImplementor
Copyright © 2019 JBoss by Red Hat. All rights reserved.