类 MetamodelImpl
- java.lang.Object
-
- org.hibernate.metamodel.internal.MetamodelImpl
-
- 所有已实现的接口:
Serializable,javax.persistence.metamodel.Metamodel,Metamodel,MetamodelImplementor
public class MetamodelImpl extends Object implements MetamodelImplementor, Serializable
Hibernate implementation of the JPAMetamodelcontract.- 作者:
- Steve Ebersole, Emmanuel Bernard
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 MetamodelImpl(SessionFactoryImplementor sessionFactory, TypeConfiguration typeConfiguration)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 <T> voidaddNamedEntityGraph(String graphName, javax.persistence.EntityGraph<T> entityGraph)<T> voidaddNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)voidclose()CollectionPersistercollectionPersister(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> EmbeddedTypeDescriptor<X>embeddable(Class<X> cls)<X> EntityTypeDescriptor<X>entity(Class<X> cls)<X> EntityTypeDescriptor<X>entity(String entityName)Access to an entity supporting Hibernate's entity-name featureEntityPersisterentityPersister(Class entityClass)Locate the persister for an entity by the entity class.EntityPersisterentityPersister(String entityName)Locate the persister for an entity by the entity-nameMap<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(String name)<T> List<RootGraphImplementor<? super T>>findEntityGraphsByJavaType(Class<T> entityClass)String[]getAllCollectionRoles()Get the names of all collections known to this MetamodelString[]getAllEntityNames()Get the names of all entities known to this MetamodelSet<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<javax.persistence.metamodel.EmbeddableType<?>>getEmbeddables()Set<javax.persistence.metamodel.EntityType<?>>getEntities()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.StringgetImportedClassName(String className)Set<javax.persistence.metamodel.ManagedType<?>>getManagedTypes()SessionFactoryImplementorgetSessionFactory()Access to the SessionFactory that this Metamodel instance is bound to.TypeConfigurationgetTypeConfiguration()Access to the TypeConfiguration in effect for this SessionFactory/Metamodelvoidinitialize(MetadataImplementor mappingMetadata, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)Prepare the metamodel using the information from the collection of HibernatePersistentClassmodelsEntityPersisterlocateEntityPersister(Class byClass)Locate an EntityPersister by the entity class.EntityPersisterlocateEntityPersister(String byName)Locate the entity persister by name.<X> ManagedTypeDescriptor<X>managedType(Class<X> cls)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.metamodel.spi.MetamodelImplementor
findEntityGraphsByType, getEntityTypeByName
-
-
-
-
构造器详细资料
-
MetamodelImpl
public MetamodelImpl(SessionFactoryImplementor sessionFactory, TypeConfiguration typeConfiguration)
-
-
方法详细资料
-
initialize
public void initialize(MetadataImplementor mappingMetadata, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)
Prepare the metamodel using the information from the collection of HibernatePersistentClassmodels- 参数:
mappingMetadata- The mapping informationjpaMetaModelPopulationSetting- Should the JPA Metamodel be built as well?
-
getEntityNameResolvers
public Collection<EntityNameResolver> getEntityNameResolvers()
- 指定者:
getEntityNameResolvers在接口中MetamodelImplementor
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
从接口复制的说明:MetamodelImplementorAccess to the TypeConfiguration in effect for this SessionFactory/Metamodel- 指定者:
getTypeConfiguration在接口中MetamodelImplementor- 返回:
- Access to the TypeConfiguration
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
从接口复制的说明:MetamodelAccess to the SessionFactory that this Metamodel instance is bound to.- 指定者:
getSessionFactory在接口中Metamodel- 指定者:
getSessionFactory在接口中MetamodelImplementor- 返回:
- The SessionFactory
-
entity
public <X> EntityTypeDescriptor<X> entity(Class<X> cls)
- 指定者:
entity在接口中javax.persistence.metamodel.Metamodel- 指定者:
entity在接口中MetamodelImplementor
-
managedType
public <X> ManagedTypeDescriptor<X> managedType(Class<X> cls)
- 指定者:
managedType在接口中javax.persistence.metamodel.Metamodel- 指定者:
managedType在接口中MetamodelImplementor
-
embeddable
public <X> EmbeddedTypeDescriptor<X> embeddable(Class<X> cls)
- 指定者:
embeddable在接口中javax.persistence.metamodel.Metamodel- 指定者:
embeddable在接口中MetamodelImplementor
-
getManagedTypes
public Set<javax.persistence.metamodel.ManagedType<?>> getManagedTypes()
- 指定者:
getManagedTypes在接口中javax.persistence.metamodel.Metamodel
-
getEntities
public Set<javax.persistence.metamodel.EntityType<?>> getEntities()
- 指定者:
getEntities在接口中javax.persistence.metamodel.Metamodel
-
getEmbeddables
public Set<javax.persistence.metamodel.EmbeddableType<?>> getEmbeddables()
- 指定者:
getEmbeddables在接口中javax.persistence.metamodel.Metamodel
-
entity
public <X> EntityTypeDescriptor<X> entity(String entityName)
从接口复制的说明:MetamodelAccess to an entity supporting Hibernate's entity-name feature- 指定者:
entity在接口中Metamodel- 指定者:
entity在接口中MetamodelImplementor- 参数:
entityName- The entity-name- 返回:
- The entity descriptor
-
getImportedClassName
public String getImportedClassName(String className)
- 指定者:
getImportedClassName在接口中Metamodel
-
getImplementors
public String[] getImplementors(String className) throws MappingException
从接口复制的说明:MetamodelGiven the name of an entity class, determine all the class and interface names by which it can be referenced in an HQL query.- 指定者:
getImplementors在接口中Metamodel- 参数:
className- The name of the entity class- 返回:
- the names of all persistent (mapped) classes that extend or implement the given class or interface, accounting for implicit/explicit polymorphism settings and excluding mapped subclasses/joined-subclasses of other classes in the result.
- 抛出:
MappingException
-
entityPersisters
public Map<String,EntityPersister> entityPersisters()
从接口复制的说明:MetamodelImplementorGet all entity persisters as a Map, which entity name its the key and the persister is the value.- 指定者:
entityPersisters在接口中MetamodelImplementor- 返回:
- The Map contains all entity persisters.
-
collectionPersister
public CollectionPersister collectionPersister(String role)
从接口复制的说明:MetamodelImplementorGet the persister object for a collection role.- 指定者:
collectionPersister在接口中MetamodelImplementor- 参数:
role- The role of the collection for which to retrieve the persister.- 返回:
- The persister
-
collectionPersisters
public Map<String,CollectionPersister> collectionPersisters()
从接口复制的说明:MetamodelImplementorGet all collection persisters as a Map, which collection role as the key and the persister is the value.- 指定者:
collectionPersisters在接口中MetamodelImplementor- 返回:
- The Map contains all collection persisters.
-
entityPersister
public EntityPersister entityPersister(Class entityClass)
从接口复制的说明:MetamodelImplementorLocate the persister for an entity by the entity class.- 指定者:
entityPersister在接口中MetamodelImplementor- 参数:
entityClass- The entity class- 返回:
- The entity persister
-
entityPersister
public EntityPersister entityPersister(String entityName) throws MappingException
从接口复制的说明:MetamodelImplementorLocate the persister for an entity by the entity-name- 指定者:
entityPersister在接口中MetamodelImplementor- 参数:
entityName- The name of the entity for which to retrieve the persister.- 返回:
- The persister
- 抛出:
MappingException- Indicates persister could not be found with that name.
-
locateEntityPersister
public EntityPersister locateEntityPersister(Class byClass)
从接口复制的说明:MetamodelImplementorLocate 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.- 指定者:
locateEntityPersister在接口中MetamodelImplementor- 参数:
byClass- The concrete Class or proxy interface for the entity to locate the persister for.- 返回:
- The located EntityPersister, never
null
-
locateEntityPersister
public EntityPersister locateEntityPersister(String byName)
从接口复制的说明:MetamodelImplementorLocate the entity persister by name.- 指定者:
locateEntityPersister在接口中MetamodelImplementor- 参数:
byName- The entity name- 返回:
- The located EntityPersister, never
null
-
getCollectionRolesByEntityParticipant
public Set<String> getCollectionRolesByEntityParticipant(String entityName)
从接口复制的说明:MetamodelImplementorRetrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.- 指定者:
getCollectionRolesByEntityParticipant在接口中MetamodelImplementor- 参数:
entityName- The entity name for which to get the collection roles.- 返回:
- set of all the collection roles in which the given entityName participates.
-
getAllEntityNames
public String[] getAllEntityNames()
从接口复制的说明:MetamodelImplementorGet the names of all entities known to this Metamodel- 指定者:
getAllEntityNames在接口中MetamodelImplementor- 返回:
- All of the entity names
-
getAllCollectionRoles
public String[] getAllCollectionRoles()
从接口复制的说明:MetamodelImplementorGet the names of all collections known to this Metamodel- 指定者:
getAllCollectionRoles在接口中MetamodelImplementor- 返回:
- All of the entity names
-
addNamedEntityGraph
public <T> void addNamedEntityGraph(String graphName, RootGraphImplementor<T> entityGraph)
- 指定者:
addNamedEntityGraph在接口中MetamodelImplementor
-
addNamedEntityGraph
public <T> void addNamedEntityGraph(String graphName, javax.persistence.EntityGraph<T> entityGraph)
- 指定者:
addNamedEntityGraph在接口中MetamodelImplementor
-
findEntityGraphByName
public <T> RootGraphImplementor<T> findEntityGraphByName(String name)
- 指定者:
findEntityGraphByName在接口中MetamodelImplementor
-
findEntityGraphsByJavaType
public <T> List<RootGraphImplementor<? super T>> findEntityGraphsByJavaType(Class<T> entityClass)
-
close
public void close()
- 指定者:
close在接口中MetamodelImplementor
-
-