Package com.aspectran.mybatis
Class SqlSessionFactoryBean
- java.lang.Object
-
- com.aspectran.mybatis.SqlSessionFactoryBean
-
- All Implemented Interfaces:
FactoryBean<org.apache.ibatis.session.SqlSessionFactory>,InitializableBean,ApplicationAdapterAware,Aware
@AvoidAdvice public class SqlSessionFactoryBean extends java.lang.Object implements ApplicationAdapterAware, InitializableBean, FactoryBean<org.apache.ibatis.session.SqlSessionFactory>
FactoryBeanthat creates an MyBatisSqlSessionFactoryusing default MyBatis Configuration.
-
-
Field Summary
-
Fields inherited from interface com.aspectran.core.component.bean.ablility.FactoryBean
FACTORY_METHOD_NAME
-
-
Constructor Summary
Constructors Constructor Description SqlSessionFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.ibatis.session.SqlSessionFactorybuildSqlSessionFactory(java.io.InputStream inputStream)org.apache.ibatis.session.SqlSessionFactorygetObject()Return an instance (possibly shared or independent) of the object managed by this factory.voidinitialize()Invoke on initialization after it has set all bean properties supplied.voidsetApplicationAdapter(ApplicationAdapter applicationAdapter)voidsetConfigLocation(java.lang.String configLocation)Set the location of the MyBatisSqlSessionFactoryconfig file.voidsetEnvironment(java.lang.String environment)voidsetProperties(java.util.Properties properties)Set optional properties to be passed into the SqlSession configuration.
-
-
-
Method Detail
-
setConfigLocation
public void setConfigLocation(java.lang.String configLocation)
Set the location of the MyBatisSqlSessionFactoryconfig file.- Parameters:
configLocation- the location of the MyBatisSqlSessionFactoryconfig file
-
setEnvironment
public void setEnvironment(java.lang.String environment)
-
setProperties
public void setProperties(java.util.Properties properties)
Set optional properties to be passed into the SqlSession configuration.- Parameters:
properties- the optional properties
-
buildSqlSessionFactory
protected org.apache.ibatis.session.SqlSessionFactory buildSqlSessionFactory(java.io.InputStream inputStream)
-
setApplicationAdapter
public void setApplicationAdapter(ApplicationAdapter applicationAdapter)
- Specified by:
setApplicationAdapterin interfaceApplicationAdapterAware
-
initialize
public void initialize() throws java.lang.ExceptionDescription copied from interface:InitializableBeanInvoke on initialization after it has set all bean properties supplied.- Specified by:
initializein interfaceInitializableBean- Throws:
java.lang.Exception- if initialization fails
-
getObject
public org.apache.ibatis.session.SqlSessionFactory getObject()
Description copied from interface:FactoryBeanReturn 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:
getObjectin interfaceFactoryBean<org.apache.ibatis.session.SqlSessionFactory>- Returns:
- an instance of the bean (can be null)
-
-