Top Description Fields Constructors Methods
org.hibernate.metamodel.internal

pack-priv Class MetadataContext

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, java.util.ArrayList, .Arrays, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, javax.persistence.metamodel.Attribute, .IdentifiableType, .MappedSuperclassType, .SingularAttribute, .Type, org.hibernate.AssertionFailure, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.internal.EntityManagerMessageLogger, .HEMLogging, org.hibernate.internal.log.DeprecationLogger, org.hibernate.internal.util.ReflectHelper, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.mapping.Component, .KeyValue, .MappedSuperclass, .PersistentClass, .Property, org.hibernate.metamodel.model.domain.internal.AbstractIdentifiableType, .EntityTypeImpl, .MappedSuperclassTypeImpl, org.hibernate.metamodel.model.domain.spi.PersistentAttributeDescriptor, .EmbeddedTypeDescriptor, .EntityTypeDescriptor, .IdentifiableTypeDescriptor, .ManagedTypeDescriptor, .MappedSuperclassTypeDescriptor, .SingularPersistentAttribute, org.hibernate.type.CompositeType

Defines a context for storing information during the building of the MetamodelImpl.

This contextual information includes data needing to be processed in a second pass as well as cross-references into the built metamodel classes.

At the end of the day, clients are interested in the getEntityTypeMap and getEmbeddableTypeSet results, which represent all the registered entities and embeddables respectively.

Authors
Steve Ebersole, Emmanuel Bernard

Field Summary

Modifier and TypeField and Description
private final AttributeFactory
private Map<EmbeddedTypeDescriptor<?>, CompositeType>
private Map<Class<T>, List<EmbeddedTypeDescriptor<?>>>
private Map<Class<?>, EntityTypeDescriptor<?>>
private Map<String, EntityTypeDescriptor<?>>
private Map<PersistentClass, EntityTypeDescriptor<?>>
private final boolean
private Set<MappedSuperclass>
private static final EntityManagerMessageLogger
private Map<MappedSuperclass, MappedSuperclassTypeDescriptor<?>>
private Map<MappedSuperclassTypeDescriptor<?>, PersistentClass>
private List<Object>
private final Set<Class<T>>
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private List<PersistentClass>
stackOfPersistentClassesBeingProcessed

Stack of PersistentClass being processed.

Constructor Summary

AccessConstructor and Description
public
MetadataContext(SessionFactoryImplementor sessionFactory, Set<MappedSuperclass> mappedSuperclasses, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
private <X> void
applyIdMetadata(PersistentClass persistentClass, IdentifiableTypeDescriptor<?> identifiableType)

private <X> void
private <X> void
applyVersionAttribute(PersistentClass persistentClass, EntityTypeDescriptor<X> jpaEntityType)

private <X> void
private <X> Set<SingularPersistentAttribute<? super X, ?>>
public Set<EmbeddedTypeDescriptor<?>>
public Map<Class<?>, EntityTypeDescriptor<?>>

Returns:

The java type to EntityTypeImpl map.
getEntityTypeMap
()

Retrieves the java type to EntityTypeImpl map.

public Map<String, EntityTypeDescriptor<?>>
private PersistentClass
public Map<Class<?>, MappedSuperclassType<?>>
public PersistentClass
pack-priv SessionFactoryImplementor
getSessionFactory()

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public Set<MappedSuperclass>
pack-priv boolean
public <J> EmbeddedTypeDescriptor<J>
locateEmbeddable(Class<J> embeddableClass, CompositeType component)

public EntityTypeDescriptor<?>

Returns:

Tne corresponding JPA org.hibernate.type.EntityType, or null if not yet processed.
locateEntityType
(PersistentClass
The Hibernate (config time) metamodel instance representing an entity.
persistentClass
)

Given a Hibernate PersistentClass, locate the corresponding JPA org.hibernate.type.EntityType implementation.

public EntityTypeDescriptor<?>

Returns:

The corresponding JPA org.hibernate.type.EntityType, or null.
locateEntityType
(Class<?>
The java class.
javaType
)

Given a Java Class, locate the corresponding JPA org.hibernate.type.EntityType.

public <E> EntityTypeDescriptor<E>

Returns:

The corresponding JPA org.hibernate.type.EntityType, or null.
locateEntityType
(String
The entity-name.
entityName
)

Given an entity-name, locate the corresponding JPA org.hibernate.type.EntityType.

public MappedSuperclassTypeDescriptor<?>
public void
private <X> void
public void
private <X> void
registerAttribute(Class<T> metamodelClass, Attribute<X, ?> attribute)

private <X> void
registerAttributes(Class<T> metamodelClass, ManagedTypeDescriptor<X> managedType)

pack-priv void
pack-priv void
registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType)

