Package com.aspectran.mybatis
Class SqlSessionFactoryBean
java.lang.Object
com.aspectran.mybatis.SqlSessionFactoryBean
- All Implemented Interfaces:
FactoryBean<org.apache.ibatis.session.SqlSessionFactory>
,InitializableBean
,InitializableFactoryBean<org.apache.ibatis.session.SqlSessionFactory>
,ApplicationAdapterAware
,Aware
@AvoidAdvice
public class SqlSessionFactoryBean
extends Object
implements ApplicationAdapterAware, InitializableFactoryBean<org.apache.ibatis.session.SqlSessionFactory>
FactoryBean
that creates an MyBatis SqlSessionFactory
using default MyBatis Configuration.-
Field Summary
Fields inherited from interface com.aspectran.core.component.bean.ablility.FactoryBean
FACTORY_METHOD_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.ibatis.session.SqlSessionFactory
buildSqlSessionFactory
(InputStream inputStream) org.apache.ibatis.session.SqlSessionFactory
Return an instance (possibly shared or independent) of the object managed by this factory.void
Invoke on initialization after it has set all bean properties supplied.void
setApplicationAdapter
(ApplicationAdapter applicationAdapter) void
setConfigLocation
(String configLocation) Set the location of the MyBatisSqlSessionFactory
config file.void
setEnvironment
(String environment) void
setProperties
(Properties properties) Set optional properties to be passed into the SqlSession configuration.
-
Constructor Details
-
SqlSessionFactoryBean
public SqlSessionFactoryBean()
-
-
Method Details
-
setConfigLocation
Set the location of the MyBatisSqlSessionFactory
config file.- Parameters:
configLocation
- the location of the MyBatisSqlSessionFactory
config file
-
setEnvironment
-
setProperties
Set optional properties to be passed into the SqlSession configuration.- Parameters:
properties
- the optional properties
-
buildSqlSessionFactory
protected org.apache.ibatis.session.SqlSessionFactory buildSqlSessionFactory(InputStream inputStream) throws Exception - Throws:
Exception
-
setApplicationAdapter
- Specified by:
setApplicationAdapter
in interfaceApplicationAdapterAware
-
initialize
Description copied from interface:InitializableBean
Invoke on initialization after it has set all bean properties supplied.- Specified by:
initialize
in interfaceInitializableBean
- Throws:
Exception
- if initialization fails
-
getObject
public org.apache.ibatis.session.SqlSessionFactory getObject()Description copied from interface:FactoryBean
Return an instance (possibly shared or independent) of the object managed by this factory. As with a BeanFactory, this allows support for both the Singleton and Prototype design pattern.- Specified by:
getObject
in interfaceFactoryBean<org.apache.ibatis.session.SqlSessionFactory>
- Returns:
- an instance of the bean (can be null)
-