0

I am trying to follow this tutorial : http://howtodoinjava.com/2014/09/25/hibernate-jpa-cascade-types/

and there one side has @OneToMany mapping and the other has @OneToOne. Is that possible ? I am getting error

Caused by: org.hibernate.AnnotationException: Referenced property not a (One|Many)ToOne: com.springapp.mvc.entities.EmployeeEntity.accounts in mappedBy of com.springapp.mvc.entities.AccountEntity.employee
Manos2
  • 3
  • 2
  • error is the same, but the code is totally different. It's definitely not a duplicate question. – Manos2 Dec 09 '15 at 22:40
  • `@JOINCOLUMN(name="EMPLOYEE_ID")` where's `"EMPLOYEE_ID"` in there? Also is it many to one or one to many in there? – ha9u63a7 Dec 09 '15 at 22:50

1 Answers1

0

It is not possible to have that. If one side is One to Many, the other side has to be Many to one.

Kevin Wu
  • 1,357
  • 1
  • 15
  • 34