GetOrigCollection - Teradata Meta Data Services

Teradata Meta Data Services Programmer Guide

Product
Teradata Meta Data Services
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
Product Category
Teradata Tools and Utilities

GetOrigCollection

Purpose

The CMetaObject class GetOrigCollection function returns the collection of objects of the origin class associated with this CMetaObject for the specified relationship.

If a strObjName is not specified (NULL), all objects in the collection are returned.

If a strObjName is specified, only the objects of the specified name in the collection are returned. The name search is not case sensitive.

Description

Specifying an empty string (“”) for strObjName returns only objects in the collection with no name.

When the origin class supports versioning, GetOrigCollection will return object versions in the origin class that have a rigid relationship to the current version of this CMetaObject. The returned objects are not guaranteed to be the current version of their respective objects, i.e CMetaPersist::IsPublished() may be true or false for each returned object

The relationship ID is specified by the GUID relationship ID or the internal relationship ID (one must be set).

CMetaObject must be set with the ObjectID of an object in the destination class of the relationship.

If the origin class of the relationship is a superclass, this function will only return objects in the origin class. To return objects in the subclasses, use the GetOrigCollection3 function.

Requirements

The internal object id must be set in the object and it must be for a version of the object.

The objects in the list returned by GetOrigCollection are not in any order. Use GetOrigCollectionByProperty to specify properties to sort the list by.

Syntax

HRESULT GetOrigCollection(
vector<CMetaObject> &objectList,
const GUID &gRelID, 
const OBJECTID_t lRelID = NULLLOID, 
LPCTSTR strObjName = NULL);
 
HRESULT GetOrigCollection(
vector<CMetaObject> &objectList,
const GUID &gRelID, 
const OBJECTID_t lRelID, 
LPCTSTR strObjName,
const bool WithLock);
 

Argument

In/Out

Description

objectList

In/Out

Reference to the list of CMetaObjects that will hold the collection returned. The list is cleared before adding the return collection.

gRelID

In

Relationship GUID.
Can be set to NULLGUID if lRelID is set.

lRelID

In
(Optional)

Relationship internal ID.
Optional, if gRelID is set.

strObjName

In
(Optional)

Specific name of objects in the collection to be returned.

WithLock

In

WithLock=true keeps the class table of the Orig Collection locked for WRITE. Use within an explicit transaction. Set WithLock to true when one of the Orig Collection objects will subsequently be updated within the transaction. This prevents deadlocks caused by Teradata promotional locks.