From 1d4761329480537a49d34c87352de693b163988d Mon Sep 17 00:00:00 2001 From: Maxim Solodovnik Date: Tue, 21 Jun 2022 14:34:18 +0700 Subject: [PATCH 1/2] Mysql driver is basically updated --- .../main/resources/META-INF/persistence.xml | 2 +- .../main/resources/META-INF/persistence.xml | 2 +- .../main/resources/META-INF/persistence.xml | 6 +++--- .../openjpa/jdbc/conf/localizer.properties | 2 +- .../persistence/access/TestExplicitAccess.java | 2 +- openjpa-project/BUILDING.txt | 2 +- .../src/doc/manual/ref_guide_slice.xml | 6 +++--- .../src/doc/manual/supported_databases.xml | 6 +++--- openjpa-slice/pom.xml | 2 +- .../test/resources/META-INF/persistence.xml | 18 +++++++++--------- .../tools/maven/AbstractOpenJpaMojo.java | 2 +- .../src/site/apt/examples/credentials.apt | 2 +- pom.xml | 6 +++--- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openjpa-examples/jest/src/main/resources/META-INF/persistence.xml b/openjpa-examples/jest/src/main/resources/META-INF/persistence.xml index a56118075b..37ac38a89c 100644 --- a/openjpa-examples/jest/src/main/resources/META-INF/persistence.xml +++ b/openjpa-examples/jest/src/main/resources/META-INF/persistence.xml @@ -27,7 +27,7 @@ demo.Actor - + diff --git a/openjpa-examples/openbooks/src/main/resources/META-INF/persistence.xml b/openjpa-examples/openbooks/src/main/resources/META-INF/persistence.xml index c7a6ddd3b0..b04c905225 100644 --- a/openjpa-examples/openbooks/src/main/resources/META-INF/persistence.xml +++ b/openjpa-examples/openbooks/src/main/resources/META-INF/persistence.xml @@ -36,7 +36,7 @@ 10.14.2.0 2.5.1 - 5.1.49 + 8.0.29 2.7.2 42.5.1 11.2.1.jre8 @@ -607,7 +607,7 @@ - com.mysql.jdbc.Driver + com.mysql.cj.jdbc.Driver ${openjpa.mysql.url} ${openjpa.mysql.username} @@ -636,7 +636,7 @@ - com.mysql.jdbc.Driver + com.mysql.cj.jdbc.Driver 3306 From 4cf4e0d5dc2e5da54add3d09e7ebd6d920671943 Mon Sep 17 00:00:00 2001 From: Maxim Solodovnik Date: Wed, 11 Jan 2023 23:36:12 +0700 Subject: [PATCH 2/2] Almost all tests are passed --- .gitignore | 1 + openjpa-examples/openbooks/pom.xml | 5 ++--- openjpa-examples/openbooks/run.properties | 2 +- .../openjpa/jdbc/sql/MySQLDictionary.java | 2 +- .../persistence/query/TestJDBCEscapeDate.java | 3 ++- .../reservedwords/sql_reserved_words.txt | 1 + openjpa-slice/pom.xml | 4 ++-- .../src/site/apt/examples/credentials.apt | 6 +++--- pom.xml | 20 +++++++++---------- 9 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 38e2d26a02..0a94905782 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ dependency-reduced-pom.xml nb-configuration.xml nbactions*.xml .checkstyle +.vscode diff --git a/openjpa-examples/openbooks/pom.xml b/openjpa-examples/openbooks/pom.xml index bbd1a501e1..c766c7ae5e 100644 --- a/openjpa-examples/openbooks/pom.xml +++ b/openjpa-examples/openbooks/pom.xml @@ -70,8 +70,8 @@ provided - mysql - mysql-connector-java + com.mysql + mysql-connector-j provided @@ -241,4 +241,3 @@ - diff --git a/openjpa-examples/openbooks/run.properties b/openjpa-examples/openbooks/run.properties index 01fe35fc02..30e6d5bea4 100644 --- a/openjpa-examples/openbooks/run.properties +++ b/openjpa-examples/openbooks/run.properties @@ -25,6 +25,6 @@ openjpa.version=2.3.0-SNAPSHOT openjpa.lib=${maven.repos}/org/apache/openjpa/openjpa-all/${openjpa.version} # Other depends # MySQL -#jdbc.driver=${maven.repos}/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar +#jdbc.driver=${maven.repos}/com.mysql/mysql-connector-j/8.0.31/mysql-connector-j-8.0.31.jar # Derby jdbc.driver=${maven.repos}/org/apache/derby/derby/10.8.2.2/derby-10.8.2.2.jar 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 988f05857b..4a138f7af3 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 @@ -147,7 +147,7 @@ public MySQLDictionary() { "INTEGER", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LEADING", "LEAVE", "LEFT", "LIKE", "LIMIT", "LINES", "LOAD", "LOCALTIME", "LOCALTIMESTAMP", "LOCK", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY", "MATCH", "MAXVALUE", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MIDDLEINT", "MINUTE_MICROSECOND", "MINUTE_SECOND", - "MOD", "MODIFIES", "NATURAL", "NO_WRITE_TO_BINLOG", "NOT", "NULL", "NUMERIC", "ON", "OPTIMIZE", "OPTION", "OPTIONALLY", + "MOD", "MODIFIES", "NATURAL", "NO_WRITE_TO_BINLOG", "NOT", "NTILE", "NULL", "NUMERIC", "ON", "OPTIMIZE", "OPTION", "OPTIONALLY", "OR", "ORDER", "OUT", "OUTER", "OUTFILE", "PARTITION", "PRECISION", "PRIMARY", "PROCEDURE", "PURGE", "RANGE", "READ", "READS", "REAL", "REFERENCES", "REGEXP", "RELEASE", "RENAME", "REPEAT", "REPLACE", "REQUIRE", "RESIGNAL", "RESTRICT", "RETURN", "REVOKE", "RIGHT", "RLIKE", "SCHEMA", "SCHEMAS", "SECOND_MICROSECOND", "SENSITIVE", "SEPARATOR", "SET", diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJDBCEscapeDate.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJDBCEscapeDate.java index 637503a13f..ed153df490 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJDBCEscapeDate.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/TestJDBCEscapeDate.java @@ -29,6 +29,7 @@ import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.H2Dictionary; import org.apache.openjpa.jdbc.sql.HSQLDictionary; +import org.apache.openjpa.jdbc.sql.MySQLDictionary; import org.apache.openjpa.jdbc.sql.PostgresDictionary; import org.apache.openjpa.jdbc.sql.SQLServerDictionary; import org.apache.openjpa.jdbc.sql.SybaseDictionary; @@ -98,7 +99,7 @@ public void testJDBCEscape() { "select a from Employee a where a.hireTimestamp >= {ts '2009-08-25 00:00:00.123456'}", "select {t '00:00:00'}, a.empId from Employee a", }; - } else if (dict instanceof PostgresDictionary || dict instanceof H2Dictionary) { + } else if (dict instanceof PostgresDictionary || dict instanceof H2Dictionary || dict instanceof MySQLDictionary) { jpql = new String[] { "select a from Employee a where a.hireDate >= {d '2009-08-25'}", "select a from Employee a where a.hireDate >= {d '2009-8-5'}", diff --git a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/reservedwords/sql_reserved_words.txt b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/reservedwords/sql_reserved_words.txt index 0504b780d1..a140bdaed5 100644 --- a/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/reservedwords/sql_reserved_words.txt +++ b/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/reservedwords/sql_reserved_words.txt @@ -480,6 +480,7 @@ NOTHING NOTIFY NOTNULL NOWAIT +NTILE NULL NULLABLE NULLIF diff --git a/openjpa-slice/pom.xml b/openjpa-slice/pom.xml index 0c9994de8b..3449d33ad7 100644 --- a/openjpa-slice/pom.xml +++ b/openjpa-slice/pom.xml @@ -82,8 +82,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.connector.version} test diff --git a/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/credentials.apt b/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/credentials.apt index 7176fde18c..bc55e4c6c1 100644 --- a/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/credentials.apt +++ b/openjpa-tools/openjpa-maven-plugin/src/site/apt/examples/credentials.apt @@ -79,9 +79,9 @@ Specifying connection settings in the plugin section 0.9.1 - mysql - mysql-connector-java - 5.1.11 + com.mysql + mysql-connector-j + 8.0.31 diff --git a/pom.xml b/pom.xml index e7b4c2349f..78faf11e62 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ org.apache apache - 23 + 29 org.apache.openjpa @@ -79,7 +79,7 @@ 10.14.2.0 2.5.1 - 8.0.29 + 8.0.31 2.7.2 42.5.1 11.2.1.jre8 @@ -600,8 +600,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.connector.version} test @@ -629,8 +629,8 @@ - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.connector.version} test @@ -641,7 +641,7 @@ 3306 openjpatst - jdbc:mysql://localhost:${docker.external.mysql.port}/${openjpa.mysql.dbname}?useSSL=false + jdbc:mysql://localhost:${docker.external.mysql.port}/${openjpa.mysql.dbname}?useSSL=false&allowPublicKeyRetrieval=true openjpatst openjpatst @@ -655,7 +655,7 @@ 5 0 - 5.7 + 8.0 @@ -1806,8 +1806,8 @@ ${derby.version} - mysql - mysql-connector-java + com.mysql + mysql-connector-j ${mysql.connector.version}