Hello ! I am using Hibernate version:2.1.6 with
MySQL 4.1.7.
I have a table that has two columns that would represent a date:
month and year. I want to select a row that's month and year are before the specified month and year, which means the year is <= than the specified one, and the month would also be <= than the specified month, or max(month) if the year is < than the specified year.
I would like to do that within only one Hibernate query, and would also prefer not to make any redundant queries. I was thinking of using the xor logical operator between two subselects that represent the two cases, but this one would fail if both of the subqueries would give results. The "xor" operator or even "or" would work if I used a temporary variable that was instantiated if the first select succeeded, but I don't know if it's possible to use variables in the Hibernate queries.
Could you please help me with this matter?
Thank you in advance !
|