Adding HAVING clause support to generic query generator