我在 Eclipse 中收到错误“类“test2”已映射,但未包含在任何内容中”,但是该类包含在持久性 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="test1">
<class>com.test.domains.test1</class>
<properties>
<!-- properties for schema1 here -->
</properties>
</persistence-unit>
<persistence-unit name="test2">
<class>com.test.test2</class>
<properties>
<!-- properties for schema 2 here -->
</properties>
</persistence-unit>
</persistence>
为什么会出现这个错误。我必须为 2 个数据库模式配置不同的吗?