Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.1.9
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
This is not a problem report, but a request for design assistance.
I have a table with a composite key. I want to be able to page through it.
I have devised a conceptual example.
In the example, the table a numeric year and a numeric month column as the composite key. Thus, an order by for year, month would produce rows for 2 years that would be in chronological order. January, 1999 would preceed February, 1999 and January, 2000 would be after all of 1999. There does not seem to be a HQL that could be used on the Id property to order by the ID (year, month in a primary key class). Although it is simple to make the key class comparable (implement Comparable). Is there HQL that would allow me to get instances in 5-month chunks ((01,1999), (02,1999), (03,1999), (04,1999), (05,1999)) - then ((06,1999), (07,1999), (08,1999), (09,1999), (10,1999)) - then ((11,1999), (12,1999),(01,2000), (02,2000), (03,2000)) - etc. I have built a pager for single-column keys, but find multi-column keys a chore. I think it would be best done internally in Hibernate.
Thanks in advance
Wayne