I've a query like this. Which I don't know how to make it up in Hibernate criteria. I've done a lot of stuffs in hibernate criteria, but don't have any idea if the query is like below.
select employer.phoneNo, employee.phoneNo, lender.phoneNo
from employer,employee,lender
where employer.phoneNo='xxxxxxxx'
or employee.phoneNo='xxxxxxxx'
or lender.phoneNo='xxxxxxxx';
All the three Employer, Employee, Lender don't have any relationship with each other. The purpose of the query is to check whether the given phone number is exist even in any one of the table to prevent a new user registration with same phone number.
I know how to do it with SQLQuery sqlQuery = getSession().createSQLQuery(sql);
, but is it possible in hibernate criteria?