Package lumis.util.query
Interface IQueryStatement
-
@StableMinor(version="16.0", 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: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
executeUpdate()
Execute the update or delete query statement.java.lang.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.java.util.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
java.util.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
java.lang.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
-
-