-->
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 can an HQL Query return a Map of Maps ?
PostPosted: Wed Feb 22, 2006 9:58 am 
Newbie

Joined: Tue Feb 21, 2006 10:00 am
Posts: 1
Hibernate version: 3.1 beta 7
Name and version of the database you are using: Oracle

Hello all,

I want to construct an HQL query that returns a map. Below I include the format of the table I want to fetch data:

table: PRODUCT_MAX_VALUES
columns: 1)USER_ID 2)PRODUCT_ID 3)MAX_VALUE

In the table there can be entries with the same USER_ID. The primary key is composite (USER_ID,PRODUCT_ID).

Can I construct an HQL query that returns the following?

Map(USER_ID, Map(PRODUCT_ID,MAX_VALUE))

I assume this can be done using the GROUP BY statement but I am not so experienced with HQL

Another issue is that the table is not mapped to a Java bean. This is because my existing code does not allow it

Thank you in advance, Kostas


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.