• 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

Problem while retrieving Object using HQL

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic