org.apache.cayenne.access.jdbc

## Class BaseSQLAction

- java.lang.Object
- - org.apache.cayenne.access.jdbc.BaseSQLAction

- All Implemented Interfaces:
    SQLAction
  Direct Known Subclasses:
    BatchAction, EJBQLAction, ProcedureAction, SelectAction

      public abstract class BaseSQLAction
      extends Object
      implements SQLAction

  A convenience superclass for SQLAction implementations.
  Since:
    1.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected JdbcAdapter` | `adapter`
    `protected EntityResolver` | `entityResolver`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseSQLAction(JdbcAdapter adapter, EntityResolver entityResolver)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JdbcAdapter` | `getAdapter()`
    `EntityResolver` | `getEntityResolver()`
    `protected int` | `getInMemoryOffset(int queryOffset)` Returns a value of the offset that will be used to rewind the ResultSet within the SQL action before reading the result rows.
    `protected void` | `readResultSet(ResultSet resultSet, RowDescriptor descriptor, Query query, OperationObserver delegate)` Helper method to process a ResultSet.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.cayenne.query.SQLAction

      `performAction`

- - ### Field Detail

    - #### adapter

          protected JdbcAdapter adapter

    - #### entityResolver

          protected EntityResolver entityResolver

  - ### Constructor Detail

    - #### BaseSQLAction

          public BaseSQLAction(JdbcAdapter adapter,
                       EntityResolver entityResolver)

  - ### Method Detail

    - #### getAdapter

          public JdbcAdapter getAdapter()

    - #### getEntityResolver

          public EntityResolver getEntityResolver()

    - #### readResultSet

          protected void readResultSet(ResultSet resultSet,
                           RowDescriptor descriptor,
                           Query query,
                           OperationObserver delegate)
                                throws SQLException,
                                       Exception

      Helper method to process a ResultSet.
      Throws:
        `SQLException`
        `Exception`

    - #### getInMemoryOffset

          protected int getInMemoryOffset(int queryOffset)

      Returns a value of the offset that will be used to rewind the ResultSet within the SQL action before reading the result rows. The default implementation returns 'queryOffset' argument. If the adapter supports setting offset at the SQL level, this method must be overridden to return zero to suppress manual offset.
      Since:
        3.0

Copyright © 2001–2014 Apache Cayenne. All rights reserved.