lumis.util.query
Interface IQueryStatement

Package class diagram package IQueryStatement

@StableMinor(version="5.5",
             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

Method Summary
 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 (ignoring setMaxResults(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. If the query contains multiple results per row, the results 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 beginnning from row 0.

Parameters:
firstResult - a row number, numbered from 0

getTotalRowCount

int getTotalRowCount()
                     throws PortalException
Returns the total number of rows (ignoring setMaxResults(int)) available. For better performance, if the results will be accessed by the list() method, call the list() method first.

Throws:
PortalException


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.