• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate key mapping for GROUP BY

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

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!!!
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!