Understanding Session objects

Session and its sub-objects provide services to user database objects.

HCL Compass uses the Session object to verify the user's authority to access a given database. When a user launches the HCL Compass client application, HCL Compass automatically authenticates the user using the logon window. However, developers of standalone applications must use the methods of the Session object to log on to the desired database.

The Session object acts as the primary root object to the remaining database objects. You use the Session object to:

  • Create or access many of the other objects in the system
  • Create new records or modify existing records
  • Create the query objects that enable you to search the database for a particular record (or set of records)

After starting a session, the object you will work with most often is the Entity object. The Entity object represents a single user data record in the database and enables you to view or change the data in a record.

Using the methods of Entity, you can do the following:

  • Acquire information about the fields of the underlying record, and about any related objects in the system (including duplicate records, attached files, and activity logs for the record).

    FieldInfo objects are used to return value information for fields of entities. A FieldInfo object contains the name, value, and validity information for the field. These objects contain snapshots of values; they do not change as the entity is updated.

  • Acquire the metadata associated with the Entity object to determine the structure of the record. This information is contained in the associated EntityDef (record type) object.