FileDocCategorySizeDatePackage
Subclass.javaAPI DocHibernate 3.2.56434Thu Jul 13 19:09:20 BST 2006org.hibernate.mapping

Subclass

public class Subclass extends PersistentClass
A sublass in a table-per-class-hierarchy mapping
author
Gavin King

Fields Summary
private PersistentClass
superclass
private Class
classPersisterClass
private final int
subclassId
Constructors Summary
public Subclass(PersistentClass superclass)

		this.superclass = superclass;
		this.subclassId = superclass.nextSubclassId();
	
Methods Summary
public java.lang.Objectaccept(PersistentClassVisitor mv)

		return mv.accept(this);
	
public voidaddJoin(Join j)

		super.addJoin(j);
		getSuperclass().addSubclassJoin(j);
	
public voidaddProperty(Property p)

		super.addProperty(p);
		getSuperclass().addSubclassProperty(p);
	
protected voidaddSubclassJoin(Join j)

		super.addSubclassJoin(j);
		getSuperclass().addSubclassJoin(j);
	
protected voidaddSubclassProperty(Property p)

		super.addSubclassProperty(p);
		getSuperclass().addSubclassProperty(p);
	
protected voidaddSubclassTable(Table table)

		super.addSubclassTable(table);
		getSuperclass().addSubclassTable(table);
	
public voidcreateForeignKey()

		if ( !isJoinedSubclass() ) {
			throw new AssertionFailure( "not a joined-subclass" );
		}
		getKey().createForeignKeyOfEntity( getSuperclass().getEntityName() );
	
public java.lang.StringgetCacheConcurrencyStrategy()

		return getSuperclass().getCacheConcurrencyStrategy();
	
public ValuegetDiscriminator()

		return getSuperclass().getDiscriminator();
	
public java.lang.ClassgetEntityPersisterClass()

		if (classPersisterClass==null) {
			return getSuperclass().getEntityPersisterClass();
		}
		else {
			return classPersisterClass;
		}
	
public java.util.MapgetFilterMap()

		return getSuperclass().getFilterMap();
	
public KeyValuegetIdentifier()

		return getSuperclass().getIdentifier();
	
public ComponentgetIdentifierMapper()

		return superclass.getIdentifierMapper();
	
public PropertygetIdentifierProperty()

		return getSuperclass().getIdentifierProperty();
	
public java.util.IteratorgetJoinClosureIterator()

		return new JoinedIterator(
			getSuperclass().getJoinClosureIterator(),
			super.getJoinClosureIterator()
		);
	
public intgetJoinClosureSpan()

		return getSuperclass().getJoinClosureSpan() + super.getJoinClosureSpan();
	
public KeyValuegetKey()

		return getSuperclass().getIdentifier();
	
public java.util.IteratorgetKeyClosureIterator()

		return new JoinedIterator(
				getSuperclass().getKeyClosureIterator(),
				new SingletonIterator( getKey() )
			);
	
public intgetOptimisticLockMode()

		return superclass.getOptimisticLockMode();
	
public java.util.IteratorgetPropertyClosureIterator()

		return new JoinedIterator(
				getSuperclass().getPropertyClosureIterator(),
				getPropertyIterator()
			);
	
public intgetPropertyClosureSpan()

		return getSuperclass().getPropertyClosureSpan() + super.getPropertyClosureSpan();
	
public RootClassgetRootClass()

		return getSuperclass().getRootClass();
	
public TablegetRootTable()

		return getSuperclass().getRootTable();
	
public intgetSubclassId()

		return subclassId;
	
public PersistentClassgetSuperclass()

		return superclass;
	
public java.util.SetgetSynchronizedTables()

		HashSet result = new HashSet();
		result.addAll(synchronizedTables);
		result.addAll( getSuperclass().getSynchronizedTables() );
		return result;
	
public TablegetTable()

		return getSuperclass().getTable();
	
public java.util.IteratorgetTableClosureIterator()

		return new JoinedIterator(
				getSuperclass().getTableClosureIterator(),
				new SingletonIterator( getTable() )
			);
	
public java.lang.StringgetTuplizerImplClassName(org.hibernate.EntityMode mode)

		String impl = super.getTuplizerImplClassName( mode );
		if ( impl == null ) {
			impl = getSuperclass().getTuplizerImplClassName( mode );
		}
		return impl;
	
public java.util.MapgetTuplizerMap()

		Map specificTuplizerDefs = super.getTuplizerMap();
		Map superclassTuplizerDefs = getSuperclass().getTuplizerMap();
		if ( specificTuplizerDefs == null && superclassTuplizerDefs == null ) {
			return null;
		}
		else {
			Map combined = new HashMap();
			if ( superclassTuplizerDefs != null ) {
				combined.putAll( superclassTuplizerDefs );
			}
			if ( specificTuplizerDefs != null ) {
				combined.putAll( specificTuplizerDefs );
			}
			return java.util.Collections.unmodifiableMap( combined );
		}
	
public PropertygetVersion()

		return getSuperclass().getVersion();
	
public java.lang.StringgetWhere()

		return getSuperclass().getWhere();
	
public booleanhasEmbeddedIdentifier()

		return getSuperclass().hasEmbeddedIdentifier();
	
public booleanhasIdentifierProperty()

		return getSuperclass().hasIdentifierProperty();
	
public booleanhasSubselectLoadableCollections()

		return super.hasSubselectLoadableCollections() || 
			getSuperclass().hasSubselectLoadableCollections();
	
public booleanisClassOrSuperclassJoin(Join join)

		return super.isClassOrSuperclassJoin(join) || getSuperclass().isClassOrSuperclassJoin(join);
	
public booleanisClassOrSuperclassTable(Table table)

		return super.isClassOrSuperclassTable(table) || getSuperclass().isClassOrSuperclassTable(table);
	
public booleanisDiscriminatorInsertable()

		return getSuperclass().isDiscriminatorInsertable();
	
public booleanisExplicitPolymorphism()

		return getSuperclass().isExplicitPolymorphism();
	
public booleanisForceDiscriminator()

		return getSuperclass().isForceDiscriminator();
	
public booleanisInherited()

		return true;
	
public booleanisJoinedSubclass()

		return getTable()!=getRootTable();
	
public booleanisLazyPropertiesCacheable()

		return getSuperclass().isLazyPropertiesCacheable();
	
public booleanisMutable()

		return getSuperclass().isMutable();
	
public booleanisPolymorphic()

		return true;
	
public booleanisVersioned()

		return getSuperclass().isVersioned();
	
intnextSubclassId()

		return getSuperclass().nextSubclassId();
	
public voidsetEntityPersisterClass(java.lang.Class classPersisterClass)

		this.classPersisterClass = classPersisterClass;
	
public voidsetSuperclass(PersistentClass superclass)

		this.superclass = superclass;