• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bidirectional relationships on Objects in Jpa  RSS feed

sridhanya ganapathy
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In my application for a scenario inheritance is much suited design.
ie N child Objects tied to a parent object{Grouping common attributes}
As JPA doesn't support such inheritance my application expected, we where forced to use "One to Many" Bidirectional Mapping.In the same i have few questions.

class Parent{
list <Child> childObjects
class Child {
Parent parentObj;

1)Is that a bad object design ie having bidirectional relationship?

2)JPA forces the developer to take care of bidirectional relationship in the objects ..To be more clear when child is added to the persistence store forces the developer to update the parentlist also.
Is this behaviour forced by jpa?

3)Is there any other workaround for the same.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!