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.
  • Constructor Details

    • SqlSessionFactoryBean

      public SqlSessionFactoryBean()
  • Method Details

    • setConfigLocation

      public void setConfigLocation(String configLocation)
      Set the location of the MyBatis SqlSessionFactory config file.
      Parameters:
      configLocation - the location of the MyBatis SqlSessionFactory config file
    • setEnvironment

      public void setEnvironment(String environment)
    • setProperties

      public void setProperties(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(InputStream inputStream) throws Exception
      Throws:
      Exception
    • setApplicationAdapter

      public void setApplicationAdapter(@NonNull ApplicationAdapter applicationAdapter)
      Specified by:
      setApplicationAdapter in interface ApplicationAdapterAware
    • initialize

      public void initialize() throws Exception
      Description copied from interface: InitializableBean
      Invoke on initialization after it has set all bean properties supplied.
      Specified by:
      initialize in interface InitializableBean
      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 interface FactoryBean<org.apache.ibatis.session.SqlSessionFactory>
      Returns:
      an instance of the bean (can be null)