Register / Login
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Object Relational Mapping
Hibernate Bidirectional relationship + pass by reference
posted 7 years ago
I have two classes that know about each other - Foo and Bar. I load a Foo with a specified id, which loads the Bar but the Foo inside the Bar is not the same instance.
The problem only occurs when specifying the Foo by id: I have another class FooList that aggregates Foo and upon loading a FooList the references to Foo inside Bar are the same as in the list.
I'm not sure if using session.createSQLQuery() in the first case has anything to do with it? Does anyone have any other idea about how to fix this?
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
Boost this thread!
Interpretation of Shadowing Object Reference variable Code from K&B
Accessing a valiable outside the class
Passing bidimensional array/List from Velocity to Struts2
Head First Servlets and JSP Chapter 8 Mock exam
Problem in passing ArrayList