Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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, oracle.toplink.mappings.RelationalMapping, java.io.Serializable

public class AggregateObjectMapping
extends AggregateMapping
implements oracle.toplink.mappings.RelationalMapping

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

Constructor Summary
`AggregateObjectMapping()` Default constructor.

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).

Methods inherited from class oracle.toplink.mappings.AggregateMapping
`getReferenceClass, setReferenceClass`

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
`getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getReferenceClassDescriptor, getSetMethodName, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, setAttributeName, setGetMethodName, setIsReadOnly, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AggregateObjectMapping

    public AggregateObjectMapping()

  Default constructor.

Method Detail

### 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD