Lets say for example I have an object Parent with a spouse:
Code:
class Parent {
String name;
int age;
Parent spouse;
}
I'd like to have a query that gets the oldest Parents per couple:
Code:
...add(Restrictions.gt("age", ???spouse.age???));
I can't find a way to pass anything but a hard value in as the second argument. I could right my own implementation of the Criterion interface, but that seems silly for what seems like a simple query that others must have done.
Even some help with a much more simple example would probably point me down the right path.
How to get Things where valueA is greater than valueB;
Code:
class Thing {
int valueA;
int valueB;
}
...add(Restrictions.gt("valueA", ???valueB???));
Again, I'm not sure how to pass in the second argument since I need to reference another column.
I appreciate the help while I continue to look through the source for a solution.
- Chris