I know this is very silly question but I am new to hibernate.. I am working on hibernate and In my project I can see there are 2 Entities Suppose A and B and they relation like
Class A{
@ManyToOne
B b;
}
Class B{
@ManyToOne(fetch = FetchType.LAZY)
A a;
}
I am trying to understand why it is so ? why do we need this kind of relation ,is it how we relate foreign key constraint between tables ?