Interface Query<R>
public interface Query<R>
Represents a sharable object which performs a query against a table. Queries might require
additional arguments to be supplied, as required by the original query expression.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
anyRows
(Transaction txn, Object... args) Returns true if this query produces any rows.default boolean
anyRows
(R row, Transaction txn, Object... args) Returns true if this query produces any rows.int
Returns the minimum amount of arguments needed by this query.default long
deleteAll
(Transaction txn, Object... args) Deletes all rows specified by this query.newScanner
(Transaction txn, Object... args) Returns a new scanner for all the rows of this query.newScanner
(R row, Transaction txn, Object... args) Returns a new scanner for all the rows of this query.newStream
(Transaction txn, Object... args) Returns a new stream for all the rows of this query.newUpdater
(Transaction txn, Object... args) Returns a new updater for all the rows of this query.newUpdater
(R row, Transaction txn, Object... args) Returns a new updater for all the rows of this query.rowType()
Returns the interface which defines the rows of this query.scannerPlan
(Transaction txn, Object... args) Returns a query plan used bynewScanner
.default QueryPlan
streamPlan
(Transaction txn, Object... args) Returns a query plan used bynewStream
.default QueryPlan
updaterPlan
(Transaction txn, Object... args) Returns a query plan used bynewUpdater
.
-
Method Details
-
rowType
-
argumentCount
int argumentCount()Returns the minimum amount of arguments needed by this query. -
newScanner
Returns a new scanner for all the rows of this query.- Parameters:
txn
- optional transaction for the scanner to use; pass null for auto-commit modeargs
- arguments required by this query- Returns:
- a new scanner positioned at the first row in the table accepted by the query
- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
-
newScanner
Returns a new scanner for all the rows of this query.- Parameters:
row
- row instance for the scanner to use; pass null to create a new instancetxn
- optional transaction for the scanner to use; pass null for auto-commit modeargs
- arguments required by this query- Returns:
- a new scanner positioned at the first row in the table accepted by the query
- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
-
newUpdater
Returns a new updater for all the rows of this query.- Parameters:
txn
- optional transaction for the updater to use; pass null for auto-commit modeargs
- arguments required by this query- Returns:
- a new updater positioned at the first row in the table accepted by the query
- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
-
newUpdater
Returns a new updater for all the rows of this query.- Parameters:
row
- row instance for the updater to use; pass null to create a new instancetxn
- optional transaction for the updater to use; pass null for auto-commit modeargs
- arguments required by this query- Returns:
- a new updater positioned at the first row in the table accepted by the query
- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
-
newStream
Returns a new stream for all the rows of this query.- Parameters:
txn
- optional transaction for the stream to use; pass null for auto-commit modeargs
- arguments required by this query- Returns:
- a new stream positioned at the first row in the table accepted by the query
- Throws:
IllegalStateException
- if transaction belongs to another database instance
-
deleteAll
Deletes all rows specified by this query.- Parameters:
txn
- optional transaction to use; pass null for auto-commit mode against each rowargs
- arguments required by this query- Returns:
- the amount of rows deleted
- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
-
anyRows
Returns true if this query produces any rows.- Parameters:
txn
- optional transaction to use; pass null for auto-commit modeargs
- arguments required by this query- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
- See Also:
-
anyRows
Returns true if this query produces any rows.- Parameters:
row
- row instance for the implementation to use; pass null to create a new instance if necessarytxn
- optional transaction to use; pass null for auto-commit modeargs
- arguments required by this query- Throws:
IllegalStateException
- if transaction belongs to another database instanceIOException
- See Also:
-
scannerPlan
Returns a query plan used bynewScanner
.- Parameters:
txn
- optional transaction to be used; pass null for auto-commit modeargs
- optional query arguments- Throws:
IOException
-
updaterPlan
Returns a query plan used bynewUpdater
.- Parameters:
txn
- optional transaction to be used; pass null for auto-commit modeargs
- optional query arguments- Throws:
IOException
-
streamPlan
Returns a query plan used bynewStream
.- Parameters:
txn
- optional transaction to be used; pass null for auto-commit modeargs
- optional query arguments- Throws:
IOException
-