• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Bidirectional relationship + pass by reference

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Cheers,

James
 
reply
    Bookmark Topic Watch Topic
  • New Topic