本文共 646 字,大约阅读时间需要 2 分钟。
JPA很久之前就用过了, 没感觉出多好用,后来一直用MyBaits,感觉还好,最近中油的项目SOA架构里面,又用了JPA作为数据操作
工具了,顺便看看吧.
直接看个例子吧:
1.这个例子用idea做的,首先直接运行MyApplication.java运行后,可以看到数据库自动生成了.
2.里面的表也自动生成了
3.然后去执行JpaTest.java去测试就可以了
1.E:\ideaworkspace\spring-boot-jpa\src\main\resources\application.properties
########################################################### Spring datasource -- Datasource configuration.########################################################spring.datasource.url = jdbc:mysql://localhost:3306/jpa-test?characterEncoding=UTF-8spring.datasource.username = rootspring.datasource.password = 123456spring.datasource.driverClassName = com.mysql.jdbc.Driverspring.datasour
转载地址:http://pltdf.baihongyu.com/