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
|