Find operations

Find methods access objects in the Common Data Model. You can use the find methods to return model objects matching a specific query or return information about specific managed elements. You can also use the methods to return objects that have changed during a specified time period.

Table 1 describes the find operations you can perform.
Note: Many of the find methods using a depth parameter are now deprecated, because they do not scale well when querying large amounts of data. If you need to query data at a depth greater than one, use an executeQuery method. Each executeQuery method returns returns a DataResultSet object from which you can retrieve information about model objects, and you can use a cursor to scroll through the data.
Table 1. Find methods
Method Description

find(Guid guid, int depth, Guid mss, String[] permissions)

Return information about a specific managed element.

find(Guid Guid, int depth, String[] permissions)

Same as find(String, int, Guid), except a specific object instance is searched by GUID rather than an entire set of objects using a query.

find(String query, int depth, Guid mss, String[] permissions)

Note: This method is deprecated. Use executeQuery or a find method with a fillFlag parameter.

Return model objects matching the specified query. Note the following details about the depth parameter:

  • A depth of 0 returns an object with only its GUID set.
  • A depth of 1 returns all top-level attributes, along with contained objects having only their GUID attributes set.
  • Setting depth to DEPTH_INFINITE recursively locates all attributes until no additional objects are found. Cycles are avoided.

find(String query, boolean fillFlag, Guid mss, String[] permissions)

Return model objects matching the specified query.
  • query - Model language query to select and filter results.
  • fillFlag – Whether to populate all of the attributes.
  • mss - Managed Software System ID, or null if none
  • permissions - Optional list of permissions to restrict results

findChanges(String query, int depth, long start, long end, int changeType)

Note: This method is deprecated. Use the executeChangesQuery method.

Return objects that have changed during the specified period for a given change type.

findChanges(String query, boolean fillFlag, long start, long end, int changeType)

Note: This method is deprecated. Use the executeChangesQuery method.

Return objects that have changed during the specified period for a given change type.

findChanges(String query, int depth, long start, long end, int changeType

Note: This method is deprecated. Use the executeChangesQuery method.

Return objects that have changed in the specified period for a given change type.

findChanges(String query, boolean fillFlag, long start, long end, int changeType)

Note: This method is deprecated. Use the executeChangesQuery method.

Return objects that have changed in the specified period for a given change type.

findCollections(Guid guid, String[] permissions)

See the section on Managing collections.

findImpactedBusinessApplications(Guid[] objects)

See the section on Presentation.

findImpactedBusinessServices(Guid[] objects)

See the section on Presentation.

findJDO(String root, String jdoQuery, String jdoVarDecl, int depth, Guid mss, String[] permissions)

Note: This method is deprecated. Use the executeJDOQuery method.

Same as find(String, int, Guid) except that the query must contain a Java™ Data Object query (JDOQL), with optional variable declarations.

findJDO(String root, String jdoQuery, String jdoVarDecl, boolean fillFlag, Guid mss, String[] permissions)

Note: This method is deprecated. Use the executeJDOQuery method.

Same as find(String, int, Guid) except that the query must contain a Java Data Object query (JDOQL), with optional variable declarations.

findRelationships(Guid managedElementGuid, int direction, String type, int scope, String[] permissions)

See the section on Managing relationships.

findRelationships(Guid[] sourceGuids, Guid[] targetGuids, String[] types, int comparisonFlags)

See the section on Managing relationships.

findXML(String query, int depth, int indent, Guid mss, String[] permissions)

Note: This method is deprecated. Use the findXML(String,boolean,int,Guid,String[] method.

Return an XML document containing a list of all objects matching the specified query. This method is similar in function to find(String, int, Guid) except that the objects are converted to XML format.

findXML(Guid Guid, int indent, int depth, String[] permissions)

Same as findXML(String, int, int, Guid) except that a specific object instance is searched by ID, rather than a whole set of objects using a query.

findXML(String query, boolean fillFlag, int indent, Guid mss, String[] permissions)

Returns an XML document containing a list of all objects which match the given query.

findCount(String query, String[] permissions)

Returns a count of the objects matched by the specified MQL query string.

executeQuery(String query, Guid mss, String[] permissions) Executes an MQL query and returns a scrolling cursor interface.
executeQuery(String query, int defaultDepth, Guid mss, String[] permissions) Executes an MQL query and returns a scrolling cursor interface.
executeChangesQuery(String query, int defaultDepth, long start, long end, int changeType, boolean deltaSynching) Returns objects that changed in the given period for a given change type. Otherwise, similar in functionality to executeQuery (String,int,Guid,String[]). If the changeType parameter is set to DELETED, then the WHERE clause in the query is ignored. All objects of the specified model object class that were deleted in the given time frame will be returned. The returned model objects are the shell model objects. They do not contain any attributes in them. Only the GUID is set. If the changeType parameter is set to ANYCHANGE, then in addition to executing the normal find query, the deleted shell objects will be returned. For the deleted objects, however, the where clause is ignored.
findChangesForDeltaSynching(String query, boolean fillFlag, long start, long end, int changeType)
Note: This method is deprecated. Use the executeChangesQuery method.
Returns objects that were persisted in the data store during the specified period of time for the specified change type.