[openjpa] branch master updated (8f79c8a -> eec95cd)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[openjpa] branch master updated (8f79c8a -> eec95cd)

struberg
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


    from 8f79c8a  up to 2021
     new 9c95b71  update docs to reflect changes in OpenJPA-3.2.0
     new 61540f0  reserved column words should be public
     new 6eb984a  add java.time Entity field types support
     new eec95cd  wip update compat matrix

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/openjpa/jdbc/sql/DBDictionary.java  |   9 +-
 .../src/doc/manual/jpa_overview_meta.xml           |   7 ++
 openjpa-project/src/doc/manual/jpa_overview_pc.xml |  25 +++++
 .../src/doc/manual/migration_considerations.xml    | 101 ++++++++++++++++++---
 .../src/doc/manual/supported_databases.xml         |  82 +++++++++++++----
 5 files changed, 187 insertions(+), 37 deletions(-)
Reply | Threaded
Open this post in threaded view
|

[openjpa] 01/04: update docs to reflect changes in OpenJPA-3.2.0

struberg
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 9c95b71fcc88ce7e3b08054c8c30cd80e5a89aa1
Author: Mark Struberg <[hidden email]>
AuthorDate: Sat May 8 23:20:58 2021 +0200

    update docs to reflect changes in OpenJPA-3.2.0
---
 .../src/doc/manual/migration_considerations.xml    | 101 ++++++++++++++++++---
 1 file changed, 87 insertions(+), 14 deletions(-)

diff --git a/openjpa-project/src/doc/manual/migration_considerations.xml b/openjpa-project/src/doc/manual/migration_considerations.xml
index 9c39a14..02ee86e 100644
--- a/openjpa-project/src/doc/manual/migration_considerations.xml
+++ b/openjpa-project/src/doc/manual/migration_considerations.xml
@@ -458,24 +458,24 @@
                     <xref linkend="jpa_2.2_allocationSize"/>.
                 </para>
             </section>
-         <section id="jpa_2.2_cascadePersist">
+            <section id="jpa_2.2_cascadePersist">
                 <title>
                     Cascade persist behavior
                 </title>
                 <!-- See OPENJPA-1986 for details. -->
- <para>
- In previous releases, OpenJPA would check the database for the
- existence of the related Entity before persisting the relationship to
- that Entity. This resulted in an extra Select being sent to the
- database. In 2.2.0, code was added so that when cascading a persist to
- a related Entity without persistence state, the persist (insert) will
- happen without first checking the database. This may result in an
- EntityExistsException if the related Entity already exists in the
- database. To revert this behavior to the previous release, set the
- value of the <literal>openjpa.Compatibility</literal>
- property <literal>CheckDatabaseForCascadePersistToDetachedEntity</literal>
- to <literal>true</literal>.
- </para>
+                <para>
+                    In previous releases, OpenJPA would check the database for the
+                    existence of the related Entity before persisting the relationship to
+                    that Entity. This resulted in an extra Select being sent to the
+                    database. In 2.2.0, code was added so that when cascading a persist to
+                    a related Entity without persistence state, the persist (insert) will
+                    happen without first checking the database. This may result in an
+                    EntityExistsException if the related Entity already exists in the
+                    database. To revert this behavior to the previous release, set the
+                    value of the <literal>openjpa.Compatibility</literal>
+                    property <literal>CheckDatabaseForCascadePersistToDetachedEntity</literal>
+                    to <literal>true</literal>.
+                </para>
             </section>
             <section id="jpa_2.2_LifecycleEventManager">
                 <title>
@@ -578,4 +578,77 @@
             </section>
         </section>
     </section>
