Top Description Inners Fields Constructors Methods
org.hibernate.boot.model.source.internal.hbm

public Class EntityHierarchyBuilder

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashMap, .List, .Map, org.hibernate.HibernateException, org.hibernate.boot.jaxb.hbm.spi.JaxbHbmDiscriminatorSubclassEntityType, .JaxbHbmEntityBaseDefinition, .JaxbHbmHibernateMapping, .JaxbHbmJoinedSubclassEntityType, .JaxbHbmRootEntityType, .JaxbHbmSubclassEntityBaseDefinition, .JaxbHbmUnionSubclassEntityType, org.hibernate.boot.model.source.spi.EntitySource, org.hibernate.internal.util.StringHelper, org.jboss.logging.Logger

Helper for dealing with entity inheritance hierarchies in hbm.xml processing. In hbm.xml the super/sub may be split across documents. The purpose of this class is to:
  1. validate that all hierarchies are complete (make sure a mapping does not reference an unknown entity as its super)
  2. ultimately order the processing of every entity to make sure we process each hierarchy "downward" (from super to sub(s)).
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final List<EntityHierarchySourceImpl>
private final Map<String, AbstractEntitySourceImpl>
private static final Logger
private Map<String, List<EntityHierarchyBuilder.ExtendsQueueEntry>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public List<EntityHierarchySourceImpl>

Returns:

The built hierarchies
buildHierarchies
()

To be called after all mapping documents have been processed (via indexMappingDocument)

private SubclassEntitySourceImpl
public void
indexMappingDocument(MappingDocument
The hbm.xml document to index
mappingDocument
)

Called for each mapping document.

private void
private AbstractEntitySourceImpl
private void
processElements(MappingDocument mappingDocument, List<? extends JaxbHbmSubclassEntityBaseDefinition> nestedSubEntityList, AbstractEntitySourceImpl container)

private void
private void
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

entityHierarchyListback to summary
private final List<EntityHierarchySourceImpl> entityHierarchyList
entitySourceByNameMapback to summary
private final Map<String, AbstractEntitySourceImpl> entitySourceByNameMap
logback to summary
private static final Logger log
toBeLinkedQueueback to summary
private Map<String, List<EntityHierarchyBuilder.ExtendsQueueEntry>> toBeLinkedQueue

Constructor Detail

EntityHierarchyBuilderback to summary
public EntityHierarchyBuilder()

Method Detail

addToToBeLinkedQueueback to summary
private void addToToBeLinkedQueue(MappingDocument mappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping)
buildHierarchiesback to summary
public List<EntityHierarchySourceImpl> buildHierarchies() throws HibernateException

To be called after all mapping documents have been processed (via indexMappingDocument)

Returns:List<EntityHierarchySourceImpl>

The built hierarchies

Exceptions
HibernateException:
Indicates subclass mappings still waiting to be linked to their super types
createSubClassEntitySourceback to summary
private SubclassEntitySourceImpl createSubClassEntitySource(MappingDocument mappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntity, EntitySource superEntity)
indexMappingDocumentback to summary
public void indexMappingDocument(MappingDocument mappingDocument)

Called for each mapping document.

Parameters
mappingDocument:MappingDocument

The hbm.xml document to index

linkAnyWaitingback to summary
private void linkAnyWaiting(MappingDocument mappingDocument, AbstractEntitySourceImpl entitySource)
locateExtendedEntitySourceback to summary
private AbstractEntitySourceImpl locateExtendedEntitySource(MappingDocument mappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping)
processElementsback to summary
private void processElements(MappingDocument mappingDocument, List<? extends JaxbHbmSubclassEntityBaseDefinition> nestedSubEntityList, AbstractEntitySourceImpl container)
processRootEntitySubEntityElementsback to summary
private void processRootEntitySubEntityElements(MappingDocument mappingDocument, JaxbHbmRootEntityType jaxbRootEntity, RootEntitySourceImpl rootEntitySource)
processSubEntityElementsback to summary
private void processSubEntityElements(MappingDocument mappingDocument, JaxbHbmEntityBaseDefinition entityBinding, AbstractEntitySourceImpl container)
processTopLevelSubClassBindingback to summary
private void processTopLevelSubClassBinding(MappingDocument mappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping)
processWaitingSubEntityMappingsback to summary
private void processWaitingSubEntityMappings(AbstractEntitySourceImpl entitySource, List<EntityHierarchyBuilder.ExtendsQueueEntry> waitingList)
org.hibernate.boot.model.source.internal.hbm back to summary

private Class EntityHierarchyBuilder.ExtendsQueueEntry

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder.ExtendsQueueEntry

Field Summary

Modifier and TypeField and Description
private final JaxbHbmSubclassEntityBaseDefinition
private final MappingDocument

Constructor Summary

AccessConstructor and Description
public
ExtendsQueueEntry(MappingDocument sourceMappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jaxbSubEntityMappingback to summary
private final JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping
sourceMappingDocumentback to summary
private final MappingDocument sourceMappingDocument

Constructor Detail

ExtendsQueueEntryback to summary
public ExtendsQueueEntry(MappingDocument sourceMappingDocument, JaxbHbmSubclassEntityBaseDefinition jaxbSubEntityMapping)