Java Code Examples for org.hibernate.mapping.PersistentClass#addSubclass()

The following examples show how to use org.hibernate.mapping.PersistentClass#addSubclass() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: lams   File: ModelBinder.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void bindDiscriminatorSubclassEntities(
		AbstractEntitySourceImpl entitySource,
		PersistentClass superEntityDescriptor) {
	for ( IdentifiableTypeSource subType : entitySource.getSubTypes() ) {
		final SingleTableSubclass subEntityDescriptor = new SingleTableSubclass( superEntityDescriptor, metadataBuildingContext );
		bindDiscriminatorSubclassEntity( (SubclassEntitySourceImpl) subType, subEntityDescriptor );
		superEntityDescriptor.addSubclass( subEntityDescriptor );
		entitySource.getLocalMetadataBuildingContext().getMetadataCollector().addEntityBinding( subEntityDescriptor );
	}
}
 
Example 2
Source Project: lams   File: ModelBinder.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void bindJoinedSubclassEntities(
		AbstractEntitySourceImpl entitySource,
		PersistentClass superEntityDescriptor) {
	for ( IdentifiableTypeSource subType : entitySource.getSubTypes() ) {
		final JoinedSubclass subEntityDescriptor = new JoinedSubclass( superEntityDescriptor, metadataBuildingContext );
		bindJoinedSubclassEntity( (JoinedSubclassEntitySourceImpl) subType, subEntityDescriptor );
		superEntityDescriptor.addSubclass( subEntityDescriptor );
		entitySource.getLocalMetadataBuildingContext().getMetadataCollector().addEntityBinding( subEntityDescriptor );
	}
}
 
Example 3
Source Project: lams   File: ModelBinder.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void bindUnionSubclassEntities(
		EntitySource entitySource,
		PersistentClass superEntityDescriptor) {
	for ( IdentifiableTypeSource subType : entitySource.getSubTypes() ) {
		final UnionSubclass subEntityDescriptor = new UnionSubclass( superEntityDescriptor, metadataBuildingContext );
		bindUnionSubclassEntity( (SubclassEntitySourceImpl) subType, subEntityDescriptor );
		superEntityDescriptor.addSubclass( subEntityDescriptor );
		entitySource.getLocalMetadataBuildingContext().getMetadataCollector().addEntityBinding( subEntityDescriptor );
	}
}
 
Example 4
private static void handleUnionSubclass(PersistentClass model, Mappings mappings,
		Element subnode, java.util.Map inheritedMetas) throws MappingException {
	UnionSubclass subclass = new UnionSubclass( model );
	bindUnionSubclass( subnode, subclass, mappings, inheritedMetas );
	model.addSubclass( subclass );
	mappings.addClass( subclass );
}
 
Example 5
private static void handleJoinedSubclass(PersistentClass model, Mappings mappings,
		Element subnode, java.util.Map inheritedMetas) throws MappingException {
	JoinedSubclass subclass = new JoinedSubclass( model );
	bindJoinedSubclass( subnode, subclass, mappings, inheritedMetas );
	model.addSubclass( subclass );
	mappings.addClass( subclass );
}
 
Example 6
private static void handleSubclass(PersistentClass model, Mappings mappings, Element subnode,
		java.util.Map inheritedMetas) throws MappingException {
	Subclass subclass = new SingleTableSubclass( model );
	bindSubclass( subnode, subclass, mappings, inheritedMetas );
	model.addSubclass( subclass );
	mappings.addClass( subclass );
}