org.hibernate.metamodel.binding
Class EntityBinding
java.lang.Object
org.hibernate.metamodel.binding.EntityBinding
- All Implemented Interfaces:
- AttributeBindingContainer
public class EntityBinding
- extends Object
- implements AttributeBindingContainer
Provides the link between the domain and the relational model for an entity.
Constructor Summary |
EntityBinding(EntityBinding superEntityBinding)
Used to instantiate the EntityBinding for an entity that is a subclass (sub-entity) in an inheritance hierarchy |
EntityBinding(InheritanceType inheritanceType,
EntityMode entityMode)
Used to instantiate the EntityBinding for an entity that is the root of an inheritance hierarchy |
Method Summary |
void |
addFilterDefinition(FilterDefinition filterDefinition)
|
void |
addSecondaryTable(String tableName,
TableSpecification table)
|
void |
addSynchronizedTableNames(Collection<String> synchronizedTableNames)
|
Iterable<AttributeBinding> |
attributeBindings()
Obtain all attribute bindings |
Iterable<AttributeBinding> |
getAttributeBindingClosure()
Gets the attribute bindings defined on this class, including the
identifier attribute binding and attribute bindings defined
as part of a join. |
int |
getAttributeBindingClosureSpan()
Gets the number of attribute bindings defined on this class, including the
identifier attribute binding and attribute bindings defined
as part of a join. |
AttributeContainer |
getAttributeContainer()
Obtain the underlying domain attribute container. |
int |
getBatchSize()
|
Class<?> |
getClassReference()
Obtain the Class reference for this attribute container. |
CustomSQL |
getCustomDelete()
|
Class<? extends EntityPersister> |
getCustomEntityPersisterClass()
|
Class<? extends EntityTuplizer> |
getCustomEntityTuplizerClass()
|
CustomSQL |
getCustomInsert()
|
String |
getCustomLoaderName()
|
CustomSQL |
getCustomUpdate()
|
Iterable<EntityBinding> |
getDirectSubEntityBindings()
|
String |
getDiscriminatorMatchValue()
|
Entity |
getEntity()
|
Iterable<SingularAssociationAttributeBinding> |
getEntityReferencingAttributeBindings()
|
Iterable<FilterDefinition> |
getFilterDefinitions()
|
HierarchyDetails |
getHierarchyDetails()
|
Iterable<JpaCallbackClass> |
getJpaCallbackClasses()
|
String |
getJpaEntityName()
|
MetaAttributeContext |
getMetaAttributeContext()
Obtain the meta-attribute context for this container. |
String |
getPathBase()
Obtain the path base of this container. |
Iterable<EntityBinding> |
getPostOrderSubEntityBindingClosure()
Returns sub-EntityBinding objects in a special 'order', most derived subclasses
first. |
Iterable<EntityBinding> |
getPreOrderSubEntityBindingClosure()
Returns sub-EntityBinding ordered as a depth-first,
pre-order traversal (a subclass precedes its own subclasses). |
TableSpecification |
getPrimaryTable()
|
String |
getPrimaryTableName()
|
Value<Class<?>> |
getProxyInterfaceType()
|
String |
getRowId()
|
Iterable<AttributeBinding> |
getSubEntityAttributeBindingClosure()
Gets the attribute bindings for this EntityBinding and all of its
sub-EntityBinding, starting from the root of the hierarchy; includes
the identifier and attribute bindings defined as part of a join. |
int |
getSubEntityBindingClosureSpan()
|
EntityBinding |
getSuperEntityBinding()
|
Set<String> |
getSynchronizedTableNames()
|
String |
getWhereFilter()
|
boolean |
hasSubEntityBindings()
|
boolean |
hasSubselectLoadableCollections()
|
Boolean |
isAbstract()
|
boolean |
isDiscriminatorMatchValueNotNull()
|
boolean |
isDiscriminatorMatchValueNull()
|
boolean |
isDynamicInsert()
|
boolean |
isDynamicUpdate()
|
boolean |
isLazy()
|
boolean |
isMutable()
|
boolean |
isPolymorphic()
|
boolean |
isRoot()
|
boolean |
isSelectBeforeUpdate()
|
boolean |
isVersioned()
|
AttributeBinding |
locateAttributeBinding(String name)
Locate a specific attribute binding, by its local name. |
TableSpecification |
locateTable(String tableName)
|
BagBinding |
makeBagAttributeBinding(PluralAttribute attribute,
CollectionElementNature nature)
Factory method for bag attribute bindings. |
BasicAttributeBinding |
makeBasicAttributeBinding(SingularAttribute attribute)
Factory method for basic attribute bindings. |
ComponentAttributeBinding |
makeComponentAttributeBinding(SingularAttribute attribute)
Factory method for component attribute bindings. |
ManyToOneAttributeBinding |
makeManyToOneAttributeBinding(SingularAttribute attribute)
Factory method for many-to-one attribute bindings. |
SetBinding |
makeSetAttributeBinding(PluralAttribute attribute,
CollectionElementNature nature)
Factory method for bag attribute bindings. |
protected void |
registerAttributeBinding(String name,
AttributeBinding attributeBinding)
|
EntityBinding |
seekEntityBinding()
Seeks out the entity binding that is the root of this component path. |
void |
setAbstract(Boolean isAbstract)
|
void |
setBatchSize(int batchSize)
|
void |
setCustomDelete(CustomSQL customDelete)
|
void |
setCustomEntityPersisterClass(Class<? extends EntityPersister> customEntityPersisterClass)
|
void |
setCustomEntityTuplizerClass(Class<? extends EntityTuplizer> customEntityTuplizerClass)
|
void |
setCustomInsert(CustomSQL customInsert)
|
void |
setCustomLoaderName(String customLoaderName)
|
void |
setCustomUpdate(CustomSQL customUpdate)
|
void |
setDiscriminatorMatchValue(String discriminatorMatchValue)
|
void |
setDynamicInsert(boolean dynamicInsert)
|
void |
setDynamicUpdate(boolean dynamicUpdate)
|
void |
setEntity(Entity entity)
|
void |
setJpaCallbackClasses(List<JpaCallbackClass> jpaCallbackClasses)
|
void |
setJpaEntityName(String jpaEntityName)
|
void |
setLazy(boolean lazy)
|
void |
setMetaAttributeContext(MetaAttributeContext metaAttributeContext)
|
void |
setMutable(boolean mutable)
|
void |
setPrimaryTable(TableSpecification primaryTable)
|
void |
setPrimaryTableName(String primaryTableName)
|
void |
setProxyInterfaceType(Value<Class<?>> proxyInterfaceType)
|
void |
setRowId(String rowId)
|
void |
setSelectBeforeUpdate(boolean selectBeforeUpdate)
|
void |
setWhereFilter(String whereFilter)
|
String |
toString()
|
EntityBinding
public EntityBinding(InheritanceType inheritanceType,
EntityMode entityMode)
- Used to instantiate the EntityBinding for an entity that is the root of an inheritance hierarchy
- Parameters:
inheritanceType
- The inheritance type for the hierarchyentityMode
- The entity mode used in this hierarchy.
EntityBinding
public EntityBinding(EntityBinding superEntityBinding)
- Used to instantiate the EntityBinding for an entity that is a subclass (sub-entity) in an inheritance hierarchy
- Parameters:
superEntityBinding
- The entity binding of this binding's super
getHierarchyDetails
public HierarchyDetails getHierarchyDetails()
getSuperEntityBinding
public EntityBinding getSuperEntityBinding()
isRoot
public boolean isRoot()
isPolymorphic
public boolean isPolymorphic()
hasSubEntityBindings
public boolean hasSubEntityBindings()
getSubEntityBindingClosureSpan
public int getSubEntityBindingClosureSpan()
getDirectSubEntityBindings
public Iterable<EntityBinding> getDirectSubEntityBindings()
getPostOrderSubEntityBindingClosure
public Iterable<EntityBinding> getPostOrderSubEntityBindingClosure()
- Returns sub-EntityBinding objects in a special 'order', most derived subclasses
first. Specifically, the sub-entity bindings follow a depth-first,
post-order traversal
Note that the returned value excludes this entity binding.
- Returns:
- sub-entity bindings ordered by those entity bindings that are most derived.
getPreOrderSubEntityBindingClosure
public Iterable<EntityBinding> getPreOrderSubEntityBindingClosure()
- Returns sub-EntityBinding ordered as a depth-first,
pre-order traversal (a subclass precedes its own subclasses).
Note that the returned value specifically excludes this entity binding.
- Returns:
- sub-entity bindings ordered as a depth-first,
pre-order traversal
getEntity
public Entity getEntity()
setEntity
public void setEntity(Entity entity)
getPrimaryTable
public TableSpecification getPrimaryTable()
setPrimaryTable
public void setPrimaryTable(TableSpecification primaryTable)
locateTable
public TableSpecification locateTable(String tableName)
getPrimaryTableName
public String getPrimaryTableName()
setPrimaryTableName
public void setPrimaryTableName(String primaryTableName)
addSecondaryTable
public void addSecondaryTable(String tableName,
TableSpecification table)
isVersioned
public boolean isVersioned()
isDiscriminatorMatchValueNull
public boolean isDiscriminatorMatchValueNull()
isDiscriminatorMatchValueNotNull
public boolean isDiscriminatorMatchValueNotNull()
getDiscriminatorMatchValue
public String getDiscriminatorMatchValue()
setDiscriminatorMatchValue
public void setDiscriminatorMatchValue(String discriminatorMatchValue)
getFilterDefinitions
public Iterable<FilterDefinition> getFilterDefinitions()
addFilterDefinition
public void addFilterDefinition(FilterDefinition filterDefinition)
getEntityReferencingAttributeBindings
public Iterable<SingularAssociationAttributeBinding> getEntityReferencingAttributeBindings()
seekEntityBinding
public EntityBinding seekEntityBinding()
- Description copied from interface:
AttributeBindingContainer
- Seeks out the entity binding that is the root of this component path.
- Specified by:
seekEntityBinding
in interface AttributeBindingContainer
- Returns:
- The entity binding
getPathBase
public String getPathBase()
- Description copied from interface:
AttributeBindingContainer
- Obtain the path base of this container. Intended to help uniquely identify each attribute binding.
- Specified by:
getPathBase
in interface AttributeBindingContainer
- Returns:
- The path base for this container.
getClassReference
public Class<?> getClassReference()
- Description copied from interface:
AttributeBindingContainer
- Obtain the
Class
reference for this attribute container. Generally this is used to perform reflection
on the attributes.
- Specified by:
getClassReference
in interface AttributeBindingContainer
- Returns:
- The
Class
reference
getAttributeContainer
public AttributeContainer getAttributeContainer()
- Description copied from interface:
AttributeBindingContainer
- Obtain the underlying domain attribute container.
- Specified by:
getAttributeContainer
in interface AttributeBindingContainer
- Returns:
- The attribute container
registerAttributeBinding
protected void registerAttributeBinding(String name,
AttributeBinding attributeBinding)
getMetaAttributeContext
public MetaAttributeContext getMetaAttributeContext()
- Description copied from interface:
AttributeBindingContainer
- Obtain the meta-attribute context for this container.
- Specified by:
getMetaAttributeContext
in interface AttributeBindingContainer
- Returns:
- The meta-attribute context.
setMetaAttributeContext
public void setMetaAttributeContext(MetaAttributeContext metaAttributeContext)
isMutable
public boolean isMutable()
setMutable
public void setMutable(boolean mutable)
isLazy
public boolean isLazy()
setLazy
public void setLazy(boolean lazy)
getProxyInterfaceType
public Value<Class<?>> getProxyInterfaceType()
setProxyInterfaceType
public void setProxyInterfaceType(Value<Class<?>> proxyInterfaceType)
getWhereFilter
public String getWhereFilter()
setWhereFilter
public void setWhereFilter(String whereFilter)
getRowId
public String getRowId()
setRowId
public void setRowId(String rowId)
isDynamicUpdate
public boolean isDynamicUpdate()
setDynamicUpdate
public void setDynamicUpdate(boolean dynamicUpdate)
isDynamicInsert
public boolean isDynamicInsert()
setDynamicInsert
public void setDynamicInsert(boolean dynamicInsert)
getBatchSize
public int getBatchSize()
setBatchSize
public void setBatchSize(int batchSize)
isSelectBeforeUpdate
public boolean isSelectBeforeUpdate()
setSelectBeforeUpdate
public void setSelectBeforeUpdate(boolean selectBeforeUpdate)
hasSubselectLoadableCollections
public boolean hasSubselectLoadableCollections()
getCustomEntityPersisterClass
public Class<? extends EntityPersister> getCustomEntityPersisterClass()
setCustomEntityPersisterClass
public void setCustomEntityPersisterClass(Class<? extends EntityPersister> customEntityPersisterClass)
getCustomEntityTuplizerClass
public Class<? extends EntityTuplizer> getCustomEntityTuplizerClass()
setCustomEntityTuplizerClass
public void setCustomEntityTuplizerClass(Class<? extends EntityTuplizer> customEntityTuplizerClass)
isAbstract
public Boolean isAbstract()
setAbstract
public void setAbstract(Boolean isAbstract)
getSynchronizedTableNames
public Set<String> getSynchronizedTableNames()
addSynchronizedTableNames
public void addSynchronizedTableNames(Collection<String> synchronizedTableNames)
getJpaEntityName
public String getJpaEntityName()
setJpaEntityName
public void setJpaEntityName(String jpaEntityName)
getCustomLoaderName
public String getCustomLoaderName()
setCustomLoaderName
public void setCustomLoaderName(String customLoaderName)
getCustomInsert
public CustomSQL getCustomInsert()
setCustomInsert
public void setCustomInsert(CustomSQL customInsert)
getCustomUpdate
public CustomSQL getCustomUpdate()
setCustomUpdate
public void setCustomUpdate(CustomSQL customUpdate)
getCustomDelete
public CustomSQL getCustomDelete()
setCustomDelete
public void setCustomDelete(CustomSQL customDelete)
toString
public String toString()
- Overrides:
toString
in class Object
makeBasicAttributeBinding
public BasicAttributeBinding makeBasicAttributeBinding(SingularAttribute attribute)
- Description copied from interface:
AttributeBindingContainer
- Factory method for basic attribute bindings.
- Specified by:
makeBasicAttributeBinding
in interface AttributeBindingContainer
- Parameters:
attribute
- The attribute for which to make a binding.
- Returns:
- The attribute binding instance.
makeComponentAttributeBinding
public ComponentAttributeBinding makeComponentAttributeBinding(SingularAttribute attribute)
- Description copied from interface:
AttributeBindingContainer
- Factory method for component attribute bindings.
- Specified by:
makeComponentAttributeBinding
in interface AttributeBindingContainer
- Parameters:
attribute
- The attribute for which to make a binding.
- Returns:
- The attribute binding instance.
makeManyToOneAttributeBinding
public ManyToOneAttributeBinding makeManyToOneAttributeBinding(SingularAttribute attribute)
- Description copied from interface:
AttributeBindingContainer
- Factory method for many-to-one attribute bindings.
- Specified by:
makeManyToOneAttributeBinding
in interface AttributeBindingContainer
- Parameters:
attribute
- The attribute for which to make a binding.
- Returns:
- The attribute binding instance.
makeBagAttributeBinding
public BagBinding makeBagAttributeBinding(PluralAttribute attribute,
CollectionElementNature nature)
- Description copied from interface:
AttributeBindingContainer
- Factory method for bag attribute bindings.
- Specified by:
makeBagAttributeBinding
in interface AttributeBindingContainer
- Parameters:
attribute
- The attribute for which to make a binding.nature
- The nature of the collection elements.
- Returns:
- The attribute binding instance.
makeSetAttributeBinding
public SetBinding makeSetAttributeBinding(PluralAttribute attribute,
CollectionElementNature nature)
- Description copied from interface:
AttributeBindingContainer
- Factory method for bag attribute bindings.
- Specified by:
makeSetAttributeBinding
in interface AttributeBindingContainer
- Parameters:
attribute
- The attribute for which to make a binding.nature
- The nature of the collection elements.
- Returns:
- The attribute binding instance.
locateAttributeBinding
public AttributeBinding locateAttributeBinding(String name)
- Description copied from interface:
AttributeBindingContainer
- Locate a specific attribute binding, by its local name.
- Specified by:
locateAttributeBinding
in interface AttributeBindingContainer
- Parameters:
name
- The name of the attribute, local to this container.
- Returns:
- The attribute binding.
attributeBindings
public Iterable<AttributeBinding> attributeBindings()
- Description copied from interface:
AttributeBindingContainer
- Obtain all attribute bindings
- Specified by:
attributeBindings
in interface AttributeBindingContainer
- Returns:
- All attribute bindings
getAttributeBindingClosureSpan
public int getAttributeBindingClosureSpan()
- Gets the number of attribute bindings defined on this class, including the
identifier attribute binding and attribute bindings defined
as part of a join.
- Returns:
- The number of attribute bindings
getAttributeBindingClosure
public Iterable<AttributeBinding> getAttributeBindingClosure()
- Gets the attribute bindings defined on this class, including the
identifier attribute binding and attribute bindings defined
as part of a join.
- Returns:
- The attribute bindings.
getSubEntityAttributeBindingClosure
public Iterable<AttributeBinding> getSubEntityAttributeBindingClosure()
- Gets the attribute bindings for this EntityBinding and all of its
sub-EntityBinding, starting from the root of the hierarchy; includes
the identifier and attribute bindings defined as part of a join.
- Returns:
setJpaCallbackClasses
public void setJpaCallbackClasses(List<JpaCallbackClass> jpaCallbackClasses)
getJpaCallbackClasses
public Iterable<JpaCallbackClass> getJpaCallbackClasses()
Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.