Interface SingleQueryReferenceDefinition

All Superinterfaces:
BundledResource<QueryReferenceDefinition>, ContactNodeRestrictions<SingleQueryReferenceDefinition>, DataStoresConditionable<SingleQueryReferenceDefinition>, QueryReferenceDefinition<SingleQueryReferenceDefinition>

A single query reference definition holds a single base query name and, possibly, parameters and restrictions that should be used on that query.

There are two ways to define changes over a query:

  1. Parameters - if the original query defined named conditions, the queryParameters() can then be used to insert values into those conditions, or even replace a named condition completely.
  2. Restrictions - the restrictions() map allows defining restrictions per node name. A QueryNodeRestrictions object can be used to restrict a node to certain Ids, types or add additional property conditions.
A Query object with this definition returns the "flatten" QueryDefinition - with all restrictions and parameters already applied.

Note: While it is possible to define a query reference that does not add restrictions or parameters, it is useless to do so. Methods from the following interfaces refer to restrictions on the entire query:

Since:
UCMDB 9.0
  • Method Details

    • baseQueryName

      String baseQueryName()
      The query this definition is referencing.
      Returns:
      The query this definition is referencing.
    • queryParameters

      QueryParameters queryParameters()
      The query parameters this definition should use.
      Returns:
      The query parameters this definition should use.
    • restrictions

      The map of restrictions.
      Returns:
      the map of restrictions.
    • nodeRestrictions

      QueryNodeRestrictions nodeRestrictions(String nodeName)
      Creates or returns the node restrictions for the given node name.
      Parameters:
      nodeName - the node name. A node with that name should exist in the base query.
      Returns:
      the restrictions structure.