此規則偵測 persistence.xml 檔案中的 openjpa.jdbc.Schema 配置內容。
此內容必須手動移轉至與 XML 物件相關的對映檔 META-INF/orm.xml,或是由 persistence-unit 的 mapping-file 元素定義的對映檔。
其他 openjpa 和 wsjpa 配置內容是由不同規則加以標示。
在下列 persistence.xml 檔中,property 元素是由此規則標示。
<persistence>
<persistence-unit name="openjpa">
<mapping-file>orm.xml</mapping-file>
<properties>
...
<property name="openjpa.jdbc.Schema" value="EJB30"/>
...
</properties>
</persistence-unit>
</persistence>
將此內容值移轉至對映檔中的 schema 元素。
下面的範例顯示 orm.xml 對映檔中已移轉的內容值。
如果您未使用預設 META-INF/orm.xml 檔案,請在 persistence.xml 檔案中為每一個受影響的 persistence-unit 定義 mapping-file 元素。
<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>EJB30</schema>
</persistence-unit-defaults>
</persistence-unit-metadata>
</entity-mappings>