-->
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.  [ 1 post ] 
Author Message
 Post subject: criteria on a non mapped class returns an empty list
PostPosted: Thu May 12, 2011 10:14 am 
Beginner
Beginner

Joined: Mon Apr 04, 2011 12:08 pm
Posts: 32
I have a dao called fr.corp.dao.Book
I have a mapped bean also called fr.corp.bean.Book

In my Book dao I have a criteria request like :

Code:
DetachedCriteria criteria = DetachedCriteria.forClass(Book.class);


so yes after a few hours I realised the error was Book.class was refering to the dao instead of the bean, so I fixed it with :

Code:
DetachedCriteria criteria = DetachedCriteria.forClass(fr.corp.bean.Book.class);


and also renamed the dao as BookDaoImpl to not be bothered again

However Hibernate never thrown an exception at all !! It just returned an empty list.
Shouldn't it have thrown a fr.corp.dao.Book is not a mapped class ???


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

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.