-->
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: Simple criteria question
PostPosted: Wed Mar 14, 2007 5:36 am 
Newbie

Joined: Thu Nov 16, 2006 12:42 pm
Posts: 7
Hi,

Does anyone know how to do this HQL with a criteria in stead:

String sql = SELECT cp FROM Company cp, Person ps, WHERE cp.person = ps.id AND ps.cpr = ?

List list = getHibernateTemplate().find(sql, cpr);



So what i actually want to do is to make a search by associating two entities that are not related in my hibernate mapping with a criteria query.

Is that possible using the criteria query ?


The reason for me wanting to change this query to criteria, is because the possibility of paging with criteria, like:

criteria.setFirstResult(firstResult).setMaxResults(maxResults);


If it is not possible to do the association in a criteria query, is it then possible to do a "paging" search with HQL ?

Thanks in advance.

Best Regards
Cemil


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 14, 2007 8:18 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
hi Cemil

till hibernate 3.1.2 ,we didn't use this way .Leave that idea

_________________
Dharmendra Pandey


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.