OPENJPA-2376: Escape character in JPQL with parameter substitution generates incorrect SQL - committed a patch sent to me by Albert Lee - merged changes from 2.1.x.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.2.1.x@1513273 13f79535-47bb-0310-9956-ffa450edef68