OPENJPA-2286: ArgumentException: Attempt to compare incompatible types class java.util.Date and class org.apache.openjpa.jdbc.sql.Raw. Backported changes from 2.2.x.