Two tables A
and B
. B
has a NOT NULL foreign key (many-to-one) which points to A
. There is no columns in A
, which tells, the table B
exists. That means the relation is one-way
Created POJO classes A
and B
with Eclipse hibernate tools reverse enginnering. The class B
has a property with type A
, which is correct.
But, why the class A
has a property as List<B>
, even if the relationship defined is not two-way.
Is this for any advantage in development or is this the way, how reverse engineering works ?
If there is more table C,D,E...
has same relation to A
, the class A
will have that much List<?>
variables and I think it doesn't look nice. Is there any way to avoid this?