+    <section id="jpa_3.2">
+        <title>OpenJPA 3.2.0</title>
+        <section id="jpa_3.2_incompatibilities">
+            <title>Incompatibilities</title>
+            <para>
+                The following sections indicate changes that are incompatible
+                between OpenJPA 3.1.x releases and the 3.2.0 release.
+            </para>
+            <section id="jpa_3.2_SumDouble">
+                <title>SUM now always returns Double</title>
+                <para>
+                    We did fix the SUM operation to always return <classname>Double</classname> as requested by the spec.
+                    Previously we did return whatever Numeric the JDBC driver did serve, resulting in non portable code.
+                </para>
+            </section>
+            <section id="jpa_3.2_InvalidColumnNames">
+                <title>Invalid Column Name Changes</title>
+                <para>
+                    We did review and update the list of invalid column names for most <classname>DBDicationary</classname>.
+                    The list of tested reserved words got enriched with previously forbidden column names to avoid backward
+                    incompatibility issues.
+                    The list can ge retrieved and configured via
+                    <ulink url="../../apidocs/org/apache/openjpa/jdbc/sql/DBDictionary.html#getInvalidColumnWordSet()">
+                        <methodname>DBDictionary.getInvalidColumnWordSet</methodname></ulink>
+                </para>
+            </section>
+            <section id="jpa_3.2_HsqlMappingTool">
+                <title>MappingTool Behavior for HSQLDB</title>
+                <para>
+                    There have been 2 changes for Hypersonic (HSQLDB).
+                    We fixed a bug which did cause <classname>long</classname> fields getting mapped to <literal>INTEGER</literal>
+                    instead of <literal>BIGINT</literal>.
+                </para>
+                <para>
+                    Java <classname>double</classname> fields previously got mapped to <literal>NUMERIC</literal> which
+                    does lack fraction digits. Thus the value <literal>7.3425343</literal> got truncated to <literal>7</literal>.
+                    We now map <classname>double</classname> fields in Entities to <literal>DOUBLE</literal> SQL column types.
+                </para>
+            </section>
+            <section id="jpa_3.2_OracleTimestampPrecision">
+                <title>Respect TIMESTAMP precision in Oracle</title>
+                <para>
+                    Due to a bug we did hardcoded round at 3 digits precision.
+                    So we essentially only allowed millis, even on a TIMESTAMP(6) field.
+                    The new code does respect the second fractions and now defaults to 6.
+                    It should be compatible but it might behave very subtle different.
+                </para>
+            </section>
+            <section id="jpa_3.2_UnaryOps">
+                <title>Unary Operations return types</title>
+                <para>
+                    Before OpenJPA-3.2.0 Unary Operations like <literal>MIN</literal>, <literal>MAX</literal>, <literal>SUM</literal>, etc
+                    did return whatever type got returned by the JDBC driver. For certain column types this could also have been internal
+                    classes of that very JDBC driver. E.g. a <literal>SELECT MAX(a.someLocalDateField) ..</literal> might have returned
+                    an instance of types <classname>com.oracle.jdbc....</classname> or <literal>com.microsoft.sqlserver...</literal>, etc.
+                    We now use the respective <ulink url="../../apidocs/org/apache/openjpa/jdbc/sql/DBDictionary.html">
+                    <methodname>DBDictionary</methodname></ulink> to request the correct type from the <classname>ResultSet</classname>.
+                </para>
+            </section>
+            <section id="jpa_3.2_PostgreSqlQueryTimeout">
+                <title>PostgreSQL now supports setQueryTimeOut</title>
+                <para>
+                    PostgreSQL does now support client side setQueryTimeout.
+                    User might see this come alive and now return different when the situation occurs.
+                    This flag is automatically enabled if running against PostgreSQL 10 or later.
+                    It can also be configured manually via
+                    <ulink url="../../apidocs/org/apache/openjpa/jdbc/sql/DBDictionary.html#supportsQueryTimeout">
+                        <fieldname>DBDictionary.supportsQueryTimeout</fieldname></ulink>
+                </para>
+            </section>
+        </section>
+    </section>
+
 </appendix>
Reply | Threaded
Open this post in threaded view
|

[openjpa] 02/04: reserved column words should be public

struberg
In reply to this post by struberg
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 61540f00c4bb51c623f2b33a6d12fded14d61d7a
Author: Mark Struberg <[hidden email]>
AuthorDate: Sun May 9 00:06:13 2021 +0200

    reserved column words should be public
   
    allow configuration
---
 .../src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
