@@ -15,16 +15,20 @@ public class SqlSessionManager implements SqlSessionFactory, SqlSession {
15
15
16
16
private ThreadLocal <SqlSession > localSqlSession = new ThreadLocal <SqlSession >();
17
17
18
- public SqlSessionManager (Reader reader ) {
19
- this (new SqlSessionFactoryBuilder ().build (reader , null , null ));
18
+ private SqlSessionManager (Reader reader , Properties properties ) {
19
+ this (new SqlSessionFactoryBuilder ().build (reader , null , properties ));
20
20
}
21
21
22
- public SqlSessionManager (Reader reader , String environment ) {
23
- this (new SqlSessionFactoryBuilder ().build (reader , environment , null ));
22
+ public static SqlSessionManager newInstance (Reader reader ) {
23
+ return new SqlSessionManager (new SqlSessionFactoryBuilder ().build (reader , null , null ));
24
24
}
25
25
26
- public SqlSessionManager (Reader reader , Properties properties ) {
27
- this (new SqlSessionFactoryBuilder ().build (reader , null , properties ));
26
+ public static SqlSessionManager newInstance (Reader reader , String environment ) {
27
+ return new SqlSessionManager (new SqlSessionFactoryBuilder ().build (reader , environment , null ));
28
+ }
29
+
30
+ public static SqlSessionManager newInstance (Reader reader , Properties properties ) {
31
+ return new SqlSessionManager (new SqlSessionFactoryBuilder ().build (reader , null , properties ));
28
32
}
29
33
30
34
public SqlSessionManager (SqlSessionFactory sqlSessionFactory ) {
0 commit comments