在 persistence.xml 文件中同步持久性类

创建持久性类之后,您可以将它们自动添加至 persistence.xml 文件中它们的持久性单元内的类列表。

关于此任务

persistence.xml 文件位于 JPA 项目的 META-INF 目录中。

要将 JPA 项目中的所有持久性类自动添加至 persistence.xml 文件,请执行下列操作:

过程

  1. 在“包资源管理器”视图中,右键单击 persistence.xml 文件。
  2. 选择 JPA 工具 > 同步类列表。

结果

这时,将自动发现 JPA 项目中的持久性类并将其添加至 persistence.xml 文件中的持久性单元。
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: last_date

File name: t_jpa_synchronize.html