Hi,
Is there any way to create a hibernate Criteria with Restriction on JOIN clause instead on WHERE clause.
I want following query:
SELECT * from company c join company_type ct ON c.company_type=ct.id
and ct.active=trueinstead of
SELECT * from company c join company_type ct ON c.company_type=ct.id
where ct.active=trueCurrently I am creating Criteria as follows:
Code:
Criteria mainCriteria = getSession().createCriteria(Company.class)
.createCriteria("companyType", CriteriaSpecification.LEFT_JOIN).add(Restrictions.eq("active", true));
rizzz86