Interface Result<T>

Type Parameters:
T -

public interface Result<T>

Search query result.

By default the search query result is limited to 10 entries. If you don't specify a limit explicit with Limit.limit(int) you will only get the first 10 results back.

Example:

 import ch.ivyteam.ivy.business.data.store.search.Result;
 import workflow.business.data.Dossier;

 Result result = ivy.repo.search(Dossier.class)
                   .limit(10)
                   .execute();
 Number count = result.count(); // 0 .. 10
 Number total = result.totalCount(); // count .. ?
 Dossier dossier = result.getFirst() as Dossier;
 List<Dossier> dossiers = result.getAll();
 

API:
This is a public API.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the number of hits available in this result.
    Gets all business data objects available in the result.
    Gets information about all business data objects in the result.
    Gets the first business data object in the result.
    Gets information about the first business data object in the result.
    long
    Gets the total number of hits that matched the search query.
  • Method Details

    • getFirst

      T getFirst()

      Gets the first business data object in the result.

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
       import workflow.business.data.Dossier;
      
       Result result = ivy.repo.search(Dossier.class)
                         .limit(1)
                         .execute();
       Dossier dossier = result.getFirst() as Dossier;
       

      Returns:
      first business data object
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getFirstInfo

      BusinessDataInfo<T> getFirstInfo()

      Gets information about the first business data object in the result.

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
       import ch.ivyteam.ivy.business.data.store.BusinessDataInfo;
      
       Result result = ivy.repo.search(Dossier.class)
                         .limit(1)
                         .execute();
       BusinessDataInfo businessDataInfo = result.getFirstInfo();
       

      Returns:
      first business data information
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getAll

      List<T> getAll()

      Gets all business data objects available in the result.

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
      
       import workflow.business.data.Dossier;
       Result result = ivy.repo.search(Dossier.class)
                         .limit(10)
                         .execute();
       List<Dossier> dossiers = result.getAll();
       

      By default the maximum number of results that are returned is 10. Use method Limit.limit(int) to configure another maximum.

      Returns:
      all business data objects
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • getAllInfos

      List<BusinessDataInfo<T>> getAllInfos()

      Gets information about all business data objects in the result.

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
       import ch.ivyteam.ivy.business.data.store.BusinessDataInfo;
      
       Result result = ivy.repo.search(Dossier.class)
                         .limit(10)
                         .execute();
       List<BusinessDataInfo> businessDataInfos = result.getAllInfos();
       

      By default the maximum number of results that are returned is 10. Use method Limit.limit(int) to configure another maximum.

      Returns:
      all business data information
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • count

      long count()

      Gets the number of hits available in this result.

      Note, because of performance considerations not all hits will be available in this result. By default the maximum number of hits that are available in a result is 10. Use method Limit.limit(int) to configure another maximum.

      The method totalCount() returns the total number of hits.

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
      
       Result result = ivy.repo.search(Dossier.class)
                         .limit(10)
                         .execute();
       Number count = result.count(); // 0 .. 10
       Number totalHits = result.totalCount(); // totalHits >= count
       

      Returns:
      number of results received
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.
    • totalCount

      long totalCount()

      Gets the total number of hits that matched the search query.

      Note, because of performance considerations not all hits will be available in this result by default. For the number of hits available in this result see count().

      Example:

       import ch.ivyteam.ivy.business.data.store.search.Result;
      
       Result result = ivy.repo.search(Dossier.class)
                         .limit(10)
                         .execute();
       Number count = result.count(); // 0 .. 10
       Number totalHits = result.totalCount(); // totalHits >= count
       

      Returns:
      total number of hits
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility ADVANCED.