org.hibernate.mapping
Class PersistentClass

java.lang.Object
  extended byorg.hibernate.mapping.PersistentClass
All Implemented Interfaces:
Filterable, MetaAttributable, Serializable
Direct Known Subclasses:
RootClass, Subclass

public abstract class PersistentClass
extends Object
implements Serializable, Filterable, MetaAttributable

Mapping for an entity.

Author:
Gavin King
See Also:
Serialized Form

Field Summary
static String NOT_NULL_DISCRIMINATOR_MAPPING
           
static String NULL_DISCRIMINATOR_MAPPING
           
protected  int optimisticLockMode
           
protected  Set synchronizedTables
           
 
Constructor Summary
PersistentClass()
           
 
Method Summary
abstract  Object accept(PersistentClassVisitor mv)
           
 void addFilter(String name, String condition)
           
 void addJoin(Join join)
           
 void addProperty(Property p)
           
 void addSubclass(Subclass subclass)
           
protected  void addSubclassJoin(Join join)
           
protected  void addSubclassProperty(Property prop)
           
protected  void addSubclassTable(Table subclassTable)
           
 void addSynchronizedTable(String table)
           
 void addTuplizer(EntityMode entityMode, String implClassName)
           
protected  void checkColumnDuplication()
           
protected  void checkColumnDuplication(Set distinctColumns, Iterator columns)
           
protected  void checkPropertyColumnDuplication(Set distinctColumns, Iterator properties)
           
 void createPrimaryKey()
           
 int getBatchSize()
           
abstract  String getCacheConcurrencyStrategy()
           
 String getClassName()
           
 String getCustomSQLDelete()
           
 String getCustomSQLInsert()
           
 String getCustomSQLUpdate()
           
 Iterator getDirectSubclasses()
           
abstract  Value getDiscriminator()
           
protected  Iterator getDiscriminatorColumnIterator()
           
 String getDiscriminatorValue()
           
 String getEntityName()
           
abstract  Class getEntityPersisterClass()
           
 Map getFilterMap()
           
abstract  KeyValue getIdentifier()
           
 Component getIdentifierMapper()
           
abstract  Property getIdentifierProperty()
           
 Table getIdentityTable()
           
 Iterator getJoinClosureIterator()
           
 int getJoinClosureSpan()
           
 Iterator getJoinIterator()
           
 int getJoinNumber(Property prop)
           
abstract  KeyValue getKey()
           
abstract  Iterator getKeyClosureIterator()
           
 String getLoaderName()
           
 Class getMappedClass()
           
 MetaAttribute getMetaAttribute(String name)
           
 Map getMetaAttributes()
           
 String getNodeName()
           
protected  Iterator getNonDuplicatedPropertyIterator()
           
abstract  int getOptimisticLockMode()
           
 Property getProperty(String propertyName)
           
abstract  Iterator getPropertyClosureIterator()
           
 int getPropertyClosureSpan()
           
 Iterator getPropertyIterator()
           
 Class getProxyInterface()
           
 String getProxyInterfaceName()
           
 Property getRecursiveProperty(String propertyPath)
           
 Iterator getReferenceablePropertyIterator()
           
 Property getReferencedProperty(String propertyPath)
           
abstract  RootClass getRootClass()
           
abstract  Table getRootTable()
           
 Iterator getSubclassClosureIterator()
           
abstract  int getSubclassId()
           
 Iterator getSubclassIterator()
          Iterate over subclasses in a special 'order', most derived subclasses first.
 Iterator getSubclassJoinClosureIterator()
           
 Iterator getSubclassPropertyClosureIterator()
           
 int getSubclassSpan()
           
 Iterator getSubclassTableClosureIterator()
           
abstract  PersistentClass getSuperclass()
           
abstract  Set getSynchronizedTables()
           
abstract  Table getTable()
           
abstract  Iterator getTableClosureIterator()
           
 String getTemporaryIdTableDDL()
           
 String getTemporaryIdTableName()
           
 String getTuplizerImplClassName(EntityMode mode)
           
 Iterator getUnjoinedPropertyIterator()
           
abstract  Property getVersion()
           
