GetEntityByDbId

Description

Returns the requested record (Entity) using the record's unique id.

Use this method to get a record whose database ID you know. You can get the database ID of a record by calling the GetDbId method of the corresponding Entity object.

To request the record using its visible ID instead of its database ID, use the GetEntity method.

Note: DBIDs are unique to a class of records, and unique within the stateful records, and unique within the stateless records. In version 7.0 the limit on the number of records that can be stored increased so the range of DBIDs also increased. However, Rational® ClearQuest® clients earlier than version 7.0 cannot display records with database identifiers (DBIDs) higher than the former limit. For more information on DBIDs, see Utilisation d'enregistrements.

Syntax

VBScript

session.GetEntityByDbId(entitydef_name, db_id)

Perl

$session->GetEntityByDbId(entitydef_name, db_id);
Identifier
Description
session
The Session object that represents the current database-access session.
entitydef_name
A String that identifies the name of the record type to which the desired record belongs.
db_id
A Long that is the number used by the database to identify the record.

The unique ID of the record (Entity).

Return value
Returns an Entity Object corresponding to the requested record.

Examples

VBScript

' Save this record's ID for later use.
set sessionObj = GetSession
set record1 = sessionObj.GetEntity("defect", "DEF00013323")

id = record1.GetDbId

' ...
' Get the record again
set record1 = sessionObj.GetEntityByDbId("defect", id)

Perl

#Assume you have $entityObj, an Entity Object
#Save the session and record id for later use:
$sessionObj = $entityObj->GetSession();

$dbid = $entityObj->GetDbId();

# ...
#Later, to get the record again:
$entityObj = $sessionObj->GetEntityByDbId("defect",$dbid);

Feedback