Must every Entity Bean be registered in persistence.xml?

后端 未结 3 1593
北海茫月
北海茫月 2021-02-20 07:49

I\'m using Eclipse Facets for JPA 2.0 and Hibernate 4.2 implementation. I think I recall that in previous project I would not have to register an Entity Bean in the persistence.

相关标签:
3条回答
  • 2021-02-20 08:25

    It's possible when you created the project, you picked "JPA project" instead of "java Project". In case you don't see "Java Project", follow the "other" and under the wizard type "java" to see the "Java Project".

    0 讨论(0)
  • 2021-02-20 08:29

    in jpa you have to compile a file called persistence.xml where you tell Hibernate which classes will be managed by your ORM.
    Check this question and its accepted answer

    0 讨论(0)
  • 2021-02-20 08:35

    As already written here is the solution:

    Check you JPA project properties and be sure to select "Discover annotated classes automatically" in the "Persistent class management" section. Doing this should provide the correct validation for your use case.

    0 讨论(0)
提交回复
热议问题