Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.ibatis.sqlmap.client
Interface SqlMapExecutor  view SqlMapExecutor download SqlMapExecutor.java

All Known Subinterfaces:
SqlMapClient, SqlMapSession

public interface SqlMapExecutor

This interface declares all methods involved with executing statements and batches for an SQL Map.


Method Summary
 int delete(java.lang.String id, java.lang.Object parameterObject)
          Executes a mapped SQL DELETE statement.
 int executeBatch()
          Executes (flushes) all statements currently batched.
 java.lang.Object insert(java.lang.String id, java.lang.Object parameterObject)
          Executes a mapped SQL INSERT statement.
 java.util.List queryForList(java.lang.String id, java.lang.Object parameterObject)
          Executes a mapped SQL SELECT statement that returns data to populate a number of result objects.
 java.util.List queryForList(java.lang.String id, java.lang.Object parameterObject, int skip, int max)
          Executes a mapped SQL SELECT statement that returns data to populate a number of result objects within a certain range.
 java.util.Map queryForMap(java.lang.String id, java.lang.Object parameterObject, java.lang.String keyProp)
          Executes a mapped SQL SELECT statement that returns data to populate a number of result objects that will be keyed into a Map.
 java.util.Map queryForMap(java.lang.String id, java.lang.Object parameterObject, java.lang.String keyProp, java.lang.String valueProp)
          Executes a mapped SQL SELECT statement that returns data to populate a number of result objects from which one property will be keyed into a Map.
 java.lang.Object queryForObject(java.lang.String id, java.lang.Object parameterObject)
          Executes a mapped SQL SELECT statement that returns data to populate a single object instance.
 java.lang.Object queryForObject(java.lang.String id, java.lang.Object parameterObject, java.lang.Object resultObject)
          Executes a mapped SQL SELECT statement that returns data to populate the supplied result object.
 com.ibatis.common.util.PaginatedList queryForPaginatedList(java.lang.String id, java.lang.Object parameterObject, int pageSize)
          Executes a mapped SQL SELECT statement that returns data to populate a number of result objects a page at a time.
 void queryWithRowHandler(java.lang.String id, java.lang.Object parameterObject, com.ibatis.sqlmap.client.event.RowHandler rowHandler)
          Executes a mapped SQL SELECT statement that returns a number of result objects that will be handled one at a time by a RowHandler.
 void startBatch()
          Starts a batch in which update statements will be cached before being sent to the database all at once.
 int update(java.lang.String id, java.lang.Object parameterObject)
          Executes a mapped SQL UPDATE statement.
 

Method Detail

insert

public java.lang.Object insert(java.lang.String id,
                               java.lang.Object parameterObject)
                        throws java.sql.SQLException
Executes a mapped SQL INSERT statement. Insert is a bit different from other update methods, as it provides facilities for returning the primary key of the newly inserted row (rather than the effected rows). This functionality is of course optional.

The parameter object is generally used to supply the input data for the INSERT values.


update

public int update(java.lang.String id,
                  java.lang.Object parameterObject)
           throws java.sql.SQLException
Executes a mapped SQL UPDATE statement. Update can also be used for any other update statement type, such as inserts and deletes. Update returns the number of rows effected.

The parameter object is generally used to supply the input data for the UPDATE values as well as the WHERE clause parameter(s).


delete

public int delete(java.lang.String id,
                  java.lang.Object parameterObject)
           throws java.sql.SQLException
Executes a mapped SQL DELETE statement. Delete returns the number of rows effected.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the DELETE statement.


queryForObject

public java.lang.Object queryForObject(java.lang.String id,
                                       java.lang.Object parameterObject)
                                throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a single object instance.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForObject

public java.lang.Object queryForObject(java.lang.String id,
                                       java.lang.Object parameterObject,
                                       java.lang.Object resultObject)
                                throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate the supplied result object.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForList

public java.util.List queryForList(java.lang.String id,
                                   java.lang.Object parameterObject)
                            throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForList

public java.util.List queryForList(java.lang.String id,
                                   java.lang.Object parameterObject,
                                   int skip,
                                   int max)
                            throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects within a certain range.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryWithRowHandler

public void queryWithRowHandler(java.lang.String id,
                                java.lang.Object parameterObject,
                                com.ibatis.sqlmap.client.event.RowHandler rowHandler)
                         throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns a number of result objects that will be handled one at a time by a RowHandler.

This is generally a good approach to take when dealing with large sets of records (i.e. hundreds, thousands...) that need to be processed without eating up all of the system resources.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForPaginatedList

public com.ibatis.common.util.PaginatedList queryForPaginatedList(java.lang.String id,
                                                                  java.lang.Object parameterObject,
                                                                  int pageSize)
                                                           throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects a page at a time.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForMap

public java.util.Map queryForMap(java.lang.String id,
                                 java.lang.Object parameterObject,
                                 java.lang.String keyProp)
                          throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects that will be keyed into a Map.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


queryForMap

public java.util.Map queryForMap(java.lang.String id,
                                 java.lang.Object parameterObject,
                                 java.lang.String keyProp,
                                 java.lang.String valueProp)
                          throws java.sql.SQLException
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects from which one property will be keyed into a Map.

The parameter object is generally used to supply the input data for the WHERE clause parameter(s) of the SELECT statement.


startBatch

public void startBatch()
                throws java.sql.SQLException
Starts a batch in which update statements will be cached before being sent to the database all at once. This can improve overall performance of updates update when dealing with numerous updates (e.g. inserting 1:M related data).


executeBatch

public int executeBatch()
                 throws java.sql.SQLException
Executes (flushes) all statements currently batched.