jhipster集成mybatis框架

  jhipster内置好了JPA的那套ORM框架,普通类型数据一行命令就能搞定简单的CURD,但面对复杂的多表关联查询时,还是选择mybatis更加方便。

1.在pom文件中添加mybatis的依赖:

    <dependency>
           <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.1</version>
        </dependency>

 

2.在配置文件application-dev中添加mybatis的配置:

mybatis:
    #指定*Mapper.xml中使用的对象的包的位置(同时可以指定别名)
    type-aliases-package: com.xxx.web.entity
    #指定*Mapper.xml的位置
    mapper-locations: classpath:mapper/*.xml

3.配置本地数据源

到目前配置工作就完成了,接下来就是编码的工作了。

posted @ 2018-07-04 14:38  chenfq  阅读(1218)  评论(0编辑  收藏  举报