abstract  String getWhere()
           
 boolean hasDom4jRepresentation()
           
abstract  boolean hasEmbeddedIdentifier()
           
abstract  boolean hasIdentifierProperty()
           
 boolean hasNaturalId()
           
 boolean hasPojoRepresentation()
           
 boolean hasSelectBeforeUpdate()
           
 boolean hasSubclasses()
           
 boolean hasSubselectLoadableCollections()
           
 Boolean isAbstract()
           
 boolean isClassOrSuperclassJoin(Join join)
           
 boolean isClassOrSuperclassTable(Table closureTable)
           
 boolean isCustomDeleteCallable()
           
 boolean isCustomInsertCallable()
           
 boolean isCustomUpdateCallable()
           
abstract  boolean isDiscriminatorInsertable()
           
 boolean isDiscriminatorValueNotNull()
           
 boolean isDiscriminatorValueNull()
           
abstract  boolean isExplicitPolymorphism()
           
 boolean isForceDiscriminator()
           
abstract  boolean isInherited()
           
abstract  boolean isJoinedSubclass()
           
 boolean isLazy()
           
abstract  boolean isLazyPropertiesCacheable()
           
abstract  boolean isMutable()
           
abstract  boolean isPolymorphic()
           
abstract  boolean isVersioned()
           
 void prepareTemporaryTables(Mapping mapping, Dialect dialect)
           
 void setAbstract(Boolean isAbstract)
           
 void setBatchSize(int batchSize)
           
 void setClassName(String className)
           
 void setCustomSQLDelete(String customSQLDelete, boolean callable)
           
 void setCustomSQLInsert(String customSQLInsert, boolean callable)
           
 void setCustomSQLUpdate(String customSQLUpdate, boolean callable)
           
 void setDiscriminatorValue(String discriminatorValue)
           
 void setDynamicInsert(boolean dynamicInsert)
           
 void setDynamicUpdate(boolean dynamicUpdate)
           
 void setEntityName(String entityName)
           
abstract  void setEntityPersisterClass(Class classPersisterClass)
           
 void setIdentifierMapper(Component handle)
           
 void setLazy(boolean lazy)
           
 void setLoaderName(String loaderName)
           
 void setMetaAttributes(Map metas)
           
 void setNodeName(String nodeName)
           
 void setOptimisticLockMode(int optimisticLockMode)
           
 void setProxyInterfaceName(String proxyInterfaceName)
           
 void setSelectBeforeUpdate(boolean selectBeforeUpdate)
           
 void setSubselectLoadableCollections(boolean hasSubselectCollections)
           
 String toString()
           
 boolean useDynamicInsert()
           
 boolean useDynamicUpdate()
           
 void validate(Mapping mapping)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_DISCRIMINATOR_MAPPING

public static final String NULL_DISCRIMINATOR_MAPPING
See Also:
Constant Field Values

NOT_NULL_DISCRIMINATOR_MAPPING

public static final String NOT_NULL_DISCRIMINATOR_MAPPING
See Also:
Constant Field Values

synchronizedTables

protected final Set synchronizedTables

optimisticLockMode

protected int optimisticLockMode
Constructor Detail

PersistentClass

public PersistentClass()
Method Detail

getClassName

public String getClassName()

setClassName

public void setClassName(String className)

getProxyInterfaceName

public String getProxyInterfaceName()

setProxyInterfaceName

public void setProxyInterfaceName(String proxyInterfaceName)

getMappedClass

public Class getMappedClass()
                     throws MappingException
Throws:
MappingException

getProxyInterface

public Class getProxyInterface()

useDynamicInsert

public boolean useDynamicInsert()

getSubclassId

public abstract int getSubclassId()

useDynamicUpdate

public boolean useDynamicUpdate()

setDynamicInsert

public void setDynamicInsert(boolean dynamicInsert)

setDynamicUpdate

public void setDynamicUpdate(boolean dynamicUpdate)

getDiscriminatorValue

public String getDiscriminatorValue()

addSubclass

public void addSubclass(Subclass subclass)
                 throws MappingException
Throws:
MappingException

hasSubclasses

