-->
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: Mapping between a class and a query using count, min and max
PostPosted: Tue Sep 08, 2009 6:34 am 
Newbie

Joined: Mon Aug 31, 2009 7:24 am
Posts: 7
Hi there,

I have the following query in Oracle SQL:

Code:
SELECT COUNT(dv.pk_id),
  MIN(dv.date_time)      ,
  MAX(dv.date_time)      ,
  s.name                ,
  s.pk_id,
  dv.fk1_id
FROM data_values dv, sites s
WHERE dv.fk2_id = s.pk_id
  AND dv.date_time BETWEEN to_date('1900-01-01','YYYY-MM-DD') AND to_date('2009-07-31','YYYY-MM-DD')

GROUP BY s.site_name,s.pk_id,
  dv.fk1_id


Which is the procedure to create a mapping between this query and a new class?
Table sites is already mapped. The query above works fine and returns a List of basic objects with no getters of course.

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.