You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2021/04/08 12:57:01 UTC

[openjpa] 02/02: OPENJPA-2863 use MICROS for TIMESTAMP precision in Oracle

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 683e78045cba80703154207a96e5935d64a076e1
Author: Mark Struberg <st...@apache.org>
AuthorDate: Thu Apr 8 14:55:28 2021 +0200

    OPENJPA-2863 use MICROS for TIMESTAMP precision in Oracle
    
    Default type for Oracle is TIMESTAMP(6) but somehow we did only
    round to 3 fraction digits in the past.
    Can be tweaked to the old value via DBDictionary config in persistence.xml
---
 .../src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
index 8dd0687..b3d7c17 100644
--- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
+++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
@@ -193,6 +193,10 @@ public class OracleDictionary
         longVarbinaryTypeName = "BLOB";
         timeTypeName = "DATE";
         timeWithZoneTypeName = "DATE";
+
+        // default TIMESTAMP is TIMESTAMP(6) which means MICROs
+        datePrecision = MICRO;
+
         varcharTypeName = "VARCHAR2{0}";
         fixedSizeTypeNameSet.addAll(Arrays.asList(new String[]{
             "LONG RAW", "RAW", "LONG", "REF",