Open andrus opened 6 years ago
I guess that's because in case with SQL the expression is translated to a string by collecting 'toString' representations of the value nodes, so it's guaranteed to work regardless of the node's type, and in-memory evaluation expects the respective nodes to have correct types, because it has to do the cast in order to call the evaluator. So somebody has to do the type conversion for values.
I need to verify my theory about java.util.Date (i.e. that we are already doing conversions for at least some types).
Consider the following two requests, filtering the contents of an advanced include by date:
This results in the following exception:
Advanced includes are filtered in memory (the same exp on the root entity that is translated to SQL works). "dateProperty" is a
java.time.LocalDate
. I suspect if we map it asjava.util.Date
it will work too. The problem may actually be on Cayenne side. But logging it here for documentation purposes and to test any possible fixes.