public boolean hasSubclasses()

getSubclassSpan

public int getSubclassSpan()

getSubclassIterator

public Iterator getSubclassIterator()
Iterate over subclasses in a special 'order', most derived subclasses first.


getSubclassClosureIterator

public Iterator getSubclassClosureIterator()

getIdentityTable

public Table getIdentityTable()

getDirectSubclasses

public Iterator getDirectSubclasses()

addProperty

public void addProperty(Property p)

getTable

public abstract Table getTable()

getEntityName

public String getEntityName()

isMutable

public abstract boolean isMutable()

hasIdentifierProperty

public abstract boolean hasIdentifierProperty()

getIdentifierProperty

public abstract Property getIdentifierProperty()

getIdentifier

public abstract KeyValue getIdentifier()

getVersion

public abstract Property getVersion()

getDiscriminator

public abstract Value getDiscriminator()

isInherited

public abstract boolean isInherited()

isPolymorphic

public abstract boolean isPolymorphic()

isVersioned

public abstract boolean isVersioned()

getCacheConcurrencyStrategy

public abstract String getCacheConcurrencyStrategy()

getSuperclass

public abstract PersistentClass getSuperclass()

isExplicitPolymorphism

public abstract boolean isExplicitPolymorphism()

isDiscriminatorInsertable

public abstract boolean isDiscriminatorInsertable()

getPropertyClosureIterator

public abstract Iterator getPropertyClosureIterator()

getTableClosureIterator

public abstract Iterator getTableClosureIterator()

getKeyClosureIterator

public abstract Iterator getKeyClosureIterator()

addSubclassProperty

protected void addSubclassProperty(Property prop)

addSubclassJoin

protected void addSubclassJoin(Join join)

addSubclassTable

protected void addSubclassTable(Table subclassTable)

getSubclassPropertyClosureIterator

public Iterator getSubclassPropertyClosureIterator()

getSubclassJoinClosureIterator

public Iterator getSubclassJoinClosureIterator()

getSubclassTableClosureIterator

public Iterator getSubclassTableClosureIterator()

isClassOrSuperclassJoin

public boolean isClassOrSuperclassJoin(Join join)

isClassOrSuperclassTable

public boolean isClassOrSuperclassTable(Table closureTable)

isLazy

public boolean isLazy()

setLazy

public void setLazy(boolean lazy)

hasEmbeddedIdentifier

public abstract boolean hasEmbeddedIdentifier()

getEntityPersisterClass

public abstract Class getEntityPersisterClass()

setEntityPersisterClass

public abstract void setEntityPersisterClass(Class classPersisterClass)

getRootTable

public abstract Table getRootTable()

getRootClass

public abstract RootClass getRootClass()

getKey

public abstract KeyValue getKey()

setDiscriminatorValue

public void setDiscriminatorValue(String discriminatorValue)

setEntityName

public void setEntityName(String entityName)

createPrimaryKey

public void createPrimaryKey()

getWhere

public abstract String getWhere()

getBatchSize

public int getBatchSize()

setBatchSize

public void setBatchSize(int batchSize)

hasSelectBeforeUpdate

public boolean hasSelectBeforeUpdate()

setSelectBeforeUpdate

public void setSelectBeforeUpdate(boolean selectBeforeUpdate)

getReferenceablePropertyIterator

public Iterator getReferenceablePropertyIterator()

getReferencedProperty

public Property getReferencedProperty(String propertyPath)
                               throws MappingException
Throws:
MappingException

getRecursiveProperty

public Property getRecursiveProperty(String propertyPath)
                              throws MappingException
Throws:
MappingException

getProperty

public Property getProperty(String propertyName)
                     throws MappingException
Throws:
MappingException

getOptimisticLockMode

public abstract int getOptimisticLockMode()

setOptimisticLockMode

public void setOptimisticLockMode(int optimisticLockMode)

validate

public void validate(Mapping mapping)
              throws MappingException
Throws:
MappingException

isDiscriminatorValueNotNull

public boolean isDiscriminatorValueNotNull()

isDiscriminatorValueNull

public boolean isDiscriminatorValueNull()

getMetaAttributes

