Hibernate problem - “Use of @OneToMany or @ManyToMany targeting an unmapped class”

前端 未结 7 837
梦谈多话
梦谈多话 2020-11-28 04:52

I\'m finding my feet with Hibernate Annotations and I\'ve hit a problem I hope someone can help with.

I have 2 entities, Section and ScopeTopic. The section has a Li

相关标签:
7条回答
  • 2020-11-28 05:19

    I had the same problem and I could solve it by adding the entity into persistence.xml. The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:

    <persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
    <provider>`enter code here`
         org.hibernate.jpa.HibernatePersistenceProvider
      </provider>
    <class>mypackage.MyEntity</class>
    

    ...

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