com.neeve.query
Interface Query<REC>

All Known Subinterfaces:
IStoreQuery, RogLogQuery

public interface Query<REC>

The Query is used to build a query that can be executed against a QueryEngine. Querys should be created through the QueryEngine against which they will be executed.


Nested Class Summary
static class Query.SortOrder
          Enumerates valid sort orders.
 
Method Summary
 Query<REC> distinct()
          Indicate that only DISTINCT results should be returned.
 Query<REC> from(QueryRepository<?,REC> repository)
          Indicates the repository from which to select.
 Query<REC> from(String repositoryName)
          Indicates the name of the repository from which to select. repositoryName may be either the name of the QueryRepository as returned by QueryRepository.getName() or by an alias with which it was registered when added to the QueryEngine.addRepository(QueryRepository, String)
<T> Query<REC>
groupBy(IdxField<REC,T> field)
          Adds an IdxField to the group-by clause of the query.
 Query<REC> having(Predicate<REC> predicate)
          Indicates the predicate to apply against the aggregated result set.
 Query<REC> limit(int high)
          Restrict the number of rows to be less than or equal to high.
 Query<REC> limit(int low, int high)
          Restrict the number of rows to be strictly greater than low and less than or equal to high.
<T> Query<REC>
orderBy(IdxField<REC,T> field)
          Indicate that the result set should be ordered by this field's value in ascending order.
<T> Query<REC>
orderBy(IdxField<REC,T> field, Query.SortOrder sortOrder)
          Indicate that the result set should be ordered by this field's value.
<T> Query<REC>
select(IdxField<REC,T> field)
          Indicates that a particular field should be selected in the the QueryResult.
 Query<REC> where(Predicate<REC> predicate)
          Indicates the predicate to apply against the result set.
 

Method Detail

select

<T> Query<REC> select(IdxField<REC,T> field)
Indicates that a particular field should be selected in the the QueryResult.

Parameters:
field - The field from the class on which to select.
Returns:
This Query for invocation chaining.

distinct

Query<REC> distinct()
Indicate that only DISTINCT results should be returned.

Returns:
This Query for invocation chaining.

from

Query<REC> from(QueryRepository<?,REC> repository)
Indicates the repository from which to select.

Parameters:
repository - The repository from which to select
Returns:
This Query for invocation chaining.

from

Query<REC> from(String repositoryName)
Indicates the name of the repository from which to select. repositoryName may be either the name of the QueryRepository as returned by QueryRepository.getName() or by an alias with which it was registered when added to the QueryEngine.addRepository(QueryRepository, String)

Parameters:
repositoryName - The name or alias of a repository from which to select.
Returns:
This Query for invocation chaining.

where

Query<REC> where(Predicate<REC> predicate)
Indicates the predicate to apply against the result set.

Parameters:
predicate - Set the predicate used to select.
Returns:
This Query for invocation chaining.

orderBy

<T> Query<REC> orderBy(IdxField<REC,T> field,
                       Query.SortOrder sortOrder)
Indicate that the result set should be ordered by this field's value. Note that additional calls to orderBy() will result in sorting the result set by each of these fields successively.

Parameters:
field - The field by which to order results.
sortOrder - The order by which to sort results.
Returns:
This Query for invocation chaining.

orderBy

<T> Query<REC> orderBy(IdxField<REC,T> field)
Indicate that the result set should be ordered by this field's value in ascending order. This is equivalent to calling orderBy(field, SortOrder.ASCENDING), and is provided purely as a convenience method.

Parameters:
field - The field by which to order results.
Returns:
This Query for invocation chaining.

groupBy

<T> Query<REC> groupBy(IdxField<REC,T> field)
Adds an IdxField to the group-by clause of the query.

Parameters:
field - The field by which to group.
Returns:
This Query for invocation chaining.

having

Query<REC> having(Predicate<REC> predicate)
Indicates the predicate to apply against the aggregated result set.

Parameters:
predicate - Set the predicate used to select.
Returns:
This Query for invocation chaining.

limit

Query<REC> limit(int low,
                 int high)
Restrict the number of rows to be strictly greater than low and less than or equal to high.

Parameters:
low - the lower limit, inclusive.
high - the upper limit, inclusive.

limit

Query<REC> limit(int high)
Restrict the number of rows to be less than or equal to high. This is equivalent to calling limit(0,high) and is provided purely as a convenience method.

Parameters:
high - The upper limit, inclusive.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.