Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

B32476-03

oracle.toplink.mappings
Class VariableOneToOneMapping

java.lang.Object
  extended by oracle.toplink.mappings.DatabaseMapping
      extended by oracle.toplink.mappings.ForeignReferenceMapping
          extended by oracle.toplink.mappings.ObjectReferenceMapping
              extended by oracle.toplink.mappings.VariableOneToOneMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, oracle.toplink.mappings.RelationalMapping

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

Field Summary
 
Fields inherited from class oracle.toplink.mappings.ForeignReferenceMapping
INNER_JOIN, NONE, OUTER_JOIN
 
Constructor Summary
VariableOneToOneMapping()
          Default constructor.
 
Method Summary
 void addClassIndicator(java.lang.Class implementer, java.lang.Object typeIndicator)
          Add a type indicator conversion to this mapping.
 void addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)
          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)
          Define the target foreign key relationship in the Variable 1-1 mapping.
 java.util.Vector getForeignKeyFieldNames()
          Return the foreign key field names associated with the mapping.
 java.util.Vector getSourceToTargetQueryKeyFieldAssociations()
          Return a collection of the field to query key associations.
 DatabaseField getTypeField()
           
 java.lang.String getTypeFieldName()
          This method returns the name of the typeField of the mapping.
 void setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
          Set the class indicator associations.
 void setForeignKeyFieldNames(java.util.Vector fieldNames)
          Return the foreign key field names associated with the mapping.
 void setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetQueryKeyName)
          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)
          Set a collection of the source to target query key/field associations.
 void setTypeFieldName(java.lang.String typeFieldName)
          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, getJoinFetch, getReferenceClass, getRelationshipPartnerAttributeName, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isInnerJoinFetched, isJoinFetched, isOuterJoinFetched, isPrivateOwned, privateOwnedRelationship, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setReferenceClass, setRelationshipPartnerAttributeName, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setUsesBatchReading, setUsesIndirection, shouldUseBatchReading, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection
 
Methods inherited from class oracle.toplink.mappings.DatabaseMapping
getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getProperty, getSetMethodName, isLazy, isOptional, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, setAttributeName, setGetMethodName, setIsLazy, setIsOptional, setIsReadOnly, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableOneToOneMapping

public VariableOneToOneMapping()
Default constructor.

Method Detail

addClassIndicator

public void addClassIndicator(java.lang.Class implementer,
                              java.lang.Object typeIndicator)
Add a type indicator conversion to this mapping.


addForeignQueryKeyName

public void addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
                                   java.lang.String targetQueryKeyName)
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)
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()
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()
Return a collection of the field to query key associations.


getTypeField

public DatabaseField getTypeField()

getTypeFieldName

public java.lang.String getTypeFieldName()
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)
Set the class indicator associations.


setForeignKeyFieldNames

public void setForeignKeyFieldNames(java.util.Vector fieldNames)
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)
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)
Set a collection of the source to target query key/field associations.


setTypeFieldName

public void setTypeFieldName(java.lang.String typeFieldName)
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.


Copyright © 1998, 2010, Oracle. All Rights Reserved.