case 1. ALL and ANY :
apply to subquery only. OpenJPA always pushdown subquery in enclosing parenthesis.
ALL or ANY operator puts additional pair of parenthesis.
The fix is to not putting in unneeded pair, because Sybase reports syntax
error for ANY or ALL subquery having the extra enclosing parenthesis.
case 2. Distinct function
first, do not confuse this DISTINCT function with SELECT DISTINCT.
SELECT DISTINCT will not got through the Distinct.class code.
The Distinct function is only associated with a COUNT function.
It is safe that given the fact OpenJpa only pushdown COUNT(DISTINCT one-item),
we can enclose one-item with or without parenthesis.
The fix is not to enclose one-time to get around syntax error reported by Informix.
So far, I have verified the fix against DB2, Oracle, Sybase, SQLServer and Informix.
Help needed to verify other back-end systems.