本文整理汇总了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;
}
开发者ID:heikehuan,项目名称:fly4j,代码行数:22,代码来源:MybatisConfiguration.java
示例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();
}
开发者ID:halober,项目名称:spring-boot-starter-dao,代码行数:16,代码来源:AbstractDataBaseBean.java
示例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;
}
开发者ID:egojit8,项目名称:easyweb,代码行数:10,代码来源:MybatisConfig.java
示例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;
}
开发者ID:helloworldtang,项目名称:springboot-multi-datasource,代码行数:12,代码来源:MyBatisConfig.java
示例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;
}
开发者ID:mazhaoyong,项目名称:api-server-seed,代码行数:13,代码来源:MybatisConfig.java
示例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;
}
开发者ID:heikehuan,项目名称:springboot-multiple-dataSources,代码行数:12,代码来源:MyBatisConfig.java
注:本文中的tk.mybatis.spring.mapper.MapperScannerConfigurer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论