I have sample entity as following
class Book{
int id
String name
int sid
}
class Author {
int id
String name
List<Book> books
int mid
}
Its not good design, I know that just trying to explain a scenario.
Now my questions is, Is there any way I can check equal of two unrelated column
e.g
session.createCriteria(Author.class, "author")
.createAlias("books", "book")
.add(Restrictions.eq("author.mid","book.sid")
.list()
Can it be done?