เมื่อสร้างโปรเจ็กต์ JPA (ดูที่ "การสร้างโปรเจ็กต์ JPA ใหม่") คุณยังสามารถสร้างไฟล์ orm.xml
ที่กำหนดการแม็พ metadata และดีฟอลต์
Eclipse สร้างไฟล์ META-INF\orm.xml
ในไดเร็กทอรีของโปรเจ็กต์:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="<PERSISTENCE_VERSION>" 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_1_0.xsd"> <persistence-unit name="<PERSISTENCE_UNIT_NAME>"> <provider="<PERSISTENCE_PROVIDER>" /> </persistence-unit> </persistence>