Greetings,
I'm new to Hibernate so I may be approaching this problem completely wrong. The relationship I want to model is described below - ClassA contains exactly 3 references to ClassB:
Code:
Class A {
ClassB x;
ClassB y;
ClassB z;
}
Class B {
ClassA a;
}
I don't think I can implement this as @OneToOne because x,y, and z would all be related to a. But, I don't know how to make this a @OneToMany either since x,y and z are not part of a collection.
Is this proper technique for modeling such a relationship to convert my x, y, and z elements into a collection of ClassB? Or is there a way I can maintain an explicitly bounded multiplicity (i.e. 1 to 3 instead of just 1 to many)?
Thanks!