• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem while retrieving Object using HQL

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to hibernate and trying to learn its nuts and bolts.i have a table Destination which has destinationid as unique Key i also have UUID as unique key in the destination table. i want to provide a method by which user can fetch Destination based on destinationid also so i tried to use HQL as below

my Destination class has reference of many other subclasses as collection, all of which has been defined as lazy load

there are around 9-10 classes whcih are being refred from inside Desttination class all being lazily loaded.
I am importing destination xml and this xmlis being provided by some third part system so there is no way i can associate UUID and i need to decide if import is to be done in update mode or for new destination.so destinationid is the only way i can find to check if the destination is already in the DB or not.
my problem is for new destination the above HQL query is working fine and new destination is being imported in to the DB but for the existing it seems that its not working as expected and Query seems to be in hanged state

i am new to hibernate but after seeing the query generated by hibernate for the already existing destination,it seems it is facing some kind of cyclic references but i am not sure how to avoid this or is there any better way to check for an already existing entity based on the unique key (not primary key)
Thanks in advance
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic