emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Refactor org.mybatis.spring.SqlSessionFactoryBean to support extensibility #128

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
3.0.2

Please describe the problem.  Unit tests are best!
I'd like to extend MyBatis by wrapping the Configuration class with my own, 
however this is difficult with the current implementation of 
SqlSessionFactoryBean.

What is the expected output? What do you see instead?
I would prefer to see the buildSqlSessionFactory() refactored into several 
methods: buildConfiguration(..), buildEnvironment(..), 
buildTransactionFactory(..), etc.

Please provide any additional information below.

Original issue reported on code.google.com by posth...@gmail.com on 5 Oct 2010 at 9:45

GoogleCodeExporter commented 9 years ago

Original comment by putthibo...@gmail.com on 6 Oct 2010 at 5:31

GoogleCodeExporter commented 9 years ago
hi posthour,

could you provide a patch for this?

btw, why do you want to wrap MyBatis configuration class?

Original comment by eduardo.macarron on 13 Oct 2010 at 9:37

GoogleCodeExporter commented 9 years ago
What exactly does your Configuration have that the base implementation doesn't? 
I am trying to understand the use case.

SqlSessionFactoryBean has a configurationProperties property that is passed 
into the Configuration. This acts like the <properties> element in the MyBatis 
config file.You can also set the TransactionFactory class and properties and 
the DataSource. As for the environment, SqlSessionFactory _ignores_ whatever is 
set in the Configuration and overwrites it so that we can be sure the correct 
TransactionFactory and DataSource are passed into MyBatis.

Original comment by hpresnall@gmail.com on 15 Oct 2010 at 3:59

GoogleCodeExporter commented 9 years ago
No more info provided. Issued closed, will open it again if necessary.

Original comment by eduardo.macarron on 30 Oct 2010 at 9:15