use of org.hibernate.boot.jaxb.hbm.spi.JaxbHbmJoinedSubclassEntityType in project hibernate-orm by hibernate.
the class EntityHierarchyBuilder method indexMappingDocument.
/**
* Called for each mapping document.
*
* @param mappingDocument The {@code hbm.xml} document to index
*/
public void indexMappingDocument(MappingDocument mappingDocument) {
log.tracef("Indexing mapping document [%s] for purpose of building entity hierarchy ordering", mappingDocument.getOrigin());
final JaxbHbmHibernateMapping mappingBinding = mappingDocument.getDocumentRoot();
// iterate all root class definitions at the hibernate-mapping level
for (JaxbHbmRootEntityType jaxbRootEntity : mappingBinding.getClazz()) {
// we can immediately handle <class/> elements in terms of creating the hierarchy entry
final RootEntitySourceImpl rootEntitySource = new RootEntitySourceImpl(mappingDocument, jaxbRootEntity);
entitySourceByNameMap.put(rootEntitySource.getEntityNamingSource().getEntityName(), rootEntitySource);
final EntityHierarchySourceImpl hierarchy = new EntityHierarchySourceImpl(rootEntitySource);
entityHierarchyList.add(hierarchy);
linkAnyWaiting(mappingDocument, rootEntitySource);
// process any of its nested sub-entity definitions
processRootEntitySubEntityElements(mappingDocument, jaxbRootEntity, rootEntitySource);
}
// iterate all discriminator-based subclass definitions at the hibernate-mapping level
for (JaxbHbmDiscriminatorSubclassEntityType discriminatorSubclassEntityBinding : mappingBinding.getSubclass()) {
processTopLevelSubClassBinding(mappingDocument, discriminatorSubclassEntityBinding);
}
// iterate all joined-subclass definitions at the hibernate-mapping level
for (JaxbHbmJoinedSubclassEntityType joinedSubclassEntityBinding : mappingBinding.getJoinedSubclass()) {
processTopLevelSubClassBinding(mappingDocument, joinedSubclassEntityBinding);
}
// iterate all union-subclass definitions at the hibernate-mapping level
for (JaxbHbmUnionSubclassEntityType unionSubclassEntityBinding : mappingBinding.getUnionSubclass()) {
processTopLevelSubClassBinding(mappingDocument, unionSubclassEntityBinding);
}
}
use of org.hibernate.boot.jaxb.hbm.spi.JaxbHbmJoinedSubclassEntityType in project hibernate-orm by hibernate.
the class EntityHierarchyBuilder method processSubEntityElements.
private void processSubEntityElements(MappingDocument mappingDocument, JaxbHbmEntityBaseDefinition entityBinding, AbstractEntitySourceImpl container) {
if (JaxbHbmDiscriminatorSubclassEntityType.class.isInstance(entityBinding)) {
final JaxbHbmDiscriminatorSubclassEntityType jaxbSubclass = (JaxbHbmDiscriminatorSubclassEntityType) entityBinding;
processElements(mappingDocument, jaxbSubclass.getSubclass(), container);
} else if (JaxbHbmJoinedSubclassEntityType.class.isInstance(entityBinding)) {
final JaxbHbmJoinedSubclassEntityType jaxbJoinedSubclass = (JaxbHbmJoinedSubclassEntityType) entityBinding;
processElements(mappingDocument, jaxbJoinedSubclass.getJoinedSubclass(), container);
} else if (JaxbHbmUnionSubclassEntityType.class.isInstance(entityBinding)) {
final JaxbHbmUnionSubclassEntityType jaxbUnionSubclass = (JaxbHbmUnionSubclassEntityType) entityBinding;
processElements(mappingDocument, jaxbUnionSubclass.getUnionSubclass(), container);
}
}
Aggregations