Package lumis.util.query
Interface IQueryStatement
-
@StableMinor(version="14.2", sinceVersion="4.0") public interface IQueryStatement
Instances of this interface represents a statement that can be executed using this interface's method.- Since:
- 4.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
executeUpdate()
Execute the update or delete query statement.Object
getSingleResult()
Return a single instance that matches the query, or null if the query returns no results.int
getTotalRowCount()
Returns the total number of rows (ignoringsetMaxResults(int)
) available.List
list()
Return the query results as a List.IQueryStatement
setFirstResult(int firstResult)
Set the first row to retrieve.IQueryStatement
setMaxResults(int maxResults)
Set the maximum number of rows to retrieve.
-
-
-
Method Detail
-
executeUpdate
int executeUpdate() throws PortalException
Execute the update or delete query statement.- Returns:
- The number of entities updated or deleted.
- Throws:
PortalException
-
list
List list() throws PortalException
Return the query results as a List. The results of each row are returned in an instance of Object[].- Returns:
- the result list
- Throws:
PortalException
-
getSingleResult
Object getSingleResult() throws PortalException
Return a single instance that matches the query, or null if the query returns no results.- Returns:
- the single result or null
- Throws:
PortalException
- if there is more than one matching result
-
setMaxResults
IQueryStatement setMaxResults(int maxResults)
Set the maximum number of rows to retrieve. If not set, there is no limit to the number of rows retrieved.- Parameters:
maxResults
- the maximum number of rows
-
setFirstResult
IQueryStatement setFirstResult(int firstResult)
Set the first row to retrieve. If not set, rows will be retrieved beginning from row 0.- Parameters:
firstResult
- a row number, numbered from 0
-
getTotalRowCount
int getTotalRowCount() throws PortalException
Returns the total number of rows (ignoringsetMaxResults(int)
) available. For better performance, if the results will be accessed by thelist()
method, call thelist()
method first.- Throws:
PortalException
-
-