com.adobe.repository.infomodel.bean
Class Relation

java.lang.Object
  extended by com.adobe.repository.infomodel.bean.Relation
All Implemented Interfaces:
java.io.Serializable

public class Relation
extends java.lang.Object
implements java.io.Serializable

Relation instances are used to define many-to-many relationships among resources. A Relation object represents a relationship between two resources.

See Also:
Serialized Form

Field Summary
static int ATTRIBUTE_SOURCE_OBJECT_ID
          Contains the attribute identifier value which represents the attribute source object.
static int ATTRIBUTE_TARGET_OBJECT_ID
          Contains the attribute identifier value which represents the attribute target object.
static int ATTRIBUTE_TRACK_TARGET_HEAD
          Contains the attribute identifier value which represents the attribute track target head.
static int ATTRIBUTE_TYPE
          Contains the attribute identifier value which represents the Relation type.
static int OBJECT_TYPE_RELATION
          Contains the object type value which represents Relation instances.
static int TYPE_DEPENDANT_OF
          A predefined constant representing dependent relationships.
static int TYPE_MEMBER_OF
          A predefined constant representing membership (file system) relationships.
 
Constructor Summary
Relation()
          Default constructor.
 
Method Summary
 java.util.Date getCreateTime()
          Retrieves the time at which this relation was first created.
 long getOid()
          Retrieves this relation's numerical object identifier.
 Id getSourceObjectId()
          Retrieves the identifier of the Resource that is the source of this relation.
 Id getTargetObjectId()
          Retrieves the identifier of the Resource that is the target of this relation.
 boolean getTrackTargetHead()
          Determines whether the target attribute will automatically be updated to the latest version of the target object.
 int getType()
          Retrieves the type of this relation.
 java.util.Date getUpdateTime()
          Retrieves the time at which this relation was last modified.
 boolean isProjected(int attribute)
          Determines whether the supplied attribute or composed object is projected.
 void setCreateTime(java.util.Date createTime)
          Sets the time at which this relation was first written to the Repository.
 void setOid(long oid)
          Do not use this method.
 void setRepositoryLoadProfile(RepositoryLoadProfile loadProfile)
          Sets the Repository load profile for this relation.
 void setSourceObjectId(Id sourceObjectId)
          Sets the numerical object identifier for the Resource instance that is the source of the relationship.
 void setTargetObjectId(Id targetObjectId)
          Sets the numerical object identifier for the Resource instance that is the target of the relationship.
 void setTrackTargetHead(boolean trackTargetHead)
          Sets whether this relationship will track the head version of the target object.
 void setType(int type)
          Sets the type of this relation.
 void setUpdateTime(java.util.Date updateTime)
          Sets the time at which this relation was last modified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_DEPENDANT_OF

public static final int TYPE_DEPENDANT_OF
A predefined constant representing dependent relationships.

See Also:
Constant Field Values

TYPE_MEMBER_OF

public static final int TYPE_MEMBER_OF
A predefined constant representing membership (file system) relationships.

See Also:
Constant Field Values

OBJECT_TYPE_RELATION

public static final int OBJECT_TYPE_RELATION
Contains the object type value which represents Relation instances.

See Also:
Constant Field Values

ATTRIBUTE_TYPE

public static final int ATTRIBUTE_TYPE
Contains the attribute identifier value which represents the Relation type.

See Also:
Constant Field Values

ATTRIBUTE_TRACK_TARGET_HEAD

public static final int ATTRIBUTE_TRACK_TARGET_HEAD
Contains the attribute identifier value which represents the attribute track target head.

See Also:
Constant Field Values

ATTRIBUTE_SOURCE_OBJECT_ID

public static final int ATTRIBUTE_SOURCE_OBJECT_ID
Contains the attribute identifier value which represents the attribute source object.

See Also:
Constant Field Values

ATTRIBUTE_TARGET_OBJECT_ID

public static final int ATTRIBUTE_TARGET_OBJECT_ID
Contains the attribute identifier value which represents the attribute target object.

See Also:
Constant Field Values
Constructor Detail

Relation

public Relation()
Default constructor.

Method Detail

setRepositoryLoadProfile

public void setRepositoryLoadProfile(RepositoryLoadProfile loadProfile)
Sets the Repository load profile for this relation. The load profile defines the object types and attributes to be returned from (projected in) a repository query. For more information, see RepositoryLoadProfile.

Parameters:
loadProfile - The Repository load profile for this relation.

isProjected

public boolean isProjected(int attribute)
Determines whether the supplied attribute or composed object is projected.

Parameters:
attribute - The attribute or composed object, which can be any one of the LOAD_* constants defined in this class.
Returns:
true if the supplied attribute or composed object is projected, false otherwise.

getOid

public long getOid()
Retrieves this relation's numerical object identifier.

Returns:
This relation's numerical object identifier.

setOid

public void setOid(long oid)
Do not use this method.

Sets this relation's numerical object identifier.

Parameters:
oid - This relation's numerical object identifier.

getType

public int getType()
Retrieves the type of this relation.

Returns:
One of the TYPE_* constants, or a client-specified value greater than or equal to 1024.

setType

public void setType(int type)
Sets the type of this relation.

Parameters:
type - One of the TYPE_* constants, or a client-specified value greater than or equal to 1024.

getTrackTargetHead

public boolean getTrackTargetHead()
Determines whether the target attribute will automatically be updated to the latest version of the target object.

Returns:
true if the target attribute will automatically be updated to the latest version of the target object, false otherwise.

setTrackTargetHead

public void setTrackTargetHead(boolean trackTargetHead)
Sets whether this relationship will track the head version of the target object.

Parameters:
trackTargetHead - true if the head version of the target object will be tracked, false otherwise.

getSourceObjectId

public Id getSourceObjectId()
Retrieves the identifier of the Resource that is the source of this relation.

Returns:
The identifier of the Resource that is the source of this relation.

setSourceObjectId

public void setSourceObjectId(Id sourceObjectId)
Sets the numerical object identifier for the Resource instance that is the source of the relationship.

Parameters:
sourceObjectId - The numerical object identifier for the Resource instance that is the source of the relationship.

getTargetObjectId

public Id getTargetObjectId()
Retrieves the identifier of the Resource that is the target of this relation.

Returns:
The identifier of the Resource that is the target of this relation.

setTargetObjectId

public void setTargetObjectId(Id targetObjectId)
Sets the numerical object identifier for the Resource instance that is the target of the relationship.

Parameters:
targetObjectId - The numerical object identifier for the Resource instance that is the target of the relationship.

getUpdateTime

public java.util.Date getUpdateTime()
Retrieves the time at which this relation was last modified.

Returns:
The time at which this relation was last modified.

setUpdateTime

public void setUpdateTime(java.util.Date updateTime)
Sets the time at which this relation was last modified.

Parameters:
updateTime - The time at which this relation was last modified.

getCreateTime

public java.util.Date getCreateTime()
Retrieves the time at which this relation was first created.

Returns:
The time at which this relation was first created.

setCreateTime

public void setCreateTime(java.util.Date createTime)
Sets the time at which this relation was first written to the Repository.

Parameters:
createTime - The time at which this relation was first written to the Repository.