public Map getMetaAttributes()
Specified by:
getMetaAttributes in interface MetaAttributable

setMetaAttributes

public void setMetaAttributes(Map metas)
Specified by:
setMetaAttributes in interface MetaAttributable

getMetaAttribute

public MetaAttribute getMetaAttribute(String name)
Specified by:
getMetaAttribute in interface MetaAttributable

toString

public String toString()

getJoinIterator

public Iterator getJoinIterator()

getJoinClosureIterator

public Iterator getJoinClosureIterator()

addJoin

public void addJoin(Join join)

getJoinClosureSpan

public int getJoinClosureSpan()

getPropertyClosureSpan

public int getPropertyClosureSpan()

getJoinNumber

public int getJoinNumber(Property prop)

getPropertyIterator

public Iterator getPropertyIterator()

getUnjoinedPropertyIterator

public Iterator getUnjoinedPropertyIterator()

setCustomSQLInsert

public void setCustomSQLInsert(String customSQLInsert,
                               boolean callable)

getCustomSQLInsert

public String getCustomSQLInsert()

isCustomInsertCallable

public boolean isCustomInsertCallable()

setCustomSQLUpdate

public void setCustomSQLUpdate(String customSQLUpdate,
                               boolean callable)

getCustomSQLUpdate

public String getCustomSQLUpdate()

isCustomUpdateCallable

public boolean isCustomUpdateCallable()

setCustomSQLDelete

public void setCustomSQLDelete(String customSQLDelete,
                               boolean callable)

getCustomSQLDelete

public String getCustomSQLDelete()

isCustomDeleteCallable

public boolean isCustomDeleteCallable()

addFilter

public void addFilter(String name,
                      String condition)
Specified by:
addFilter in interface Filterable

getFilterMap

public Map getFilterMap()
Specified by:
getFilterMap in interface Filterable

isForceDiscriminator

public boolean isForceDiscriminator()

isJoinedSubclass

public abstract boolean isJoinedSubclass()

getLoaderName

public String getLoaderName()

setLoaderName

public void setLoaderName(String loaderName)

getSynchronizedTables

public abstract Set getSynchronizedTables()

addSynchronizedTable

public void addSynchronizedTable(String table)

isAbstract

public Boolean isAbstract()

setAbstract

public void setAbstract(Boolean isAbstract)

checkColumnDuplication

protected void checkColumnDuplication(Set distinctColumns,
                                      Iterator columns)
                               throws MappingException
Throws:
MappingException

checkPropertyColumnDuplication

protected void checkPropertyColumnDuplication(Set distinctColumns,
                                              Iterator properties)
                                       throws MappingException
Throws:
MappingException

getNonDuplicatedPropertyIterator

protected Iterator getNonDuplicatedPropertyIterator()

getDiscriminatorColumnIterator

protected Iterator getDiscriminatorColumnIterator()

checkColumnDuplication

protected void checkColumnDuplication()

accept

public abstract Object accept(PersistentClassVisitor mv)

getNodeName

public String getNodeName()

setNodeName

public void setNodeName(String nodeName)

hasPojoRepresentation

public boolean hasPojoRepresentation()

hasDom4jRepresentation

public boolean hasDom4jRepresentation()

hasSubselectLoadableCollections

public boolean hasSubselectLoadableCollections()

setSubselectLoadableCollections

public void setSubselectLoadableCollections(boolean hasSubselectCollections)

prepareTemporaryTables

public void prepareTemporaryTables(Mapping mapping,
                                   Dialect dialect)

getTemporaryIdTableName

public String getTemporaryIdTableName()

getTemporaryIdTableDDL

public String getTemporaryIdTableDDL()

getIdentifierMapper

public Component getIdentifierMapper()

setIdentifierMapper

public void setIdentifierMapper(Component handle)

addTuplizer

public void addTuplizer(EntityMode entityMode,
                        String implClassName)

getTuplizerImplClassName

public String getTuplizerImplClassName(EntityMode mode)

hasNaturalId

public boolean hasNaturalId()

isLazyPropertiesCacheable

public abstract boolean isLazyPropertiesCacheable()