pack-priv void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributeFactoryback to summary
private final AttributeFactory attributeFactory
componentByEmbeddableback to summary
private Map<EmbeddedTypeDescriptor<?>, CompositeType> componentByEmbeddable
embeddablesToProcessback to summary
private Map<Class<T>, List<EmbeddedTypeDescriptor<?>>> embeddablesToProcess
entityTypesback to summary
private Map<Class<?>, EntityTypeDescriptor<?>> entityTypes
entityTypesByEntityNameback to summary
private Map<String, EntityTypeDescriptor<?>> entityTypesByEntityName
entityTypesByPersistentClassback to summary
private Map<PersistentClass, EntityTypeDescriptor<?>> entityTypesByPersistentClass
ignoreUnsupportedback to summary
private final boolean ignoreUnsupported
knownMappedSuperclassesback to summary
private Set<MappedSuperclass> knownMappedSuperclasses
LOGback to summary
private static final EntityManagerMessageLogger LOG
mappedSuperclassByMappedSuperclassMappingback to summary
private Map<MappedSuperclass, MappedSuperclassTypeDescriptor<?>> mappedSuperclassByMappedSuperclassMapping
mappedSuperClassTypeToPersistentClassback to summary
private Map<MappedSuperclassTypeDescriptor<?>, PersistentClass> mappedSuperClassTypeToPersistentClass
orderedMappingsback to summary
private List<Object> orderedMappings
processedMetamodelClassesback to summary
private final Set<Class<T>> processedMetamodelClasses
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

stackOfPersistentClassesBeingProcessedback to summary
private List<PersistentClass> stackOfPersistentClassesBeingProcessed

Stack of PersistentClass being processed. Last in the list is the highest in the stack.

Constructor Detail

MetadataContextback to summary
public MetadataContext(SessionFactoryImplementor sessionFactory, Set<MappedSuperclass> mappedSuperclasses, JpaMetaModelPopulationSetting jpaMetaModelPopulationSetting)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

applyIdMetadataback to summary
private <X> void applyIdMetadata(PersistentClass persistentClass, IdentifiableTypeDescriptor<?> identifiableType)
Annotations
@SuppressWarnings:unchecked
applyIdMetadataback to summary
private <X> void applyIdMetadata(MappedSuperclass mappingType, MappedSuperclassTypeDescriptor<X> jpaMappingType)
applyVersionAttributeback to summary
private <X> void applyVersionAttribute(PersistentClass persistentClass, EntityTypeDescriptor<X> jpaEntityType)
applyVersionAttributeback to summary
private <X> void applyVersionAttribute(MappedSuperclass mappingType, MappedSuperclassTypeDescriptor<X> jpaMappingType)
buildIdClassAttributesback to summary
private <X> Set<SingularPersistentAttribute<? super X, ?>> buildIdClassAttributes(IdentifiableTypeDescriptor<X> ownerType, Iterator<Property> propertyIterator)
getEmbeddableTypeSetback to summary
public Set<EmbeddedTypeDescriptor<?>> getEmbeddableTypeSet()
getEntityTypeMapback to summary
public Map<Class<?>, EntityTypeDescriptor<?>> getEntityTypeMap()

