oracle.toplink.mappings
Class ForeignReferenceMapping
java.lang.Object
oracle.toplink.mappings.DatabaseMapping
oracle.toplink.mappings.ForeignReferenceMapping
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- CollectionMapping, ObjectReferenceMapping
- public abstract class ForeignReferenceMapping
- extends DatabaseMapping
Purpose: Abstract class for relationship mappings
- See Also:
- Serialized Form
Method Summary |
void |
dontUseBatchReading()
PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. |
void |
dontUseIndirection()
PUBLIC: This method will disable the use of indirection for the attribute being mapped. |
java.lang.Class |
getReferenceClass()
PUBLIC: Returns the reference class. |
java.lang.String |
getRelationshipPartnerAttributeName()
PUBLIC: Use this method retreive the relationship partner attribute name of this bidirectional Mapping. |
void |
privateOwnedRelationship()
PUBLIC: Sets the reference object to be a private owned. |
void |
setCustomSelectionQuery(ReadQuery query)
PUBLIC: Relationship mappings creates a read query to read reference objects. |
void |
setIndirectionPolicy(oracle.toplink.internal.indirection.IndirectionPolicy indirectionPolicy)
ADVANCED: Set the indirection policy. |
void |
setReferenceClass(java.lang.Class referenceClass)
PUBLIC: Set the referenced class. |
void |
setRelationshipPartnerAttributeName(java.lang.String attributeName)
PUBLIC: Use this method to specify the relationship partner attribute name of a bidirectional Mapping. |
void |
setSelectionCriteria(Expression anExpression)
PUBLIC: Sets the selection criteria to be used as a where clause to read reference objects. |
void |
setSelectionSQLString(java.lang.String sqlString)
PUBLIC: This is a property on the mapping which will allow custom SQL to be substituted for reading a reference object. |
void |
setUsesBatchReading(boolean usesBatchReading)
PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. |
void |
setUsesIndirection(boolean usesIndirection)
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
boolean |
shouldUseBatchReading()
PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. |
void |
useBasicIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. |
void |
useBatchReading()
PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. |
void |
useContainerIndirection(java.lang.Class containerClass)
PUBLIC: Indirection means that a IndirectContainer (wrapping a ValueHolder) will be put in-between the attribute and the real object. |
void |
useIndirection()
Deprecated. replaced by useBasicIndirection |
boolean |
usesIndirection()
PUBLIC: Indirection means that some sort of indirection object will be put in-between the attribute and the real object. |
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 |
dontUseBatchReading
public void dontUseBatchReading()
- PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. Batch reading will read all of the related objects in a single query when accessed from an originating read all. This should only be used if it is know that the related objects are always required with the source object, or indirection is not used.
dontUseIndirection
public void dontUseIndirection()
- PUBLIC: This method will disable the use of indirection for the attribute being mapped. That is, when the parent (the object that owns this attribute) is read, the target object associated with this attribute will be read from the database immediately. Reading of the target object from the database will not be delayed until the target object is accessed (as would be the case if indirection was enabled). Not using indirection may result in a large decrease in performance. For this reason, Oracle strongly recommends that you use indirection (by default, indirection is enabled).
-
- See Also:
#useBasicIndirectionPolicy()
getReferenceClass
public java.lang.Class getReferenceClass()
- PUBLIC: Returns the reference class.
getRelationshipPartnerAttributeName
public java.lang.String getRelationshipPartnerAttributeName()
- PUBLIC: Use this method retreive the relationship partner attribute name of this bidirectional Mapping.
privateOwnedRelationship
public void privateOwnedRelationship()
- PUBLIC: Sets the reference object to be a private owned. The default behaviour is non private owned.
setCustomSelectionQuery
public void setCustomSelectionQuery(ReadQuery query)
- PUBLIC: Relationship mappings creates a read query to read reference objects. If this default query needs to be customize then user can specify its own read query to do the reading of reference objects. One must instance of ReadQuery or subclasses of the ReadQuery.
setIndirectionPolicy
public void setIndirectionPolicy(oracle.toplink.internal.indirection.IndirectionPolicy indirectionPolicy)
- ADVANCED: Set the indirection policy.
setReferenceClass
public void setReferenceClass(java.lang.Class referenceClass)
- PUBLIC: Set the referenced class.
setRelationshipPartnerAttributeName
public void setRelationshipPartnerAttributeName(java.lang.String attributeName)
- PUBLIC: Use this method to specify the relationship partner attribute name of a bidirectional Mapping. TopLink will use the attribute name to find the back pointer mapping to maintain referential integrity of the bi-directional mappings.
setSelectionCriteria
public void setSelectionCriteria(Expression anExpression)
- PUBLIC: Sets the selection criteria to be used as a where clause to read reference objects. This criteria is automatically generated by the TopLink if not explicitly specified by the user.
setSelectionSQLString
public void setSelectionSQLString(java.lang.String sqlString)
- PUBLIC: This is a property on the mapping which will allow custom SQL to be substituted for reading a reference object.
setUsesBatchReading
public void setUsesBatchReading(boolean usesBatchReading)
- PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. Batch reading will read all of the related objects in a single query when accessed from an originating read all. This should only be used if it is know that the related objects are always required with the source object, or indirection is not used.
setUsesIndirection
public void setUsesIndirection(boolean usesIndirection)
- PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This allows for the reading of the target from the database to be delayed until accessed. This defaults to true and is strongly suggested as it give a huge performance gain.
-
- See Also:
useBasicIndirection()
, dontUseIndirection()
shouldUseBatchReading
public boolean shouldUseBatchReading()
- PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. Batch reading will read all of the related objects in a single query when accessed from an originating read all. This should only be used if it is know that the related objects are always required with the source object, or indirection is not used.
useBasicIndirection
public void useBasicIndirection()
- PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This allows for the reading of the target from the database to be delayed until accessed. This defaults to true and is strongly suggested as it gives a huge performance gain.
useBatchReading
public void useBatchReading()
- PUBLIC: Indicates whether the referenced object should always be batch read on read all queries. Batch reading will read all of the related objects in a single query when accessed from an originating read all. This should only be used if it is know that the related objects are always required with the source object, or indirection is not used.
useContainerIndirection
public void useContainerIndirection(java.lang.Class containerClass)
- PUBLIC: Indirection means that a IndirectContainer (wrapping a ValueHolder) will be put in-between the attribute and the real object. This allows for an application specific class to be used which wraps the value holder. The purpose of this is that the domain objects will not require to import the ValueHolderInterface class. Refer also to transparent indirection for a transparent solution to indirection.
useIndirection
public void useIndirection()
- Deprecated. replaced by useBasicIndirection
- OBSOLETE:
-
- See Also:
useBasicIndirection()
usesIndirection
public boolean usesIndirection()
- PUBLIC: Indirection means that some sort of indirection object will be put in-between the attribute and the real object. This allows for the reading of the target from the database to be delayed until accessed. This defaults to true and is strongly suggested as it give a huge performance gain.