Hibernate exception with @MapsId, @EmbeddedId

前端 未结 4 1262
一整个雨季
一整个雨季 2021-02-09 01:58

I\'ve got a problem with @MapsId annotation and @EmbeddedId. When running a code in Hibernate I get:

Caused by: org.hibernate.Pr

4条回答
  •  情书的邮戳
    2021-02-09 02:22

    See this issue. It simply states that

    org.hibernate.PropertyAccessException may be thrown if an Entity contains the following conditions:

    1. Uses @EmbeddedId
    2. Uses @JoinTable on a collection or association property/field, which references another property/field of the entity.

    As you see, the only 'workaround' suggested so far is Do not use @EmbeddedId, which is kind of weird.

提交回复
热议问题