Hi all,
I hava four tables as following:
A( a_id(PK) , no)
B(b_id(PK),a_id,b_no)
a_id is FK reference to A; (a_id, b_no ) UNIQUE
C(c_id(PK),a_id,b_no,c_no)
a_id,b_no are FK reference to B;(a_id,b_no,c_no) UNIQUE
D(d_id(PK),a_id,b_no,c_no,d_no)
a_id,b_no,c_no are FK reference to C ;(a_id,b_no,c_no,d_no) UNIQUE
When i mapped A,B,C table with one-to-many ,that is OK;
But when i add the D table mapped, like
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns( { @JoinColumn(name ="a_id",referencedColumnName= "a_id", nullable = false),
@JoinColumn(name ="b_no",referencedColumnName= "b_no", ),
@JoinColumn(name ="c_no",referencedColumnName= "c_no", nullable = false)})
it will throw annotationException :reference **** not mapped to a single property.
I don't know whether the Hibernate support more than four one-to-many cascade of FK.
Does anybody else know about this?
Thanks!
|