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>
FactoryBean
that creates an MyBatisSqlSessionFactory
using 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.SqlSessionFactory
buildSqlSessionFactory(java.io.File configFile)
org.apache.ibatis.session.SqlSessionFactory
getObject()
Return an instance (possibly shared or independent) of the object managed by this factory.void
initialize()
Invoke on initialization after it has set all bean properties supplied.void
setApplicationAdapter(ApplicationAdapter applicationAdapter)
void
setConfigLocation(java.lang.String configLocation)
Set the location of the MyBatisSqlSessionFactory
config file.void
setEnvironment(java.lang.String environment)
void
setProperties(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 MyBatisSqlSessionFactory
config file.- Parameters:
configLocation
- the location of the MyBatisSqlSessionFactory
config 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.File configFile)
-
setApplicationAdapter
public void setApplicationAdapter(ApplicationAdapter applicationAdapter)
- Specified by:
setApplicationAdapter
in interfaceApplicationAdapterAware
-
initialize
public void initialize() throws java.lang.Exception
Description copied from interface:InitializableBean
Invoke on initialization after it has set all bean properties supplied.- Specified by:
initialize
in interfaceInitializableBean
- Throws:
java.lang.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)
-
-