Class “model.Address” is listed in the persistence.xml file but not mapped

后端 未结 9 1139
梦如初夏
梦如初夏 2020-12-24 11:59

I have created a JPA project. In that Eclipse displays the following error on the entity class.

Class \"model.Address\" is listed in the

9条回答
  •  太阳男子
    2020-12-24 12:26

    This is an Eclipse quirk. I recently had exactly this problem when I created a new JPA project with the JPA library configuration disabled, but didn't manually configure the JPA libraries before I created the entities by the Eclipse New JPA Entity wizard. After creating the entities I configured the JPA libraries in project's Build Path (just by adding target Java EE server runtime in Libraries), but the validation error still remains. I could solve it in at least one of following ways:

    1. Rightclick persistence.xml file, JPA Tools -> Synchronize Class List.
    2. Or, rightclick project, Validate.
    3. Or, close/reopen project.

    This is consistently reproducible. I was using Eclipse Indigo SR1. When I create the entities after configuring the JPA libraries, this validation error doesn't occur.

提交回复
热议问题