Attribute Data Types

This article contains the following topics:
casm1401
This article contains the following topics:
Each attribute of an object is of a specific type that has meaning to the CA SDM application, such as string, date, or integer. Knowing the attribute type is essential to correctly retrieving and updating attribute values.
The CA SDM uses an enumeration to identify each data type. These enumeration values are returned in various web methods, as illustrated by the following table:
Data Type
Value
Integer
2001
String
2002
Duration
2003
Date
2004
SREL
2005
UNKNOWN
2006
List (QREL/BREL)
2007
Lrel (many-to-many)
2008
UUID
2009
 
Integer
The Integer data type represents a 32-bit signed integer. Null an integer attribute by passing the empty string.
String
The String data type represents a character string, where the maximum length is defined by the database storage allocated for a particular string attribute.
If you attempt to set a string attribute to a value that exceeds its length, the value is truncated and an error message is written to the CA SDM log.
Duration
The Duration data type is an integer representing time duration in seconds. For example, “90” represents one minute and 30 seconds. To set a duration type, use an integer representing the number of seconds for the duration. Negative values are not permitted. To make a duration attribute null, pass the empty string.
Date
The Date data type represents a date value. This is stored as a UNIX-like UTC value in the database (the number of seconds since 1-1-1970). When retrieving date values, the integer UTC is returned. Similarly, use a UTC value to set a date. Negative values are not permitted. Null a date attribute by passing the empty string.
SREL
The SREL data type represents an SREL (Single RELation), which is a pointer to another object. It is a foreign key to another table in a database. For example, an Issue object has a pointer attribute to a Contact representing the Assignee.
Most CA SDM Web Services methods permit dot-notation to retrieve information about objects to which an SREL points. For example, to specify the name of a Contact’s organization from the context of the Contact, use the following:
organization.name
You may expand to an arbitrary number of levels as shown in the following example:
organization.contact.first_name
Dot-notation can only be used to retrieve attribute values, such as using getObjectValues(), or in a Where clause. You cannot use dot-notation to set values.
To set an SREL attribute, such as with updateObject(), you can pass the persistent id of the object to which you want to point. In order to simplify this action, this release of CA SDM has been enhanced so that the REL_ATTR (foreign key) value may be used to set an SREL.
For example, as the REL_ATTR of the crt object (Request Type) is its code attribute, the values “R”, “I” and “P” can be used to set the type attribute of a cr object to specify that the ticket is a Request, Incident or Problem. The cr’s type attribute can be set to “R” instead of “crt:180”, “I” instead of “crt:182” and “P” instead of “crt:181”.
To set an SREL attribute to null, pass the empty string (“”).
List (QREL/BREL)
An object can have a list attribute that represents a one-to-many relationship. These are defined in majic files with the QREL or BREL keywords. A list exists at the object level -- it does not take any additional storage in the DBMS.
The CA SDM system handles list collections as abstract data types. The Web Services provides several methods to interact with lists -- for references and queries to lists defined in an object, use getRelatedList() and getRelatedListValues(). For more information about lists, see CA SDM Lists in this chapter.
LREL
The LREL data type represents a many-to-many relationship between two object types. An LREL has two names, one for each side of the relationship. The CA SDM Web Services provides special functions for interacting with LRELs.
UNKNOWN
The Unknown data type represents an unknown data type.
UUID
A UUID is a 128-bit integer (16 bytes) or a 32-byte character that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated (for example, a contact ID). UUIDs are used mostly with primary keys.