Ask Your Question
0

What is the reason for the error "mappedBy references an unknown target entity property" caused by org.hibernate.AnnotationException?

asked 2021-06-26 11:00:00 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-13 16:00:00 +0000

nofretete gravatar image

The error "mappedBy references an unknown target entity property" caused by org.hibernate.AnnotationException typically occurs when there is a mismatch between the entity properties used in a JPA @OneToMany or @ManyToMany relationship mapping.

Specifically, this error occurs when the mappedBy attribute in the parent entity's relationship annotation is referencing a property in the target entity that does not exist. This could happen if the target entity has a different property name than what is referenced in the parent entity's mapping, or if the target entity's property is not annotated with the @OneToMany or @ManyToMany annotation.

To fix this error, make sure that the mappedBy attribute in the parent entity's relationship mapping is referencing a valid property in the target entity that has been properly annotated with the corresponding JPA relationship annotation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-26 11:00:00 +0000

Seen: 8 times

Last updated: May 13 '21