-->
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: How to deal with complex query and aggregate functions
PostPosted: Mon Aug 31, 2009 7:37 am 
Newbie

Joined: Mon Aug 31, 2009 7:24 am
Posts: 7
Dear All,

I'm rather new to Hibernate and I think it's time to use it in a new brand little application.

I have a little desktop application doing relatively simple queries against a complex database.
I mapped tables on classes and obtained a simple domain model (every table mapped with a pojo).

However, I have a slightly more complex query using count, min and max functions, then group by.

Which is the more convenient way to deal with that?
Can I create a mapping object containg fields mapped on count(), min() and max() columns in the query? If I can, which is the form of the mapping hibernate file and the POJO class?

Is it better to use a named query (however, I found the HQL query an it seems working but I don't know how to retrieve the single fields of each row, since I don't handle a POJO but a rough row!!!)? If so, how can I retrieve the fields from the named query?

Can you indicate some useful documentation to answer my questions?
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.