T
- the base class or interface to restrict all entities that are queried to.@ParametersAreNonnullByDefault public interface Queryable<T>
Entity
objects and selectable attributes of those objects.Modifier and Type | Method and Description |
---|---|
<E extends T> |
count(Class<E> type)
Initiates a query to count the number of entities of a given type.
|
Selection<? extends Scalar<Integer>> |
count(QueryAttribute<?,?>... attributes)
Initiates a query to count a given selection.
|
Deletion<? extends Scalar<Integer>> |
delete()
Initiates a delete query against this data store.
|
<E extends T> |
delete(Class<E> type)
Initiates an delete query for a type.
|
<E extends T> |
insert(Class<E> type)
Initiates an insert operation for a type.
|
<E extends T> |
raw(Class<E> type,
String query,
Object... parameters)
Executes a raw query against the data store mapping on to a specific entity type.
|
Result<Tuple> |
raw(String query,
Object... parameters)
Executes a raw query against the data store.
|
<E extends T> |
select(Class<E> type,
QueryAttribute<?,?>... attributes)
Initiates a query against a set of expression values return a specific entity type in a
Result . |
<E extends T> |
select(Class<E> type,
Set<? extends QueryAttribute<E,?>> attributes)
Initiates a query against a set of expression values return a specific entity type in a
Result . |
Selection<? extends Result<Tuple>> |
select(Expression<?>... expressions)
Initiates a query against a set of expression values.
|
Selection<? extends Result<Tuple>> |
select(Set<? extends Expression<?>> expressions)
Initiates a query against a set of expression values.
|
Update<? extends Scalar<Integer>> |
update()
Initiates an update query against this data store.
|
<E extends T> |
update(Class<E> type)
Initiates an update query for a type.
|
@CheckReturnValue <E extends T> Selection<? extends Result<E>> select(Class<E> type, QueryAttribute<?,?>... attributes)
Result
.E
- entity typetype
- of entityattributes
- to select (must of be of type E, not enforced due to erasure)@CheckReturnValue <E extends T> Selection<? extends Result<E>> select(Class<E> type, Set<? extends QueryAttribute<E,?>> attributes)
Result
.E
- entity typetype
- of entityattributes
- to select (must of be of type E, not enforced due to erasure)@CheckReturnValue <E extends T> Insertion<? extends Result<Tuple>> insert(Class<E> type)
Return.get()
to perform the operation. If the type has no generated key values the
result is a tuple containing a single element with the number of rows affected by the
operation. Otherwise if the type has generated keys those keys are returned as the result.E
- entity typetype
- of entity@CheckReturnValue <E extends T> Update<? extends Scalar<Integer>> update(Class<E> type)
Return.get()
to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.E
- entity typetype
- of entity@CheckReturnValue <E extends T> Deletion<? extends Scalar<Integer>> delete(Class<E> type)
Return.get()
to perform the operation. Note that aggregate delete queries
will not affect existing entity objects in memory or in the EntityCache
associated
with the store.E
- entity typetype
- of entity@CheckReturnValue <E extends T> Selection<? extends Scalar<Integer>> count(Class<E> type)
E
- entity typetype
- of entity@CheckReturnValue Selection<? extends Scalar<Integer>> count(QueryAttribute<?,?>... attributes)
attributes
- to select@CheckReturnValue Selection<? extends Result<Tuple>> select(Expression<?>... expressions)
expressions
- to select@CheckReturnValue Selection<? extends Result<Tuple>> select(Set<? extends Expression<?>> expressions)
expressions
- to select, cannot be null or empty@CheckReturnValue Update<? extends Scalar<Integer>> update()
Return.get()
to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.@CheckReturnValue Deletion<? extends Scalar<Integer>> delete()
Return.get()
to perform the operation. The result is the number of rows
affected by the call. Note that aggregate update queries will not affect existing entity
objects in memory.@CheckReturnValue Result<Tuple> raw(String query, Object... parameters)
query
- raw query to executeparameters
- query arguments, the number of arguments must match the number of place
holder values in the query or a PersistenceException
will be
thrown.Tuple
.@CheckReturnValue <E extends T> Result<E> raw(Class<E> type, String query, Object... parameters)
E
- entity typetype
- entity typequery
- raw query to executeparameters
- query arguments, the number of arguments must match the number of place
holder values in the query or a PersistenceException
will be
thrown.