All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jeesuite.mybatis.spring.MapperScannerConfigurer Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/**
 * 
 */
package com.jeesuite.mybatis.spring;

import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.context.ApplicationContext;

import com.jeesuite.mybatis.crud.GeneralSqlGenerator;

/**
 * @description 
* @author vakin * @date 2015年12月17日 * @Copyright (c) 2015, jwww */ public class MapperScannerConfigurer extends org.mybatis.spring.mapper.MapperScannerConfigurer{ private ApplicationContext context; private String sqlSessionFactoryName; @Override public void setApplicationContext(ApplicationContext applicationContext) { super.setApplicationContext(applicationContext); this.context = applicationContext; } @Override public void setSqlSessionFactoryBeanName(String sqlSessionFactoryName) { super.setSqlSessionFactoryBeanName(sqlSessionFactoryName); this.sqlSessionFactoryName = sqlSessionFactoryName; } @Override public void afterPropertiesSet() throws Exception { super.afterPropertiesSet(); SqlSessionFactory sqlSessionFactory = context.getBean(sqlSessionFactoryName, SqlSessionFactory.class); Configuration configuration = sqlSessionFactory.getConfiguration(); // new GeneralSqlGenerator(configuration).generate(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy