本文整理汇总了Java中tk.mybatis.spring.mapper.MapperScannerConfigurer类的典型用法代码示例。如果您正苦于以下问题:Java MapperScannerConfigurer类的具体用法?Java MapperScannerConfigurer怎么用?Java MapperScannerConfigurer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapperScannerConfigurer类属于tk.mybatis.spring.mapper包,在下文中一共展示了MapperScannerConfigurer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapperScannerConfigurer
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
/**
* 扫描跑mapper包下的所有接口,作为mybatis接口类,并注册为spring的bean
*/
/*@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
scannerConfigurer.setAddToConfig(true);
scannerConfigurer.setBasePackage("com.fly.**.mapper");
return scannerConfigurer;
}*/
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
scannerConfigurer.setBasePackage("com.fly.**.mapper");
Properties props = new Properties();
props.setProperty("mappers", "tk.mybatis.mapper.common.Mapper");
props.setProperty("IDENTITY", "MYSQL");
props.setProperty("notEmpty", "true");
scannerConfigurer.setProperties(props);
return scannerConfigurer;
}
示例2: createScannerConfigurerBean
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
protected final AbstractBeanDefinition createScannerConfigurerBean(String sqlSessionFactoryName, String basepackage,
Mapper mappers, Order order,Style style) {
BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(MapperScannerConfigurer.class);
Properties properties = new Properties();
if(style!=null){
properties.setProperty("style", style.name());
}
properties.setProperty("notEmpty", "true");
properties.setProperty("ORDER", order != null ? order.order : Order.BEFORE.order);
properties.setProperty("mappers", mappers != null ? mappers.mapper : Mapper.DEFAULT.mapper);
bdb.addPropertyValue("properties", properties);
bdb.addPropertyValue("sqlSessionFactoryBeanName", sqlSessionFactoryName);
bdb.addPropertyValue("basePackage", basepackage);
return bdb.getRawBeanDefinition();
}
示例3: getMapperScannerConfigurer
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
@Bean
public MapperScannerConfigurer getMapperScannerConfigurer(){
MapperScannerConfigurer configurer=new MapperScannerConfigurer();
configurer.setBasePackage("com.egojit.easyweb.**.mapper");
Properties properties=new Properties();
properties.put("mappers","tk.mybatis.mapper.common.Mapper");
configurer.setProperties(properties);
return configurer;
}
示例4: mapperScannerConfigurer
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
scannerConfigurer.setBasePackage("com.tangcheng.datasources.aop.mapper");
Properties props = new Properties();
props.setProperty("IDENTITY", "MYSQL");
props.setProperty("notEmpty", "true");
scannerConfigurer.setProperties(props);
scannerConfigurer.setMarkerInterface(BaseMapper.class);
return scannerConfigurer;
}
示例5: getMapperConfig
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
@Bean
public MapperScannerConfigurer getMapperConfig() {
MapperScannerConfigurer config = new MapperScannerConfigurer();
config.setSqlSessionFactoryBeanName("sqlSessionFactory");
config.setBasePackage("seed.**.mapper");
Properties props = new Properties();
props.setProperty("mappers", BaseMapper.class.getName());
props.setProperty("notEmpty", "false");
//props.setProperty("IDENTITY", "MYSQL");
config.setProperties(props);
return config;
}
示例6: mapperScannerConfigurer
import tk.mybatis.spring.mapper.MapperScannerConfigurer; //导入依赖的package包/类
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer scannerConfigurer = new MapperScannerConfigurer();
scannerConfigurer.setBasePackage("com.huan.mapper");
Properties props = new Properties();
props.setProperty("mappers", "tk.mybatis.mapper.common.Mapper");
props.setProperty("IDENTITY", "MYSQL");
props.setProperty("notEmpty", "true");
scannerConfigurer.setProperties(props);
return scannerConfigurer;
}