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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
count()
Gets the number of hits available in this result.List<T>
getAll()
Gets all business data objects available in the result.List<BusinessDataInfo<T>>
getAllInfos()
Gets information about all business data objects in the result.T
getFirst()
Gets the first business data object in the result.BusinessDataInfo<T>
getFirstInfo()
Gets information about the first business data object in the result.long
totalCount()
Gets the total number of hits that matched the search query.
-
-
-
Method Detail
-
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:
getFirstInfo()
- 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:
getFirst()
- 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:
getAllInfos()
,Limit.limit(int)
- 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:
getAll()
,Limit.limit(int)
- 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:
totalCount()
,Limit.limit(int)
,Limit.limit(int, int)
- 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:
count()
,Limit.limit(int)
,Limit.limit(int, int)
- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
-