-->
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: Calling uniqueResult() on Empty Table
PostPosted: Tue Sep 06, 2005 10:58 am 
Newbie

Joined: Thu Aug 04, 2005 3:51 pm
Posts: 10
Hello, I'm using Hibernate2 and keep gettin this exception when I query using uniqueResult() on an empty table:

net.sf.hibernate.NonUniqueResultException: query did not return a unique result: 2

Again, the table has no rows so the result can't be 2 as far as I know. Can anyone tell me if this is normal behavior for Hibernate2?

How should I interpret this and how to handle it?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 2:37 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
It should return null. Make sure the table is not empty.


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.