Hvis alle entiteterne bruger det samme skema, kan du bruge en xml-tilknytningsfil til at definere et standardskema.
Noget som dette burde virke (eksemplet er for JPA 2.0, skift skemaplacering for 1.0)
orm.xml:
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="2.0">
<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>OWNERS_SCHEMA</schema>
</persistence-unit-defaults>
</persistence-unit-metadata>
. . .
</entity-mappings>
persistence.xml:
<persistence
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"
version="2.0" >
<persistence-unit name="foo">
. . .
<mapping-file>orm.xml</mapping-file>
. . .
</persistence-unit>
</persistence>