Working with queries

About this task

A query specifies criteria for fetching data from the database. You can create and run a query to fetch data from the HCL Compass database according to the search criteria that you provide in the query.

Procedure

To build a query, follow these steps:
  1. Build a query (QueryDef) to specify what data you want. The QueryDef object contains the definition of a query for a HCL Compass database. After a QueryDef is created, you can use it to get information from the database.
  2. Create a result set (ResultSet object) to hold the data.
  3. Execute the query, which populates a result set with the data it fetches from the database.
  4. Move through the ResultSet object.

Results

Note: If you write a hook that operates only on the current Entity object, you do not need to use a query.