// Delete one from the SQL "month" (origin=1) to be compatible with Java month (origin=0)
JavaTypeMapping m2 = getMapping(BigInteger.class, date);
ScalarExpression integerLiteral = m2.newLiteral(date.getQueryExpression(), BigInteger.ONE);
NumericExpression expr = new NumericExpression(new NumericExpression("date_part", args), ScalarExpression.OP_SUB, integerLiteral);
expr.encloseWithInParentheses();
return expr;
}
/**
* Returns the appropriate SQL expression for the JDOQL Date.getYear()