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 VariableOneToOneMapping

`java.lang.Object
oracle.toplink.mappings.DatabaseMapping
oracle.toplink.mappings.ForeignReferenceMapping
oracle.toplink.mappings.ObjectReferenceMapping
oracle.toplink.mappings.VariableOneToOneMapping`

All Implemented Interfaces:
  java.lang.Cloneable, oracle.toplink.mappings.RelationalMapping, java.io.Serializable

public class VariableOneToOneMapping
extends ObjectReferenceMapping
implements oracle.toplink.mappings.RelationalMapping

Purpose: Variable one to one mappings are used to represent a pointer references between a java object and an implementer of an interface. This mapping is usually represented by a single pointer (stored in an instance variable) between the source and target objects. In the relational database tables, these mappings are normally implemented using a foreign key and a typr code.

Since:
  TOPLink/Java 2.0
See Also:
  Serialized Form

Constructor Summary
`VariableOneToOneMapping()` PUBLIC: Default constructor.

Method Summary
`void` | `addClassIndicator(java.lang.Class implementer, java.lang.Object typeIndicator)` PUBLIC: Add a type indicator conversion to this mapping.
`void` | `addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)` PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping.
`void` | `addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName, java.lang.String sourcePrimaryKeyFieldName)` PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping.
`java.util.Vector` | `getForeignKeyFieldNames()` PUBLIC: Return the foreign key field names associated with the mapping.
`java.util.Vector` | `getSourceToTargetQueryKeyFieldAssociations()` PUBLIC: Return a collection of the field to query key associations.
`DatabaseField` | `getTypeField()`
`java.lang.String` | `getTypeFieldName()` PUBLIC: This method returns the name of the typeField of the mapping.
`void` | `setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)` PUBLIC: Set the class indicator associations.
`void` | `setForeignKeyFieldNames(java.util.Vector fieldNames)` PUBLIC: Return the foreign key field names associated with the mapping.
`void` | `setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)` PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping.
`void` | `setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)` PUBLIC: Set a collection of the source to target query key/field associations.
`void` | `setTypeFieldName(java.lang.String typeFieldName)` PUBLIC: This method sets the name of the typeField of the mapping.

Methods inherited from class oracle.toplink.mappings.ObjectReferenceMapping
`useProxyIndirection, useProxyIndirection, useProxyIndirection`

Methods inherited from class oracle.toplink.mappings.ForeignReferenceMapping
`dontUseBatchReading, dontUseIndirection, getReferenceClass, getRelationshipPartnerAttributeName, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, privateOwnedRelationship, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setIndirectionPolicy, setReferenceClass, setRelationshipPartnerAttributeName, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setUsesBatchReading, setUsesIndirection, shouldUseBatchReading, useBasicIndirection, useBatchReading, useContainerIndirection, usesIndirection`

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

### VariableOneToOneMapping

    public VariableOneToOneMapping()

  PUBLIC: Default constructor.

Method Detail

### addClassIndicator

    public void addClassIndicator(java.lang.Class implementer,
                                  java.lang.Object typeIndicator)

  PUBLIC: Add a type indicator conversion to this mapping.

### addForeignQueryKeyName

    public void addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
                                       java.lang.String targetQueryKeyName)

  PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. This method is used if there are multiple foreign keys.

### addTargetForeignQueryKeyName

    public void addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName,
                                             java.lang.String sourcePrimaryKeyFieldName)

  PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping. This method is used for composite target foreign key relationships, that is the target object's table has multiple foreign key fields to the source object's primary key fields. Both the target foreign key query name and the source primary key field name must be specified. The distinction between a foreign key and target foreign key is that the variable 1-1 mapping will not populate the target foreign key value when written (because it is in the target table). Normally 1-1's are through foreign keys but in bi-directional 1-1's the back reference will be a target foreign key. In obscure composite legacy data models a 1-1 may consist of a foreign key part and a target foreign key part, in this case both method will be called with the correct parts.

### getForeignKeyFieldNames

    public java.util.Vector getForeignKeyFieldNames()

  PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable.

### getSourceToTargetQueryKeyFieldAssociations

    public java.util.Vector getSourceToTargetQueryKeyFieldAssociations()

  PUBLIC: Return a collection of the field to query key associations.

### getTypeField

    public DatabaseField getTypeField()

### getTypeFieldName

    public java.lang.String getTypeFieldName()

  PUBLIC: This method returns the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing.

### setClassIndicatorAssociations

    public void setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)

  PUBLIC: Set the class indicator associations.

### setForeignKeyFieldNames

    public void setForeignKeyFieldNames(java.util.Vector fieldNames)

  PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable.

### setForeignQueryKeyName

    public void setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
                                       java.lang.String targetQueryKeyName)

  PUBLIC: A foreign key from the source table and abstract query key from the interface descriptor are added to the mapping. This method is used if foreign key is not composite.

### setSourceToTargetQueryKeyFieldAssociations

    public void setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)

  PUBLIC: Set a collection of the source to target query key/field associations.

### setTypeFieldName

    public void setTypeFieldName(java.lang.String typeFieldName)

  PUBLIC: This method sets the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing.

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