index a9a1030..8ccaf77 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
@@ -425,6 +425,12 @@ public class DBDictionary
     public int nativeSequenceType= Seq.TYPE_CONTIGUOUS;
 
     /**
+     * reservedWordSet subset that CANNOT be used as valid column names
+     * (i.e., without surrounding them with double-quotes).
+     */
+    public Set<String> invalidColumnWordSet = new HashSet<>();
+
+    /**
      * This variable was used in 2.1.x and prior releases to indicate that
      * OpenJPA should not use the CACHE clause when getting a native
      * sequence; instead the INCREMENT BY clause gets its value equal to the
@@ -450,9 +456,6 @@ public class DBDictionary
     protected boolean isJDBC3 = false;
     protected boolean isJDBC4 = false;
     protected final Set<String> reservedWordSet = new HashSet<>();
-    // reservedWordSet subset that CANNOT be used as valid column names
-    // (i.e., without surrounding them with double-quotes)
-    protected Set<String> invalidColumnWordSet = new HashSet<>();
     protected final Set<String> systemSchemaSet = new HashSet<>();
     protected final Set<String> systemTableSet = new HashSet<>();
     protected final Set<String> fixedSizeTypeNameSet = new HashSet<>();
Reply | Threaded
Open this post in threaded view
|

[openjpa] 03/04: add java.time Entity field types support

struberg
In reply to this post by struberg
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 6eb984a3752c26998d7a2098376bda4221648459
Author: Mark Struberg <[hidden email]>
AuthorDate: Sun May 9 00:07:12 2021 +0200

    add java.time Entity field types support
---
 .../src/doc/manual/jpa_overview_meta.xml           |  7 ++++++
 openjpa-project/src/doc/manual/jpa_overview_pc.xml | 25 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/openjpa-project/src/doc/manual/jpa_overview_meta.xml b/openjpa-project/src/doc/manual/jpa_overview_meta.xml
index 92679ea..45033b8 100644
--- a/openjpa-project/src/doc/manual/jpa_overview_meta.xml
+++ b/openjpa-project/src/doc/manual/jpa_overview_meta.xml
@@ -1181,9 +1181,16 @@ Character[]</classname>, <classname>java.math.BigDecimal</classname>,
 <classname>java.math.BigInteger</classname>, <classname>
 java.util.Date</classname>, <classname>java.util.Calendar</classname>,
 <classname>java.sql.Date</classname>, <classname>java.sql.Timestamp</classname>,
+<classname>java.sql.Time</classname>,
 <classname>Enum</classname>s, and <classname>Serializable</classname> types.
             </para>
             <para>
+Since JPA 2.2 the following <classname>java.time</classname> Types are also supported:
+<classname>java.time.LocalDate</classname>, <classname>java.time.LocalDateTime</classname>,
+<classname>java.time.LocalTime</classname>, <classname>java.time.LocalOffsetTime</classname>
+and <classname>java.time.OffsetDateTime</classname>.
+            </para>
+            <para>
 <classname>Basic</classname> declares these properties:
             </para>
             <itemizedlist>
diff --git a/openjpa-project/src/doc/manual/jpa_overview_pc.xml b/openjpa-project/src/doc/manual/jpa_overview_pc.xml
index 900ba56..ba0b3de 100644
--- a/openjpa-project/src/doc/manual/jpa_overview_pc.xml
+++ b/openjpa-project/src/doc/manual/jpa_overview_pc.xml
@@ -435,6 +435,31 @@ java.lang.Byte</classname>, etc)
 <classname>java.math.BigDecimal</classname>
                     </para>
                 </listitem>
+                <listitem>
+                    <para>
+<classname>java.time.LocalDate</classname>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+<classname>java.time.LocalDateTime</classname>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+<classname>java.time.LocalTime</classname>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+<classname>java.time.OffsetDateTime</classname>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+<classname>java.time.OffsetTime</classname>
+                    </para>
+                </listitem>
             </itemizedlist>
             <para>
 JPA also supports <classname>byte[]</classname>, <classname>Byte[]</classname>,
Reply | Threaded
Open this post in threaded view
|

[openjpa] 04/04: wip update compat matrix

struberg
In reply to this post by struberg
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 eec95cd6cb0a30d94b80f0eaf7b2b6838bdaf415
Author: Mark Struberg <[hidden email]>
AuthorDate: Sun May 9 00:07:40 2021 +0200

    wip update compat matrix
---
 .../src/doc/manual/supported_databases.xml         | 82 ++++++++++++++++------
 1 file changed, 62 insertions(+), 20 deletions(-)

diff --git a/openjpa-project/src/doc/manual/supported_databases.xml b/openjpa-project/src/doc/manual/supported_databases.xml
index 2b13038..b6332e5 100644
--- a/openjpa-project/src/doc/manual/supported_databases.xml
+++ b/openjpa-project/src/doc/manual/supported_databases.xml
@@ -96,44 +96,58 @@ users, but may not support every feature of this release, please refer to the
                 </row>
                 <row>
                     <entry colname="dbname">
-                        <link linkend="dbsupport_db2">IBM DB2</link>
+                        <link linkend="dbsupport_h2">H2</link>
                     </entry>
                     <entry colname="dbversion">
-                        8.1, 8.2, 9.1, 9.5, 9.7
+                        1.4.195, 1.4.196
                     </entry>
                     <entry colname="drivname">
-                        IBM DB2 JDBC Universal Driver
+                        H2 Embedded JDBC Driver
                     </entry>
                     <entry colname="drivversion">
-                        3.50.152
+                        Same as Database Version
                     </entry>
                 </row>
                 <row>
                     <entry colname="dbname">
-                        <link linkend="dbsupport_informix">IBM Informix Dynamic Server</link>
+                        <link linkend="dbsupport_sqlserver">Microsoft SQL Server</link>
                     </entry>
                     <entry colname="dbversion">
-                        10.00xC6, 11.10xC1, 11.5xC1
+                        2005 (9.00), 2008 (10.00), 2017
                     </entry>
                     <entry colname="drivname">
-                        Informix JDBC driver
+                        Microsoft SQL Server JDBC Driver
                     </entry>
                     <entry colname="drivversion">
-                        3.00 JC3, 3.10 JC1, 3.50 JC1
+                        1.2 or 2.0, 9.2.1
                     </entry>
                 </row>
                 <row>
                     <entry colname="dbname">
-                        <link linkend="dbsupport_sqlserver">Microsoft SQL Server</link>
+                        <link linkend="dbsupport_oracle">Oracle</link>
                     </entry>
                     <entry colname="dbversion">
-                        2005 (9.00), 2008 (10.00), 2017
+                        10g (10.1, 10.2), 11g (11.1, 11.2), 12c, 18c, 19c
                     </entry>
                     <entry colname="drivname">
-                        Microsoft SQL Server JDBC Driver
+                        Oracle JDBC driver
                     </entry>
                     <entry colname="drivversion">
-                        1.2 or 2.0
+                        11.2.0.1, 11.2.0.4, 19.3.0.0
+                    </entry>
+                </row>
+                <row>
+                    <entry colname="dbname">
+                        <link linkend="dbsupport_postgresql">PostgreSQL</link>
+                    </entry>
+                    <entry colname="dbversion">
+                        8.3.5, 8.4, 9, 11, 12, 13
+                    </entry>
+                    <entry colname="drivname">
+                        PostgreSQL Native Driver
+                    </entry>
+                    <entry colname="drivversion">
+                        8.3 JDBC3 (build 603), 8.4 JDBC3 (build 701), 42.2.5, , 42.2.19
                     </entry>
                 </row>
                 <row>
@@ -152,30 +166,58 @@ users, but may not support every feature of this release, please refer to the
                 </row>
                 <row>
                     <entry colname="dbname">
-                        <link linkend="dbsupport_oracle">Oracle</link>
+                        <link linkend="dbsupport_mariadb">MariaDB</link>
                     </entry>
                     <entry colname="dbversion">
-                        10g (10.1, 10.2), 11g (11.1, 11.2), 12c, 18c
+                        10.5
                     </entry>
                     <entry colname="drivname">
-                        Oracle JDBC driver
+                        MariaDB Driver
                     </entry>
                     <entry colname="drivversion">
-                        11.2.0.1, 11.2.0.4
+                        2.7.2
                     </entry>
                 </row>
                 <row>
                     <entry colname="dbname">
-                        <link linkend="dbsupport_postgresql">PostgreSQL</link>
+                        <link linkend="dbsupport_hypersonic">Hypersonic HSQLDB</link>
                     </entry>
                     <entry colname="dbversion">
-                        8.3.5, 8.4, 9, 11
+                        2.5.1
                     </entry>
                     <entry colname="drivname">
-                        PostgreSQL Native Driver
+                        HSQLDB Driver
+                    </entry>
+                    <entry colname="drivversion">
+                        Same as Database Version
+                    </entry>
+                </row>
+                <row>
+                    <entry colname="dbname">
+                        <link linkend="dbsupport_db2">IBM DB2</link>
+                    </entry>
+                    <entry colname="dbversion">
+                        8.1, 8.2, 9.1, 9.5, 9.7
+                    </entry>
+                    <entry colname="drivname">
+                        IBM DB2 JDBC Universal Driver
                     </entry>
                     <entry colname="drivversion">
-                        8.3 JDBC3 (build 603), 8.4 JDBC3 (build 701), 42.2.5
+                        3.50.152
+                    </entry>
+                </row>
+                <row>
+                    <entry colname="dbname">
+                        <link linkend="dbsupport_informix">IBM Informix Dynamic Server</link>
+                    </entry>
+                    <entry colname="dbversion">
+                        10.00xC6, 11.10xC1, 11.5xC1
+                    </entry>
+                    <entry colname="drivname">
+                        Informix JDBC driver
+                    </entry>
+                    <entry colname="drivversion">
+                        3.00 JC3, 3.10 JC1, 3.50 JC1
                     </entry>
                 </row>
                 <row>