1.引入 javaee maven 依赖,scope填写provided 否则会包冲突
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0.1</version>
<scope>provided</scope>
</dependency>
2.在项目配置 modules中添加JPA

3.在View中开启persistence窗口

4.选择Database

5.勾选表,包名生成

网友评论