Primavera Integration API 7.0

com.primavera.common.value
Class ObjectId

java.lang.Object
  extended by com.primavera.common.value.ObjectId
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ObjectId>
Direct Known Subclasses:
JobId

public class ObjectId
extends java.lang.Object
implements java.lang.Comparable<ObjectId>, java.io.Serializable

This value type is used as the primary key of a business object. It may contain one or more key values, usually Integers. Business objects that have multi-part object ids include ActivityCodeAssignment, ActivityPeriodActual, ProjectCodeAssignment, ProjectResourceQuantity, ResourceAccess, ResourceAssignmentPeriodActual, ResourceCodeAssignment, ResourceRole, ScheduleOptions, Timesheet, UDFValue, and UserOBS. Note that for ProjectResourceQuantity, the keys consist of an Integer and two Dates.

See Also:
Serialized Form

Field Summary
static ObjectId SECURITY_OVERRIDE_WBSCONTEXT_ID
           
static ObjectId USESSION_OVERRIDE_ID
           
 
Constructor Summary
ObjectId()
          Constructs an empty ObjectId object.
ObjectId(java.util.Collection<?> p_pkVals)
          Constructs an ObjectId object with the given Collection of Objects.
ObjectId(java.sql.Date dtId1, java.sql.Date dtId2)
          Constructs an ObjectId object with two int values.
ObjectId(int id)
          Constructs an ObjectId object with a given key value.
ObjectId(int[] iaPKVals)
          Constructs an ObjectId object with up to two given key values.
ObjectId(int iId1, int iId2)
          Constructs an ObjectId object with two int values.
ObjectId(java.lang.Number id)
          Constructs an ObjectId object with a given key value.
ObjectId(java.lang.Object[] p_pkVals)
          Constructs an ObjectId object with the given array of Objects.
 
Method Summary
 void addPrimaryKeyObject(java.lang.Object p_obj)
          Adds an object that represents a primary key data type to this object.
 int compareTo(ObjectId id)
          Compares two ObjectId objects.
 boolean equals(java.lang.Object object)
          Compares this ObjectId to the specified object.
static ObjectId fromString(java.lang.String sId)
          Creates an ObjectId from a String.
 java.lang.Integer getPrimaryKeyObject()
          Gets the Integer represented by this object.
 java.util.List<java.lang.Object> getPrimaryKeyObjects()
          Gets the key values represented by this object.
 int getPrimaryKeyValue()
          Gets the key value represented by this object.
 int[] getPrimaryKeyValues()
          Deprecated. As of release 5.0, use getPrimaryKeyObjects() to retrieve the key values.
 int hashCode()
          Gets a hashcode used when ObjectIds are stored in hashtables, etc.
 java.lang.Long hashCodeDates()
          Deprecated. do not use - it will be removed in the next release
 java.lang.Integer hashCodeInt()
          Deprecated. do not use - it will be removed in the next release
 java.lang.Long hashCodeLong()
          Deprecated. do not use - it will be removed in the next release
 boolean isMultiPartKey()
          Determines if this ObjectId object contains multiple key values.
 java.lang.Integer toInteger()
          Returns an Integer representation of the object.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SECURITY_OVERRIDE_WBSCONTEXT_ID

public static final ObjectId SECURITY_OVERRIDE_WBSCONTEXT_ID

USESSION_OVERRIDE_ID

public static final ObjectId USESSION_OVERRIDE_ID
Constructor Detail

ObjectId

public ObjectId()
Constructs an empty ObjectId object. Must use the addPrimaryKeyObject() method to populate


ObjectId

public ObjectId(int[] iaPKVals)
Constructs an ObjectId object with up to two given key values.

Parameters:
iaPKVals - the array of key values.

ObjectId

public ObjectId(java.lang.Object[] p_pkVals)
Constructs an ObjectId object with the given array of Objects.

Parameters:
p_pkVals - the Object array holding primary key objects

ObjectId

public ObjectId(java.util.Collection<?> p_pkVals)
Constructs an ObjectId object with the given Collection of Objects.

Parameters:
p_pkVals - the Collection holding the primary key objects

ObjectId

public ObjectId(int iId1,
                int iId2)
Constructs an ObjectId object with two int values.

