Interface IFluentQueryExecutor<V>
- Type Parameters:
V- entity type
Query.- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionlongcount()Counts the number of rows or business objects that matches the query.Gets the first business objects that matches the givenquery.Gets the value of the first column and first record that matches the givenquery.Gets aRecordsetwith all records that matches the givenquery.recordset(int startIndex, int count) Gets aRecordsetwith the records that matches the givenquery.results()Gets all business objects that matches the givenquery.results(int startIndex, int count) Gets all business objects that matches the givenquery.Gets the results page wise.resultsPaged(int pageSize) Gets the results page wise.
-
Method Details
-
results
Gets all business objects that matches the given
query.WARNING: This methods loads the whole resulting data set into memory.
This can cause out of memory exceptions and bad performance of the whole engine.
Only use this method if you are sure that the resulting data set is small. Prefer usingresults(int, int),resultsPaged()This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The orderBy clauses (used to sort the resulting list)
This method ignores the following parts of the
query:- The groupBy clauses
- The aggregation (count, avg, min, max, sum) clauses
- Returns:
- list of matching business objects
- See Also:
- API:
- This public API is available in Java.
-
results
Gets all business objects that matches the given
query.This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The orderBy clauses (used to sort the resulting list)
This method ignores the following parts of the
query:- The groupBy clauses
- The aggregation (count, avg, min, max, sum) clauses
The parameters
startIndexandcountcan be used to limit the number of objects that are returned.- Parameters:
startIndex- 0..n. The index of the first record is 0.count- 0..n. Use -1 to return all beginning from the startIndex- Returns:
- list of matching business objects
- See Also:
- API:
- This public API is available in Java.
-
resultsPaged
IPagedResult<V> resultsPaged()Gets the results page wise.You can use this method in a for each loop to iterate over the results:
for (V businessObject : query.executor().resultsPaged()) { System.out.println(businessObject); }You can use it to display the results in paged table on the UI:
public class MyLazyDataModel extends LazyDataModel<Car> { @ Override public List<Car> load(int first, int pageSize, Map<String, SortMeta> sortMeta, Map<String, FilterMeta> filterMeta) { return query.executor().resultsPaged().window(first, pageSize); } }This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The orderBy clauses (used to sort the resulting list)
query:- The groupBy clauses
- The aggregation (count, avg, min, max, sum) clauses
You can use this method to iterate over the results by reading and loading only part of them into memory at once. This allows you to iterate over huge data sets without loading all data into memory.
This method uses a default, system defined page size (1000) which does not harm memory and provides still good performance.
- Returns:
- paged result
- Since:
- 8.0.3
- See Also:
- API:
- This public API is available in Java.
-
resultsPaged
Gets the results page wise.You can use this method in a for each loop to iterate over the results:
for (V businessObject : query.executor().resultsPaged(100)) { System.out.println(businessObject); }You can use it to display the results in paged table on the UI:
public class MyLazyDataModel extends LazyDataModel<Car> { @ Override public List<Car> load(int first, int pageSize, Map<String, SortMeta> sortMeta, Map<String, FilterMeta> filterMeta) { return query.executor().resultsPaged(pageSize).window(first, pageSize); } }This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The orderBy clauses (used to sort the resulting list)
query:- The groupBy clauses
- The aggregation (count, avg, min, max, sum) clauses
You can use this method to iterate over the results by reading and loading only part of them into memory at once. This allows you to iterate over huge data sets without loading all data into memory.
- Parameters:
pageSize- the maximum number of results loaded at once into memory. On paged UI tables the number of objects you display on a single page.- Returns:
- paged result
- Since:
- 8.0.3
- See Also:
- API:
- This public API is available in Java.
-
firstResult
V firstResult()Gets the first business objects that matches the givenquery.This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The orderBy clauses (used to sort the resulting list)
This method ignores the following parts of the
query:- The groupBy clauses
- The aggregation (count, avg, min, max, sum) clauses
- Returns:
- first business object or null if no business object matches the
query - API:
- This public API is available in Java.
-
recordset
Recordset recordset()Gets aRecordsetwith all records that matches the givenquery. The returned columns depend on the givenquery:- If no
group byoraggregationis used, all columns of the table are returned. - If a
group byoraggregationis used, the columns that are specified in groupBy or aggregation (count, avg, min, max, sum) are returned.
- Returns:
- Recordset
- API:
- This public API is available in Java.
- If no
-
recordset
Gets aRecordsetwith the records that matches the givenquery. The returned columns depend on the givenquery:- If no
group byoraggregationis used, all columns of the table are returned. - If a
group byoraggregationis used, the columns that are specified in groupBy or aggregation (count, avg, min, max, sum) are returned.
The parameters
startIndexandcountcan be used to limit the number of objects that are returned.- Parameters:
startIndex- 0..n. The index of the first record is 0.count- 0..n. Use -1 to return all beginning from the startIndex- Returns:
- Recordset
- API:
- This public API is available in Java.
- If no
-
firstValue
Object firstValue()Gets the value of the first column and first record that matches the givenquery.The first column depends on the given
query:- If no
group byoraggregationis used, the first columns of the table is used. - If a
group byoraggregationis used, the first columns that are specified in groupBy or aggregation (count, avg, min, max, sum) is used.
- Returns:
- value of the first column and record that matches the given
query. If no matching record was foundnullis returned. - API:
- This public API is available in Java.
- If no
-
count
long count()Counts the number of rows or business objects that matches the query.This method considers the following parts of the
query:- The where clauses (used to filter the business objects)
- The groupBy clauses
This method ignores the following parts of the
query:- The orderBy clauses (used to sort the resulting list)
- The aggregation (count, avg, min, max, sum) clauses
- Returns:
- number of rows or business objects that matches the query
- API:
- This public API is available in Java.
-