-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Session.get returning null for existing record
PostPosted: Thu Feb 18, 2010 2:44 pm 
Newbie

Joined: Mon Sep 14, 2009 2:22 pm
Posts: 5
I saw similar issue reported long back for hibernate 2 with key ID HB-1358 with Resolution : Won't Fix . I am facing similar issue right now in my development. I have a scenario where A is the parent class.
For Eg:
Code:
Class A {}

Class B extends A {}

Class C extends B { }

Class D extends B { }

I am accessing class B using session.get(clazz, object). I have active records in database for class A, class B and class C and I don't have matching record in class D which we can ignore.

When I execute the query in SQL developer, which hibernate is firing while doing get, I am getting records but in hibernate its returning null. And it is happening for only few records.

Is it still bug or Is it taken care of? Please advice and let me know If we can resolve this issue.

Any help is appreciated.

Thanks,
Shruthi


Top
 Profile  
 
 Post subject: Re: Session.get returning null for existing record
PostPosted: Thu Feb 25, 2010 12:47 pm 
Beginner
Beginner

Joined: Tue Aug 25, 2009 11:42 am
Posts: 49
It is a bug but fixing it would probably have a penalty on performance. But like Gavin pointed out in http://opensource.atlassian.com/project ... se/HB-1358 why would anyone need to be querying like that?
Polymorphism is something I usually have problem with Hibernate too.
Enable Proxying and query on the root class and try to design in a different way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.