Skip to content

Commit ba27f47

Browse files
committed
updated javadoc
1 parent 23d3b55 commit ba27f47

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

src/main/java/org/mybatis/spring/support/SqlSessionDaoSupport.java

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,11 @@
2222
import org.springframework.util.Assert;
2323

2424
/**
25-
* Convenient super class for MyBatis SqlSession data access objects. In the usual case, all that a
26-
* DAO needs is an SqlSessionFactory. This class also supports passing in an SqlSessionTemplate if a
27-
* custom DataSource or ExceptionTranslator is needed for a specific DAO.
25+
* Convenient super class for MyBatis SqlSession data access objects.
26+
* It gives you access to the template which can then be used to execute SQL methods.
2827
* <p>
29-
*
30-
* By default, each DAO gets its own SqlSessionTemplate which holds the SqlSessionFactory.
31-
* SqlSessionTemplate is thread safe, so a single instance can be shared by all DAOs; there
32-
* should also be a small memory savings by doing this. To support a shared template, this class has
33-
* a constructor that accepts an SqlSessionTemplate. This pattern can be used in Spring
34-
* configuration files as follows:
35-
*
36-
* <pre class="code">
37-
* {@code
38-
* <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
39-
* <property name="sqlSessionFactory" ref="sqlSessionFactory" />
40-
* </bean>
41-
*
42-
* <bean id="baseDAO" abstract="true" lazy-init="true">
43-
* <property name="sqlSessionTemplate" ref="sqlSessionTemplate" />
44-
* </bean>
45-
*
46-
* <bean id="testDao" parent="baseDAO" class="org.mybatis.spring.support.SqlSessionDaoSupport" />
47-
* }
48-
* </pre>
28+
* This class needs a SqlSessionTemplate or a SqlSessionFactory.
29+
* If both are set the SqlSessionFactory will be ignored.
4930
*
5031
* @see #setSqlSessionFactory
5132
* @see #setSqlSessionTemplate

0 commit comments

Comments
 (0)