Hi,
I hope I understand your design correct: your "Road" has a PK, which is actually
another entity "Location". The "Location" has relationships to other
"Road" entities.
I think this is quite a problematic design, because by loading the Road, it has to fetch
the Location, and by fetching the location, it has to fetch all its related Roads (because
of FetchType = EAGER), and from there it will fetch the other Locations and so on....
You suggest two different options:
1) You could create an artificial Primary Key on "Location" and
"RoadPK" just references this ID. The ROADS entity might have a
one-to-one-relationship to a Location and an autogenerated ID (instead of the PK of type
"Location").
2) You might also try to set the relataionships from Location to Road to "LAZY".
But I don't know whether this works.
The latter will bring other difficulties:
http://www.jboss.org/community/wiki/EJB3relationships
Hope this helps
Wolfgang
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227158#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...