spring-boot集成spring-data-jpa

参考这个就行,

http://blog.csdn.net/wazz753/article/details/72472411

ps:集成过程中pom文件,我加入的内容如下,两个都需要,实体类记得加注解和主键id生成方式

<!--spring-data-jpa-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>1.5.6.RELEASE</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.persistence/persistence-api -->
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0.2</version>
        </dependency>

 

posted @ 2018-01-23 17:32  君子笑而不语  阅读(188)  评论(0编辑  收藏  举报