Parameters:
iId1 - the first key value.
iId2 - the second key value.

ObjectId

public ObjectId(java.sql.Date dtId1,
                java.sql.Date dtId2)
Constructs an ObjectId object with two int values.

Parameters:
dtId1 - the first key value.
dtId2 - the second key value.

ObjectId

public ObjectId(int id)
Constructs an ObjectId object with a given key value.

Parameters:
id - the key value.

ObjectId

public ObjectId(java.lang.Number id)
Constructs an ObjectId object with a given key value.

Parameters:
id - the key value.
Method Detail

addPrimaryKeyObject

public void addPrimaryKeyObject(java.lang.Object p_obj)
Adds an object that represents a primary key data type to this object.

Parameters:
p_obj - the object representing the primary key

fromString

public static ObjectId fromString(java.lang.String sId)
Creates an ObjectId from a String.

Parameters:
sId - String to be converted
Returns:
a valid ObjectId if the string was valid, otherwise returns null

getPrimaryKeyValues

@Deprecated
public int[] getPrimaryKeyValues()
Deprecated. As of release 5.0, use getPrimaryKeyObjects() to retrieve the key values.

Gets the key values represented by this object.

Returns:
an array of the key values
See Also:
getPrimaryKeyObjects()

getPrimaryKeyObjects

public java.util.List<java.lang.Object> getPrimaryKeyObjects()
Gets the key values represented by this object.

Returns:
an List of the key values

getPrimaryKeyValue

public int getPrimaryKeyValue()
                       throws MultipartObjectIdException
Gets the key value represented by this object.

Returns:
the key value
Throws:
MultipartObjectIdException - if this object contains more than one key value

getPrimaryKeyObject

public java.lang.Integer getPrimaryKeyObject()
                                      throws MultipartObjectIdException
Gets the Integer represented by this object.

Returns:
the key value as an Integer
Throws:
MultipartObjectIdException - if this object contains more than one key value

toString

public java.lang.String toString()
Returns a string representation of the object. Returns an Id as a string, or a comma separated list if it has a multi-part key. Mixed type multi-part key supported

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object

toInteger

public java.lang.Integer toInteger()
Returns an Integer representation of the object. Mixed type multi-part keys are NOT supported

Returns:
a string representation of the object

isMultiPartKey

public boolean isMultiPartKey()
Determines if this ObjectId object contains multiple key values.

Returns:
true if this object contains multiple key values

equals

public boolean equals(java.lang.Object object)
Compares this ObjectId to the specified object. The result is true if and only if the argument is not null and is an ObjectId object that contains the same sequence of key values.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare this ObjectId against.
Returns:
true if the ObjectIds are equal; false otherwise.

hashCode

public int hashCode()
Gets a hashcode used when ObjectIds are stored in hashtables, etc.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

hashCodeLong

@Deprecated
public java.lang.Long hashCodeLong()
Deprecated. do not use - it will be removed in the next release

Gets a Long hashcode. Used when ObjectIds are stored in hashtables, etc.

Returns:
a long hash code value for this object.

hashCodeDates

@Deprecated
public java.lang.Long hashCodeDates()
Deprecated. do not use - it will be removed in the next release

Gets a Long hashcode based only on the Date types in this ObjectId. Used by ResourcePlanning to get an ordered list of qty records

Returns:
a Long hash code value for the Date objects in this ObjectId.

hashCodeInt

@Deprecated
public java.lang.Integer hashCodeInt()
Deprecated. do not use - it will be removed in the next release

Gets the hashcode for this ObjectId as an Integer.

Returns:
- an Integer which represents the hashCode for this ObjectId

compareTo

public int compareTo(ObjectId id)
Compares two ObjectId objects.

Specified by:
compareTo in interface java.lang.Comparable<ObjectId>
Parameters:
id - the Object to be compared.
Returns:
the value 0 if the argument is an ObjectId and equal to this ObjectId; a value less than 0 if the argument is an ObjectId, and the length of its key values is greater than that of this ObjectId ,or its key values are greater than the key values of this ObjectId, or if the argument is not an ObjectId; a value greater than 0 if the argument is an ObjectId, and the length of its key values is less than that of this ObjectId ,or its key values are less than the key values of this ObjectId.

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.