Retrieves the java type to EntityTypeImpl map.

Returns:Map<Class<?>, EntityTypeDescriptor<?>>

The java type to EntityTypeImpl map.

getEntityTypesByEntityNameback to summary
public Map<String, EntityTypeDescriptor<?>> getEntityTypesByEntityName()
getEntityWorkedOnback to summary
private PersistentClass getEntityWorkedOn()
getMappedSuperclassTypeMapback to summary
public Map<Class<?>, MappedSuperclassType<?>> getMappedSuperclassTypeMap()
getPersistentClassHostingPropertiesback to summary
public PersistentClass getPersistentClassHostingProperties(MappedSuperclassTypeImpl<?> mappedSuperclassType)
getSessionFactoryback to summary
pack-priv SessionFactoryImplementor getSessionFactory()

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

getUnusedMappedSuperclassesback to summary
public Set<MappedSuperclass> getUnusedMappedSuperclasses()
isIgnoreUnsupportedback to summary
pack-priv boolean isIgnoreUnsupported()
locateEmbeddableback to summary
public <J> EmbeddedTypeDescriptor<J> locateEmbeddable(Class<J> embeddableClass, CompositeType component)
locateEntityTypeback to summary
public EntityTypeDescriptor<?> locateEntityType(PersistentClass persistentClass)

Given a Hibernate PersistentClass, locate the corresponding JPA org.hibernate.type.EntityType implementation. May return null if the given PersistentClass has not yet been processed.

Parameters
persistentClass:PersistentClass

The Hibernate (config time) metamodel instance representing an entity.

Returns:EntityTypeDescriptor<?>

Tne corresponding JPA org.hibernate.type.EntityType, or null if not yet processed.

locateEntityTypeback to summary
public EntityTypeDescriptor<?> locateEntityType(Class<?> javaType)

Given a Java Class, locate the corresponding JPA org.hibernate.type.EntityType. May return null which could mean that no such mapping exists at least at this time.

Parameters
javaType:Class<?>

The java class.

Returns:EntityTypeDescriptor<?>

The corresponding JPA org.hibernate.type.EntityType, or null.

locateEntityTypeback to summary
public <E> EntityTypeDescriptor<E> locateEntityType(String entityName)

Given an entity-name, locate the corresponding JPA org.hibernate.type.EntityType. May return null which could means that no such mapping exists at least at this time.

Parameters
entityName:String

The entity-name.

Returns:EntityTypeDescriptor<E>

The corresponding JPA org.hibernate.type.EntityType, or null.

Annotations
@SuppressWarnings:unchecked
locateMappedSuperclassTypeback to summary
public MappedSuperclassTypeDescriptor<?> locateMappedSuperclassType(MappedSuperclass mappedSuperclass)
popEntityWorkedOnback to summary
public void popEntityWorkedOn(PersistentClass persistentClass)
populateStaticMetamodelback to summary
private <X> void populateStaticMetamodel(ManagedTypeDescriptor<X> managedType)
pushEntityWorkedOnback to summary
public void pushEntityWorkedOn(PersistentClass persistentClass)
registerAttributeback to summary
private <X> void registerAttribute(Class<T> metamodelClass, Attribute<X, ?> attribute)
registerAttributesback to summary
private <X> void registerAttributes(Class<T> metamodelClass, ManagedTypeDescriptor<X> managedType)
registerEmbeddableTypeback to summary
pack-priv void registerEmbeddableType(EmbeddedTypeDescriptor<?> embeddableType, CompositeType component)
registerEntityTypeback to summary
pack-priv void registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType)
registerMappedSuperclassTypeback to summary
pack-priv void registerMappedSuperclassType(MappedSuperclass mappedSuperclass, MappedSuperclassTypeDescriptor<?> mappedSuperclassType)
wrapUpback to summary
public void wrapUp()
Annotations
@SuppressWarnings:unchecked