Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.mappings
Class DatabaseMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping

All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
AggregateMapping, DirectToFieldMapping, ForeignReferenceMapping, SDKDirectCollectionMapping, TransformationMapping

public abstract class DatabaseMapping
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Purpose: Defines how an attribute of an object maps to and from the database

Responsibilities:

Since:
TOPLink/Java 1.0
See Also:
Serialized Form

Constructor Summary
DatabaseMapping()
PUBLIC: Default constructor.

Method Summary
java.lang.Class getAttributeClassification()
PUBLIC: The classification type for the attribute this mapping represents
java.lang.String getAttributeName()
PUBLIC: Return the name of the attribute set in the mapping.
java.lang.String getGetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object.
java.lang.String getSetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to set the value of the attribute in the object.
void readOnly()
PUBLIC: To make mapping read only.
void readWrite()
PUBLIC: The mapping can be dynamically made either readOnly or readWriteOnly.
void setAttributeName(java.lang.String attributeName)
PUBLIC: Sets the name of the attribute in the mapping.
void setGetMethodName(java.lang.String methodName)
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object.
void setIsReadOnly(boolean aBoolean)
PUBLIC: Set this mapping to be read only.
void setSetMethodName(java.lang.String methodName)
PUBLIC: This method is invoked reflectively on the reference object to get the value of the attribute.
void setWeight(java.lang.Integer newWeight)
ADVANCED: Set the weight of the mapping, used to sort mappings DirectToField Mappings have a default weight of 1 while all other Mappings have a default weight of MAXINT.
void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to add an object to a collection once the changeSet is applied.
void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, oracle.toplink.internal.sessions.ObjectChangeSet changeSet, oracle.toplink.publicinterface.Session session)
ADVANCED: This method is used to remove an object from a collection once the changeSet is applied.

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

Constructor Detail

DatabaseMapping

public DatabaseMapping()
PUBLIC: Default constructor.

Method Detail

getAttributeClassification

public java.lang.Class getAttributeClassification()
PUBLIC: The classification type for the attribute this mapping represents

getAttributeName

public java.lang.String getAttributeName()
PUBLIC: Return the name of the attribute set in the mapping.

getGetMethodName

public java.lang.String getGetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object. This method returns the name of the getMethodName or null if not using method access.

getSetMethodName

public java.lang.String getSetMethodName()
PUBLIC: This method is invoked reflectively on the reference object to set the value of the attribute in the object. This method returns the name of the setMethodName or null if not using method access.

readOnly

public void readOnly()
PUBLIC: To make mapping read only. No write can be performed on it.

readWrite

public void readWrite()
PUBLIC: The mapping can be dynamically made either readOnly or readWriteOnly. This makes mapping go back to default mode.

setAttributeName

public void setAttributeName(java.lang.String attributeName)
PUBLIC: Sets the name of the attribute in the mapping.

setGetMethodName

public void setGetMethodName(java.lang.String methodName)
PUBLIC: This method is invoked reflectively on the reference object to return the value of the attribute in the object. This method sets the name of the getMethodName.

setIsReadOnly

public void setIsReadOnly(boolean aBoolean)
PUBLIC: Set this mapping to be read only.

setSetMethodName

public void setSetMethodName(java.lang.String methodName)
PUBLIC: This method is invoked reflectively on the reference object to get the value of the attribute. The method defined on the object should actually return the value that needs to be set in the attribute accessor.

setWeight

public void setWeight(java.lang.Integer newWeight)
ADVANCED: Set the weight of the mapping, used to sort mappings DirectToField Mappings have a default weight of 1 while all other Mappings have a default weight of MAXINT. Ordering of Mappings can be achieved by setting the weight of a particular mapping to a value within the above mentioned limits. By ordering mappings the user can control what order relationships are processed by TopLink.

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                              oracle.toplink.publicinterface.Session session)
                                       throws DescriptorException
ADVANCED: This method is used to add an object to a collection once the changeSet is applied. The referenceKey parameter should only be used for direct Maps.
Throws:
DescriptorException

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object changeSetToAdd,
                                                   oracle.toplink.internal.sessions.ObjectChangeSet changeSet,
                                                   oracle.toplink.publicinterface.Session session)
                                            throws DescriptorException
ADVANCED: This method is used to remove an object from a collection once the changeSet is applied. The referenceKey parameter should only be used for direct Maps.
Throws:
DescriptorException

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.