该规则检测 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>