-->
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: only projectios has .min() ??
PostPosted: Sat Sep 01, 2007 7:43 am 
Beginner
Beginner

Joined: Fri Jun 15, 2007 6:32 am
Posts: 23
Code:
List<SimplePaperEod> list = new ArrayList<SimplePaperEod>();
      Criteria crit = getSession(false).createCriteria(SimplePaperEod.class);
        ProjectionList projList = Projections.projectionList();
        projList.add(Projections.max("date"));
        projList.add(Projections.min("date"));
        projList.add(Projections.groupProperty("paperName"));
        crit.setProjection(projList);
        list = crit.list();
      return list;


it retrieves the right data , only problem it's projectins :) so i'm not getting the entity just the fields i asked for how can i transform those "restrictions" into criteria lang. so i'll get basicly two entities per paperName the min and the max ??
a bit confused here , thanks in advance .


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.