Class ForeignFieldDesc
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc
-
- com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc
-
- All Implemented Interfaces:
Serializable
public class ForeignFieldDesc extends FieldDesc
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACT_AGGREGATE
Currently runtime code does not interprete this action.static int
ACT_CASCADE
When the parent object is deleted from db, delete the relationship object described by this object also.static int
ACT_NONE
When the parent object is deleted, no action is required for the relationship object described by this object.static int
ACT_NULLIFY
Currently runtime code does not interprete this action.static int
ACT_RESTRICT
Currently runtime code does not interprete this action.ArrayList
assocForeignColumns
Array of ColumnElement.ArrayList
assocForeignFields
Array of LocalFieldDesc.ArrayList
assocLocalColumns
Array of ColumnElement.ArrayList
assocLocalFields
Array of LocalFieldDesc.int
cardinalityLWB
int
cardinalityUPB
int
deleteAction
ArrayList
foreignColumns
Array of ColumnElement.ClassDesc
foreignConfig
Class descriptor for the class of this relationship field.ArrayList
foreignFields
Array of LocalFieldDesc.ArrayList
localColumns
Array of ColumnElement.ArrayList
localFields
Array of LocalFieldDesc.-
Fields inherited from class com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc
absoluteID, classDesc, concurrencyGroup, fetchGroup, GROUP_DEFAULT, GROUP_NONE, logger, messages, PROP_FOREIGN_KEY_FIELD, PROP_IN_CONCURRENCY_CHECK, PROP_LOG_ON_UPDATE, PROP_PRIMARY_KEY_FIELD, PROP_PRIMARY_TRACKED_FIELD, PROP_READ_ONLY, PROP_RECORD_ON_UPDATE, PROP_REF_INTEGRITY_UPDATES, PROP_SECONDARY_TRACKED_FIELD, PROP_TRACK_RELATIONSHIP_FIELD, PROP_VERSION_FIELD, sqlProperties
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
createObjectId(SQLStateManager sm, LocalFieldDesc fieldDesc, Object value)
Constructs the oid of a related instance.ArrayList
getAssocForeignFields()
ArrayList
getAssocLocalFields()
ArrayList
getForeignFields()
ForeignFieldDesc
getInverseRelationshipField()
ArrayList
getLocalFields()
boolean
hasForeignKey()
Checks the conditions that guarantee, that we have the foreign key on this side.boolean
isMappedToPk()
Returns true, if the relationship is mapped to primary key fields on the other relationship side.boolean
isRelationshipField()
Returns true.boolean
useJoinTable()
Returns true, if the relationship is mapped to a join table.-
Methods inherited from class com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc
addTrackedField, convertValue, createSCO, getCharFromString, getComponentType, getDeclaringClass, getEnumType, getName, getTrackedFields, getType, getValue, isForeignKeyField, isKeyField, setupDesc, setValue, toString
-
-
-
-
Field Detail
-
ACT_CASCADE
public static final int ACT_CASCADE
When the parent object is deleted from db, delete the relationship object described by this object also.- See Also:
- Constant Field Values
-
ACT_NONE
public static final int ACT_NONE
When the parent object is deleted, no action is required for the relationship object described by this object.- See Also:
- Constant Field Values
-
ACT_NULLIFY
public static final int ACT_NULLIFY
Currently runtime code does not interprete this action.- See Also:
- Constant Field Values
-
ACT_RESTRICT
public static final int ACT_RESTRICT
Currently runtime code does not interprete this action.- See Also:
- Constant Field Values
-
ACT_AGGREGATE
public static final int ACT_AGGREGATE
Currently runtime code does not interprete this action.- See Also:
- Constant Field Values
-
foreignConfig
public ClassDesc foreignConfig
Class descriptor for the class of this relationship field.
-
cardinalityLWB
public int cardinalityLWB
-
cardinalityUPB
public int cardinalityUPB
-
deleteAction
public int deleteAction
-
foreignFields
public ArrayList foreignFields
Array of LocalFieldDesc.
-
foreignColumns
public ArrayList foreignColumns
Array of ColumnElement.
-
localFields
public ArrayList localFields
Array of LocalFieldDesc.
-
localColumns
public ArrayList localColumns
Array of ColumnElement.
-
assocForeignFields
public ArrayList assocForeignFields
Array of LocalFieldDesc.
-
assocForeignColumns
public ArrayList assocForeignColumns
Array of ColumnElement.
-
assocLocalFields
public ArrayList assocLocalFields
Array of LocalFieldDesc.
-
assocLocalColumns
public ArrayList assocLocalColumns
Array of ColumnElement.
-
-
Method Detail
-
isRelationshipField
public boolean isRelationshipField()
Returns true.- Overrides:
isRelationshipField
in classFieldDesc
-
useJoinTable
public boolean useJoinTable()
Returns true, if the relationship is mapped to a join table.- Returns:
- True, if the relationship is mapped to a join table, false otherwise.
-
hasForeignKey
public boolean hasForeignKey()
Checks the conditions that guarantee, that we have the foreign key on this side.- Returns:
- True, if this relationship is mapped to foreign keys and the foreign key is on the local side. False otherwise.
-
isMappedToPk
public boolean isMappedToPk()
Returns true, if the relationship is mapped to primary key fields on the other relationship side.- Returns:
- True, if the relationship is mapped to primary key fields on the other relationship side, false otherwise.
- See Also:
initializeIsMappedToPk()
-
getLocalFields
public ArrayList getLocalFields()
-
getForeignFields
public ArrayList getForeignFields()
-
getAssocLocalFields
public ArrayList getAssocLocalFields()
-
getAssocForeignFields
public ArrayList getAssocForeignFields()
-
getInverseRelationshipField
public ForeignFieldDesc getInverseRelationshipField()
-
createObjectId
public Object createObjectId(SQLStateManager sm, LocalFieldDesc fieldDesc, Object value)
Constructs the oid of a related instance. If called bySQLStateManager.updateTrackedFields(com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc, java.lang.Object, com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc)
, the new value for the local fieldfieldDesc
is not yet set and passed as parametervalue
. If called for navigation bySQLStateManager.populateForeignField(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc)
, values of updated local fields must be retrieved from the before image. In both cases, the actual call to this method is inSQLStateManager.getObjectById(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc, java.lang.Object, boolean)
.For tracked field usage, see
SQLStateManager.setForeignKey(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager, com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc)
andSQLStateManager.updateTrackedFields(com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc, java.lang.Object, com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc)
. For navigation usage, seeSQLStateManager.realizeForeignField(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc)
.- Parameters:
sm
- State manager on the local side.fieldDesc
- Local field being set.value
- New value of the field being set.- Returns:
- The object id for the related instance. This id is used to lookup the instance from the persistence manager cache. The construced oid is invalid, if one of the oid fields is null. In this case the returned value is null.
-
-