Quote:
just add:
Code:
criteriaTypes.add(Expression.eq("type_id", typeId)); //any other expressions can be used
you do not need to assign result of this call to anything. You will have what you need
Sorry, I missed part with SQL
Actually, your code already provides you same result as SQL above.
Also you can write something like that:
Code:
Criteria criteriaValues = session.createCriteria(QualifierValues.class);
Criteria criteriaTypes = criteriaValues.createCriteria("qualifierTypes");
Criteria criteriaFunctions = session.createCriteria(Function.class)
add(Expression.eq("id", new Integer(arg_functionId)));
criteriaTypes.add(Expression.in("type_id", criteriaValues.list()));
But first one is faster