public.javadoc.org.spincast.plugins.jdbc.statements.SelectStatement.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SelectStatement (org.spincast:spincast-framework 1.0.0 API)
org.spincast.plugins.jdbc.statements
Interface SelectStatement
-
- All Superinterfaces:
- Statement
- All Known Implementing Classes:
- SelectStatementDefault
public interface SelectStatement
extends Statement
-
-
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
<T> List<T>
selectList(ResultSetHandler<T> resultSetHandler)
<T> ItemsAndTotalCount<T>
selectListAndTotal(ResultSetHandler<T> resultSetHandler)
Executes the SELECT query but also returns the total of items.
<T> T
selectOne(ResultSetHandler<T> resultSetHandler)
-
Methods inherited from interface org.spincast.plugins.jdbc.statements.Statement
clearSql, clearSql, getSql, setBoolean, setDate, setDouble, setFloat, setInInteger, setInLong, setInstant, setInString, setInStringFromEnumNames, setInStringFromEnumNames, setInteger, setLong, setLongList, setString, sql
-
-
Method Detail
-
selectList
<T> List<T> selectList(ResultSetHandler<T> resultSetHandler)
-
selectListAndTotal
<T> ItemsAndTotalCount<T> selectListAndTotal(ResultSetHandler<T> resultSetHandler)
Executes the SELECT query but also returns the total of items.
It will remove the LIMIT clause if there is one to compute the total.
For the generated "total" query to work there are a couple of rules :
- The original query MUST start with SELECT and contains a FROM. All conditions between this SELECT keyword and
the FROM keyword will be removed and replaced by a COUNT(*).
- If the query contains a LIMIT clause, the last occurence will be remove and everything after it too.
If your query doesn't meet those rules, you'll have to retrieve the total another way...
-
selectOne
<T> T selectOne(ResultSetHandler<T> resultSetHandler)
Copyright © 2019. All rights reserved.