ArrayList args = new ArrayList();
args.add(date);
args.add(getMapping(String.class, date).newLiteral(date.getQueryExpression(), "MM"));
ArrayList args1 = new ArrayList();
args1.add(new StringExpression("TO_CHAR", args));
// Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
JavaTypeMapping m = getMapping(BigInteger.class, date);
ScalarExpression integerLiteral = m.newLiteral(date.getQueryExpression(), BigInteger.ONE);
NumericExpression expr = new NumericExpression(new NumericExpression("TO_NUMBER", args1), ScalarExpression.OP_SUB, integerLiteral);