Interface IQueryStatement


  • @StableMinor(version="14.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: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
    • 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