Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem while retrieving Object using HQL  RSS feed

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 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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!