oracle.toplink.mappings
Class AggregateObjectMapping
java.lang.Object
oracle.toplink.mappings.DatabaseMapping
oracle.toplink.mappings.AggregateMapping
oracle.toplink.mappings.AggregateObjectMapping
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class AggregateObjectMapping
- extends AggregateMapping
Purpose:Two objects can be considered to be related by aggregation if there is a strict 1:1 relationship between the objects. This means that if the source (parent) object exists, then the target (child or owned) object must exist. In TopLink, it also means the data for the owned object is in the same table as the parent.
- Since:
- TOPLink/Java 1.0
- See Also:
- Serialized Form
Method Summary |
void |
addFieldNameTranslation(java.lang.String sourceFieldName, java.lang.String aggregateFieldName)
PUBLIC: Add a field name translation that maps from a field name in the source table to a field name in the aggregate descriptor. |
void |
allowNull()
PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, TopLink will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
void |
dontAllowNull()
PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, TopLink will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). |
java.util.Vector |
getAggregateToSourceFieldNameAssociations()
PUBLIC: Return a collection of the aggregate to source field name associations. |
void |
setAggregateToSourceFieldNameAssociations(java.util.Vector fieldAssociations)
PUBLIC: Set a collection of the aggregate to source field name associations. |
Methods inherited from class oracle.toplink.mappings.DatabaseMapping |
getAttributeClassification, getAttributeName, getGetMethodName, getSetMethodName, readOnly, readWrite, setAttributeName, setGetMethodName, setIsReadOnly, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AggregateObjectMapping
public AggregateObjectMapping()
- Default constructor.
addFieldNameTranslation
public void addFieldNameTranslation(java.lang.String sourceFieldName,
java.lang.String aggregateFieldName)
- PUBLIC: Add a field name translation that maps from a field name in the source table to a field name in the aggregate descriptor.
allowNull
public void allowNull()
- PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, TopLink will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). This behavior can be explicitly set by calling #allowNull(). To change this behavior, call #dontAllowNull(). Then TopLink will build a new instance of the aggregate object that is filled with nulls and place it in the source object. In either situation, when writing, TopLink will place a NULL in all the fields in the database row for the aggregate object.
dontAllowNull
public void dontAllowNull()
- PUBLIC: If all the fields in the database row for the aggregate object are NULL, then, by default, TopLink will place a null in the appropriate source object (as opposed to an aggregate object filled with nulls). This behavior can be explicitly set by calling #allowNull(). To change this behavior, call #dontAllowNull(). Then TopLink will build a new instance of the aggregate object that is filled with nulls and place it in the source object. In either situation, when writing, TopLink will place a NULL in all the fields in the database row for the aggregate object.
getAggregateToSourceFieldNameAssociations
public java.util.Vector getAggregateToSourceFieldNameAssociations()
- PUBLIC: Return a collection of the aggregate to source field name associations.
setAggregateToSourceFieldNameAssociations
public void setAggregateToSourceFieldNameAssociations(java.util.Vector fieldAssociations)
- PUBLIC: Set a collection of the aggregate to source field name associations.