• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate key mapping for GROUP BY  RSS feed

 
Margaret Schwab
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When using 'createSQLQuery', do you still need the hbm mapping file?

I am struggling with
SELECT trunc(some_date), some_field
FROM some_table
GROUP BY trunc(some_date), some_field
ORDER BY trunc(some_date), some_field

What should the hbm file look like, in particular - how to define the ID?

A key (ID) on some_date does not work (wrong column name Oracle error), nor does a composite-id on (some_date and some_field)

Thanks so much!!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!