R
- The record type being returned by this querypublic interface Select<R extends Record> extends ResultQuery<R>, TableLike<R>, FieldLike
Modifier and Type | Method and Description |
---|---|
Select<R> |
except(Select<? extends R> select)
Combine with other selects
|
int |
fetchCount()
Execute this query in the context of its attached executor and return
a
COUNT(*) value. |
List<Field<?>> |
getSelect()
All fields selected in this query
|
Select<R> |
intersect(Select<? extends R> select)
Combine with other selects
|
Select<R> |
union(Select<? extends R> select)
Combine with other selects
|
Select<R> |
unionAll(Select<? extends R> select)
Combine with other selects
|
bind, bind, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchAny, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArray, fetchArrays, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchGroups, fetchInto, fetchInto, fetchInto, fetchLater, fetchLater, fetchLazy, fetchLazy, fetchMany, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMap, fetchMaps, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOne, fetchOneArray, fetchOneInto, fetchOneInto, fetchOneMap, fetchResultSet, fetchSize, getRecordType, getResult, intern, intern, intern, keepStatement, maxRows, queryTimeout, resultSetConcurrency, resultSetHoldability, resultSetType
cancel, close, execute, getBindValues, getParam, getParams, getSQL, getSQL, getSQL, isExecutable
attach, detach
int fetchCount() throws DataAccessException
COUNT(*)
value.
This wraps a pre-existing SELECT
query in another one to
calculate the COUNT(*)
value, without modifying the original
SELECT
. An example:
This is particularly useful for those databases that do not
support the
-- Original query:
SELECT id, title FROM book WHERE title LIKE '%a%'
-- Wrapped query:
SELECT count(*) FROM (
SELECT id, title FROM book WHERE title LIKE '%a%'
)
COUNT(*) OVER()
window function to calculate
total results in paged queries.
COUNT(*)
resultDataAccessException
- if something went wrong executing the queryCopyright © 2014. All Rights Reserved.