CAY-1877 In-memory evaluation of expression may fail with UnsupportedOpeartionException depending on order of nodes

git-svn-id: https://svn.apache.org/repos/asf/cayenne/main/trunk@1573131 13f79535-47bb-0310-9956-ffa450edef68