DataSource.criteriaCombines vs. AdvanceCriteria constructor incompatibility?

DataSource.combineCriteria is a nice way to combine criteria smartly; it can optimize the result according to the types of the input.

However, since it’s result type is Criteria (and not Criterion), criteria combined by this method can not be used later to build a further AdvancedCriteria. (The constructors for AdvancedCriteria only accept Criterion input, not Criteria.)

Is there a way to resolve this?

(This is not critical; I can replace DataSource.combineCriteria calls with AdvancedCriteria constructor calls, but combineCriteria can sometime return simplier results, so I would prefer using it, if possible.)

Thank you for your help:

Csillag

If the resulting Criteria is advanced, you should be able to convert it via new AdvancedCriteria(criteria.getJSObj()).