Generated by
JDiff

org.springframework.orm.ibatis Documentation Differences

This file contains all the changes in documentation in the package org.springframework.orm.ibatis as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class SqlMapClientCallback

Callback interface for data access code that works with the iBATIS com.ibatis.sqlmap.client.SqlMapExecutor interface. To be used with SqlMapClientTemplate's execute method, assumably often as anonymous classes within a method implementation. @author Juergen Hoeller @since 24.02.2004 @see SqlMapClientTemplate @see org.springframework.jdbc.datasource.DataSourceTransactionManagerDataSourceTransactionManager @deprecated as of Spring 3.2, in favor of the native Spring support in the Mybatis follow-up project (http://code.google.com/p/mybatis/)

Class SqlMapClientFactoryBean

org.springframework.beans.factory.FactoryBean that creates an iBATIS com.ibatis.sqlmap.client.SqlMapClient. This is the usual way to set up a shared iBATIS SqlMapClient in a Spring application context; the SqlMapClient can then be passed to iBATIS-based DAOs via dependency injection.

Either org.springframework.jdbc.datasource.DataSourceTransactionManager or org.springframework.transaction.jta.JtaTransactionManager can be used for transaction demarcation in combination with a SqlMapClient, with JTA only necessary for transactions which span multiple databases.

Allows for specifying a DataSource at the SqlMapClient level. This is preferable to per-DAO DataSource references, as it allows for lazy loading and avoids repeated DataSource references in every DAO.

Note: As of Spring 2.5.5, this class (finally) requires iBATIS 2.3 or higher. The new "mappingLocations" feature requires iBATIS 2.3.2. @author Juergen Hoeller @since 24.02.2004 @see #setConfigLocation @see #setDataSource @see SqlMapClientTemplate#setSqlMapClient @see SqlMapClientTemplate#setDataSourcesetDataSource @deprecated as of Spring 3.2, in favor of the native Spring support in the Mybatis follow-up project (http://code.google.com/p/mybatis/)

Class SqlMapClientFactoryBean, void setDataSource(DataSource)

Set the DataSource to be used by iBATIS SQL Maps. This will be passed to the SqlMapClient as part of a TransactionConfig instance.

If specified, this will override corresponding settings in the SqlMapClient properties. Usually, you will specify DataSource and transaction configuration either here or in SqlMapClient properties.

Specifying a DataSource for the SqlMapClient rather than for each individual DAO allows for lazy loading, for example when using PaginatedList results.

With a DataSource passed in here, you don't need to specify one for each DAO. Passing the SqlMapClient to the DAOs is enough, as it already carries a DataSource. Thus, it's recommended to specify the DataSource at this central location only.

Thanks to Brandon Goodin from the iBATIS team for the hint on how to make this work with Spring's integration strategy! @see #setTransactionConfigClass @see #setTransactionConfigProperties @see com.ibatis.sqlmap.client.SqlMapClient#getDataSource @see SqlMapClientTemplate#setDataSource @see SqlMapClientTemplate#queryForPaginatedListsetDataSource


Class SqlMapClientOperations

Interface that specifies a basic set of iBATIS SqlMapClient operations, implemented by SqlMapClientTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Defines SqlMapClientTemplate's convenience methods that mirror the iBATIS com.ibatis.sqlmap.client.SqlMapExecutor's execution methods. Users are strongly encouraged to read the iBATIS javadocs for details on the semantics of those methods. @author Juergen Hoeller @since 24.02.2004 @see SqlMapClientTemplate @see com.ibatis.sqlmap.client.SqlMapClient @see com.ibatis.sqlmap.client.SqlMapExecutorSqlMapExecutor @deprecated as of Spring 3.2, in favor of the native Spring support in the Mybatis follow-up project (http://code.google.com/p/mybatis/)


Class SqlMapClientTemplate

Helper class that simplifies data access via the iBATIS com.ibatis.sqlmap.client.SqlMapClient API, converting checked SQLExceptions into unchecked DataAccessExceptions, following the org.springframework.dao exception hierarchy. Uses the same org.springframework.jdbc.support.SQLExceptionTranslator mechanism as org.springframework.jdbc.core.JdbcTemplate.

The main method of this class executes a callback that implements a data access action. Furthermore, this class provides numerous convenience methods that mirror com.ibatis.sqlmap.client.SqlMapExecutor's execution methods.

It is generally recommended to use the convenience methods on this template for plain query/insert/update/delete operations. However, for more complex operations like batch updates, a custom SqlMapClientCallback must be implemented, usually as anonymous inner class. For example:

 getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
 	 public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
 		 executor.startBatch();
 		 executor.update("insertSomething", "myParamValue");
 		 executor.update("insertSomethingElse", "myOtherParamValue");
 		 executor.executeBatch();
 		 return null;
 	 }
 });
The template needs a SqlMapClient to work on, passed in via the "sqlMapClient" property. A Spring context typically uses a SqlMapClientFactoryBean to build the SqlMapClient. The template an additionally be configured with a DataSource for fetching Connections, although this is not necessary if a DataSource is specified for the SqlMapClient itself (typically through SqlMapClientFactoryBean's "dataSource" property). @author Juergen Hoeller @since 24.02.2004 @see #execute @see #setSqlMapClient @see #setDataSource @see #setExceptionTranslator @see SqlMapClientFactoryBean#setDataSource @see com.ibatis.sqlmap.client.SqlMapClient#getDataSource @see com.ibatis.sqlmap.client.SqlMapExecutorSqlMapExecutor @deprecated as of Spring 3.2, in favor of the native Spring support in the Mybatis follow-up project (http://code.google.com/p/mybatis/)