This is an automated email from the ASF dual-hosted git repository. struberg pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openjpa.git
commit e908a9c293394cfe3651fdd1f046b4b99ce5fee8 Author: Mark Struberg <strub...@apache.org> AuthorDate: Mon Jan 28 13:01:16 2019 +0100 formatting only --- .../src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java | 7 +++---- .../openjpa/persistence/criteria/TestTypeSafeCondExpression.java | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java index ccd63d4..f71425e 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java @@ -156,11 +156,11 @@ public class MySQLDictionary })); requiresSearchStringEscapeForLike = true; + // MySQL requires double-escape for strings searchStringEscape = "\\\\"; - typeModifierSet.addAll(Arrays.asList(new String[] { "UNSIGNED", - "ZEROFILL" })); + typeModifierSet.addAll(Arrays.asList(new String[] { "UNSIGNED", "ZEROFILL" })); setLeadingDelimiter(DELIMITER_BACK_TICK); setTrailingDelimiter(DELIMITER_BACK_TICK); @@ -356,8 +356,7 @@ public class MySQLDictionary throws SQLException { // if the user has set a get-blob strategy explicitly or the driver // does not automatically deserialize, delegate to super - if (useGetBytesForBlobs || useGetObjectForBlobs - || !driverDeserializesBlobs) + if (useGetBytesForBlobs || useGetObjectForBlobs || !driverDeserializesBlobs) return super.getBlobObject(rs, column, store); // most mysql drivers deserialize on getObject diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java index 920aa11..f2d6062 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/criteria/TestTypeSafeCondExpression.java @@ -330,8 +330,7 @@ public class TestTypeSafeCondExpression extends CriteriaTest { } public void testLowerFunc2() { - String query = "select e.age From CompUser e where LOWER(e.name)" + - " ='ugo'"; + String query = "select e.age From CompUser e where LOWER(e.name) ='ugo'"; CriteriaQuery<Integer> q = cb.createQuery(Integer.class); Root<CompUser> e = q.from(CompUser.class); q.where(cb.equal(cb.lower(e.get(CompUser_.name)), "ugo")); @@ -342,7 +341,7 @@ public class TestTypeSafeCondExpression extends CriteriaTest { public void testUpperFunc1() { String query = "select UPPER(e.name) From CompUser e WHERE " + - "e.computerName='PC'"; + "e.computerName='PC'"; CriteriaQuery<String> q = cb.createQuery(String.class); Root<CompUser> e = q.from(CompUser.class); q.select(cb.upper(e.get(CompUser_.name)));