使用JPA + Eclipselink操作PostgreSQL数据库
首先确保您已经安装了PostgreSQL。您可以参考我这篇文章PostgreSQL扫盲教程。 使用Eclipse创建一个新的JPA project: Platform选择EclipseLink,作为JPA的provider之一。 在Eclipse里自动生成的project如下图所示: 用下列xml的内容覆盖自动生成的xml: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="jerryjpa" ...













