标签:标准 connect default drive depend 配置 style spring start
1.Spring-Data-Jpa
JPA定义了对象持久化的标准。
目前实现了有Hibernate,TopLink
2.pom添加依赖
1 <dependency> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-starter-data-jpa</artifactId> 4 </dependency> 5 6 <dependency> 7 <groupId>mysql</groupId> 8 <artifactId>mysql-connector-java</artifactId> 9 </dependency>
3.对jps进行配置
1 spring: 2 profiles: 3 active: dev 4 datasource: 5 driver-class-name: com.mysql.jdbc.Driver 6 url: jdbc:mysql://127.0.0.1:3306/people 7 data-username:root 8 username: 12345678 9 jpa: 10 hibernate: 11 ddl-auto: update 12 show-sql: true
4.新建一个people的数据库
CREATE DATABASE IF NOT EXISTS yiibaidb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
5.
标签:标准 connect default drive depend 配置 style spring start
原文地址:http://www.cnblogs.com/juncaoit/p/7789034.html