Interface IDatabaseSearch


public interface IDatabaseSearch
Provides methods for searching and counting the persistent objects in the database.

SQL searches should only be used for advanced querying/counting when joins and the other SQL-capabilities, that cannot be achieved using Lucene queries, are needed. In other cases the IDataService's search/count methods that work with Lucene queries are preferred. For example, IDataService.searchInstances(String, String, String), IDataService.getInstancesCount(String, String), etc.

Since:
3.19.3
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    count(String sqlQuery)
    Returns the number of persistent objects found by executing the given SQL-query in the database for the current revision.
    int
    countInBaseline(String sqlQuery, String revision)
    Returns the number of persistent objects found by executing the specified SQL-query in the database for the specified revision.
    <T extends IPObject>
    IPObjectList<T>
    instances(String sqlQuery)
    Searches the persistent objects by executing the specified SQL-query in the database for the current revision.
    <T extends IPObject>
    IPObjectList<T>
    instancesInBaseline(String sqlQuery, String revision)
    Searches the persistent objects by executing the specified SQL-query in the database for the specified revision.
  • Method Details

    • instances

      @NotNull <T extends IPObject> IPObjectList<T> instances(@NotNull String sqlQuery)
      Searches the persistent objects by executing the specified SQL-query in the database for the current revision.
      Parameters:
      sqlQuery -
      Returns:
      a list containing the objects found as a result of the query execution.
      See Also:
    • instancesInBaseline

      @NotNull <T extends IPObject> IPObjectList<T> instancesInBaseline(@NotNull String sqlQuery, @Nullable String revision)
      Searches the persistent objects by executing the specified SQL-query in the database for the specified revision.
      Parameters:
      sqlQuery -
      revision - A Baseline revision in which to search. If null, search in the current revision.
      Returns:
      a list containing the objects found as a result of the query execution.
      See Also:
    • count

      int count(@NotNull String sqlQuery)
      Returns the number of persistent objects found by executing the given SQL-query in the database for the current revision. Should be used instead of instances(String sqlQuery).size() when only the number of search results is required.
      Parameters:
      sqlQuery -
      Returns:
      The number of persistent objects that match the given SQL-query.
      See Also:
    • countInBaseline

      int countInBaseline(@NotNull String sqlQuery, @Nullable String revision)
      Returns the number of persistent objects found by executing the specified SQL-query in the database for the specified revision. Should be used instead of instancesInBaseline(String sqlQuery, String revision).size() when only the number or search results is required.
      Parameters:
      sqlQuery -
      revision - A Baseline revision in which to search. If null, search in the current revision.
      Returns:
      The number of persistent objects that match the given SQL-query.
      See Also: