Arvind Karuppasamy

+ Follow
since Jul 16, 2008
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arvind Karuppasamy

I saw this code snippet in Manning Hibernate book.
This looks like what I want, I have just one query. In the below code, Bid is a class that is mapped to a database table using Hibernate and ItemBidSummary is just some class in my package, is that correct? or should ItemBidSummary also be mapped to something. Also, what does this code snippet return - a List of ItemBidSummary?

My problem is this, I have a summary object and another object that maps to a row in the table. Can I have a hql query that returns me the Summary object.
Can I map that somewhere?

I have not used HQL before, so I am confused as to what will HQL return, is it a resultset that I need to iterate and convert to my summary object, or is there a simpler way to obtain my summary object from the hql.
Is there a way to map this summary object also using Hibernate, so that I do not need to write the hql queries.

I am new to using Hibernate, and in our project, we use Hibernate and Spring to do all the database stuff.

I have a requirement wherein I need to write a method that takes a few inputs and then queries a table to return the sum of a column and the max and min of another column for the given input query criteria.

Now I am confused as to how I can use ORM in this case, should I define a java class for that table and then just use the query without any grouping to fetch the objects of that class and then do a grouping, sum and min,max computations for the resulting object set using Java code, like iterating through the loop?

How best can I use Hibernate to achieve this, I am a newbie to ORM and all the other Objects in my project are all DAOs which operate on a single record.