org.hibernate.mapping

Class PersistentClass

Implemented Interfaces:
Serializable, Filterable, MetaAttributable
Known Direct Subclasses:
RootClass, Subclass

public abstract class PersistentClass
extends java.lang.Object
implements Serializable, Filterable, MetaAttributable

Mapping for an entity.
Author:
Gavin King

Field Summary

static String
NOT_NULL_DISCRIMINATOR_MAPPING
static String
NULL_DISCRIMINATOR_MAPPING
protected int
optimisticLockMode
protected Set
synchronizedTables

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()
ExecuteUpdateResultCheckStyle
getCustomSQLDeleteCheckStyle()
String
getCustomSQLInsert()
ExecuteUpdateResultCheckStyle
getCustomSQLInsertCheckStyle()
String
getCustomSQLUpdate()
ExecuteUpdateResultCheckStyle
getCustomSQLUpdateCheckStyle()
Iterator
getDirectSubclasses()
abstract Value
getDiscriminator()
protected Iterator
getDiscriminatorColumnIterator()
String
getDiscriminatorValue()
String
getEntityName()
abstract Class
getEntityPersisterClass()
java.util.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)
java.util.Map
getMetaAttributes()
String
getNodeName()
protected Iterator
getNonDuplicatedPropertyIterator()
abstract int
getOptimisticLockMode()
Property
getProperty(String propertyName)
abstract Iterator
getPropertyClosureIterator()
int
getPropertyClosureSpan()
Iterator
getPropertyIterator()
Build an iterator over the properties defined on this class.
Class
getProxyInterface()
String
getProxyInterfaceName()
Property
getRecursiveProperty(String propertyPath)
Iterator
getReferenceablePropertyIterator()
Build an iterator of properties which are "referenceable".
Property
getReferencedProperty(String propertyPath)
Given a property path, locate the appropriate referenceable property reference.
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)
java.util.Map
getTuplizerMap()
Iterator
getUnjoinedPropertyIterator()
Build an iterator over the properties defined on this class which are not defined as part of a join.
abstract Property
getVersion()
abstract String
getWhere()
boolean
hasDom4jRepresentation()
abstract boolean
hasEmbeddedIdentifier()
boolean
hasIdentifierMapper()
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, ExecuteUpdateResultCheckStyle checkStyle)
void
setCustomSQLInsert(String customSQLInsert, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
void
setCustomSQLUpdate(String customSQLUpdate, boolean callable, ExecuteUpdateResultCheckStyle checkStyle)
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(java.util.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)

Field Details

NOT_NULL_DISCRIMINATOR_MAPPING

public static final String NOT_NULL_DISCRIMINATOR_MAPPING

NULL_DISCRIMINATOR_MAPPING

public static final String NULL_DISCRIMINATOR_MAPPING

optimisticLockMode

protected int optimisticLockMode

synchronizedTables

protected final Set synchronizedTables

Method Details

accept

public abstract Object accept(PersistentClassVisitor mv)

addFilter

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

addJoin

public void addJoin(Join join)

addProperty

public void addProperty(Property p)

addSubclass

public void addSubclass(Subclass subclass)
            throws MappingException

addSubclassJoin

protected void addSubclassJoin(Join join)

addSubclassProperty

protected void addSubclassProperty(Property prop)

addSubclassTable

protected void addSubclassTable(Table subclassTable)

addSynchronizedTable

public void addSynchronizedTable(String table)

addTuplizer

public void addTuplizer(EntityMode entityMode,
                        String implClassName)

checkColumnDuplication

protected void checkColumnDuplication()

checkColumnDuplication

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

checkPropertyColumnDuplication

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

createPrimaryKey

public void createPrimaryKey()

getBatchSize

public int getBatchSize()

getCacheConcurrencyStrategy

public abstract String getCacheConcurrencyStrategy()

getClassName

public String getClassName()

getCustomSQLDelete

public String getCustomSQLDelete()

getCustomSQLDeleteCheckStyle

public ExecuteUpdateResultCheckStyle getCustomSQLDeleteCheckStyle()

getCustomSQLInsert

public String getCustomSQLInsert()

getCustomSQLInsertCheckStyle

public ExecuteUpdateResultCheckStyle getCustomSQLInsertCheckStyle()

getCustomSQLUpdate

public String getCustomSQLUpdate()

getCustomSQLUpdateCheckStyle

public ExecuteUpdateResultCheckStyle getCustomSQLUpdateCheckStyle()

getDirectSubclasses

public Iterator getDirectSubclasses()

getDiscriminator

public abstract Value getDiscriminator()

getDiscriminatorColumnIterator

protected Iterator getDiscriminatorColumnIterator()

getDiscriminatorValue

public String getDiscriminatorValue()

getEntityName

public String getEntityName()

getEntityPersisterClass

public abstract Class getEntityPersisterClass()

getFilterMap

public java.util.Map getFilterMap()
Specified by:
getFilterMap in interface Filterable

getIdentifier

public abstract KeyValue getIdentifier()

getIdentifierMapper

public Component getIdentifierMapper()

getIdentifierProperty

public abstract Property getIdentifierProperty()

getIdentityTable

public Table getIdentityTable()

getJoinClosureIterator

public Iterator getJoinClosureIterator()

getJoinClosureSpan

public int getJoinClosureSpan()

getJoinIterator

public Iterator getJoinIterator()

getJoinNumber

public int getJoinNumber(Property prop)

getKey

public abstract KeyValue getKey()

getKeyClosureIterator

public abstract Iterator getKeyClosureIterator()

getLoaderName

public String getLoaderName()

getMappedClass

public Class getMappedClass()
            throws MappingException

getMetaAttribute

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

getMetaAttributes

public java.util.Map getMetaAttributes()
Specified by:
getMetaAttributes in interface MetaAttributable

getNodeName

public String getNodeName()

getNonDuplicatedPropertyIterator

protected Iterator getNonDuplicatedPropertyIterator()

getOptimisticLockMode

public abstract int getOptimisticLockMode()

getProperty

public Property getProperty(String propertyName)
            throws MappingException

getPropertyClosureIterator

public abstract Iterator getPropertyClosureIterator()

getPropertyClosureSpan

public int getPropertyClosureSpan()

getPropertyIterator

public Iterator getPropertyIterator()
Returns:
An iterator over the "normal" properties.

getProxyInterface

public Class getProxyInterface()

getProxyInterfaceName

public String getProxyInterfaceName()

getRecursiveProperty

public Property getRecursiveProperty(String propertyPath)
            throws MappingException

getReferenceablePropertyIterator

public Iterator getReferenceablePropertyIterator()
Build an iterator of properties which are "referenceable".
Returns:
The property iterator.

getReferencedProperty

public Property getReferencedProperty(String propertyPath)
            throws MappingException
Given a property path, locate the appropriate referenceable property reference.

A referenceable property is a property which can be a target of a foreign-key mapping (an identifier or explcitly named in a property-ref).

Parameters:
propertyPath - The property path to resolve into a property reference.
Returns:
The property reference (never null).
Throws:
MappingException - If the property could not be found.

getRootClass

public abstract RootClass getRootClass()

getRootTable

public abstract Table getRootTable()

getSubclassClosureIterator

public Iterator getSubclassClosureIterator()

getSubclassId

public abstract int getSubclassId()

getSubclassIterator

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

getSubclassJoinClosureIterator

public Iterator getSubclassJoinClosureIterator()

getSubclassPropertyClosureIterator

public Iterator getSubclassPropertyClosureIterator()

getSubclassSpan

public int getSubclassSpan()

getSubclassTableClosureIterator

public Iterator getSubclassTableClosureIterator()

getSuperclass

public abstract PersistentClass getSuperclass()

getSynchronizedTables

public abstract Set getSynchronizedTables()

getTable

public abstract Table getTable()

getTableClosureIterator

public abstract Iterator getTableClosureIterator()

getTemporaryIdTableDDL

public String getTemporaryIdTableDDL()

getTemporaryIdTableName

public String getTemporaryIdTableName()

getTuplizerImplClassName

public String getTuplizerImplClassName(EntityMode mode)

getTuplizerMap

public java.util.Map getTuplizerMap()

getUnjoinedPropertyIterator

public Iterator getUnjoinedPropertyIterator()
Returns:
An iterator over the non-joined "normal" properties.

getVersion

public abstract Property getVersion()

getWhere

public abstract String getWhere()

hasDom4jRepresentation

public boolean hasDom4jRepresentation()

hasEmbeddedIdentifier

public abstract boolean hasEmbeddedIdentifier()

hasIdentifierMapper

public boolean hasIdentifierMapper()

hasIdentifierProperty

public abstract boolean hasIdentifierProperty()

hasNaturalId

public boolean hasNaturalId()

hasPojoRepresentation

public boolean hasPojoRepresentation()

hasSelectBeforeUpdate

public boolean hasSelectBeforeUpdate()

hasSubclasses

public boolean hasSubclasses()

hasSubselectLoadableCollections

public boolean hasSubselectLoadableCollections()

isAbstract

public Boolean isAbstract()

isClassOrSuperclassJoin

public boolean isClassOrSuperclassJoin(Join join)

isClassOrSuperclassTable

public boolean isClassOrSuperclassTable(Table closureTable)

isCustomDeleteCallable

public boolean isCustomDeleteCallable()

isCustomInsertCallable

public boolean isCustomInsertCallable()

isCustomUpdateCallable

public boolean isCustomUpdateCallable()

isDiscriminatorInsertable

public abstract boolean isDiscriminatorInsertable()

isDiscriminatorValueNotNull

public boolean isDiscriminatorValueNotNull()

isDiscriminatorValueNull

public boolean isDiscriminatorValueNull()

isExplicitPolymorphism

public abstract boolean isExplicitPolymorphism()

isForceDiscriminator

public boolean isForceDiscriminator()

isInherited

public abstract boolean isInherited()

isJoinedSubclass

public abstract boolean isJoinedSubclass()

isLazy

public boolean isLazy()

isLazyPropertiesCacheable

public abstract boolean isLazyPropertiesCacheable()

isMutable

public abstract boolean isMutable()

isPolymorphic

public abstract boolean isPolymorphic()

isVersioned

public abstract boolean isVersioned()

prepareTemporaryTables

public void prepareTemporaryTables(Mapping mapping,
                                   Dialect dialect)

setAbstract

public void setAbstract(Boolean isAbstract)

setBatchSize

public void setBatchSize(int batchSize)

setClassName

public void setClassName(String className)

setCustomSQLDelete

public void setCustomSQLDelete(String customSQLDelete,
                               boolean callable,
                               ExecuteUpdateResultCheckStyle checkStyle)

setCustomSQLInsert

public void setCustomSQLInsert(String customSQLInsert,
                               boolean callable,
                               ExecuteUpdateResultCheckStyle checkStyle)

setCustomSQLUpdate

public void setCustomSQLUpdate(String customSQLUpdate,
                               boolean callable,
                               ExecuteUpdateResultCheckStyle checkStyle)

setDiscriminatorValue

public void setDiscriminatorValue(String discriminatorValue)

setDynamicInsert

public void setDynamicInsert(boolean dynamicInsert)

setDynamicUpdate

public void setDynamicUpdate(boolean dynamicUpdate)

setEntityName

public void setEntityName(String entityName)

setEntityPersisterClass

public abstract void setEntityPersisterClass(Class classPersisterClass)

setIdentifierMapper

public void setIdentifierMapper(Component handle)

setLazy

public void setLazy(boolean lazy)

setLoaderName

public void setLoaderName(String loaderName)

setMetaAttributes

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

setNodeName

public void setNodeName(String nodeName)

setOptimisticLockMode

public void setOptimisticLockMode(int optimisticLockMode)

setProxyInterfaceName

public void setProxyInterfaceName(String proxyInterfaceName)

setSelectBeforeUpdate

public void setSelectBeforeUpdate(boolean selectBeforeUpdate)

setSubselectLoadableCollections

public void setSubselectLoadableCollections(boolean hasSubselectCollections)

toString

public String toString()

useDynamicInsert

public boolean useDynamicInsert()

useDynamicUpdate

public boolean useDynamicUpdate()

validate

public void validate(Mapping mapping)
            throws MappingException