[openjpa] branch master updated: OPENJPA-2555 add docs for DateFractionDigits

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[openjpa] branch master updated: OPENJPA-2555 add docs for DateFractionDigits

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


The following commit(s) were added to refs/heads/master by this push:
     new d8ddf87  OPENJPA-2555 add docs for DateFractionDigits
d8ddf87 is described below

commit d8ddf87a4752921f75e759f735282a70143dd139
Author: Mark Struberg <[hidden email]>
AuthorDate: Fri Apr 5 23:04:44 2019 +0200

    OPENJPA-2555 add docs for DateFractionDigits
---
 .../src/doc/manual/ref_guide_dbsetup.xml           | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
index a021dc0..6de9dac 100644
--- a/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
+++ b/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
@@ -1423,6 +1423,27 @@ The SQL function call to obtain the current timestamp from the database.
 Defaults to <literal>"CURRENT_TIMESTAMP"</literal>.
                     </para>
                 </listitem>
+                <listitem id="DBDictionary.DateFractionDigits">
+                    <para>
+                        <indexterm>
+                            <primary>
+                                JDBC
+                            </primary>
+                            <secondary>
+                                DateFractionDigits
+                            </secondary>
+                        </indexterm>
+                        <literal>DateFractionDigits</literal>
+                        Some databases support to store sub-second fraction values.
+                        The digits to store can sometimes be configured.
+                        This value defines the default number of digits to store in the database.
+                        A <code>dateFractionDigits=3</code> will e.g. lead to a <code>DATETIME(3)</code> on some databases.
+
+                        Note that this default can be overwritten to an integer value n per column via
+                        <code>@Column(scale=n)</code>.
+                        A <code>@Column(scale=-1)</code> will set the fraction digits to zero.
+                    </para>
+                </listitem>
                 <listitem id="DBDictionary.DatePrecision">
                     <para>
                     <indexterm>
@@ -3897,6 +3918,26 @@ The <literal>mysql</literal> dictionary also understands the following
 properties:
             </para>
             <itemizedlist>
+                <listitem id="MySQLDictionary.DateFractionDigits">
+                    <para>
+                        <indexterm>
+                            <primary>
+                                MySQL
+                            </primary>
+                            <secondary>
+                                DateFractionDigits
+                            </secondary>
+                        </indexterm>
+                        <literal>DateFractionDigits</literal>:
+                        Since MySQL 5.8 a timestamp (<code>DATETIME</code>) can store up to 6 sub-second fractions.
+                        The default in MySQL and OpenJPA is 0 for backward compatibility reasons.
+                        This default can be changed by setting <literal>DateFractionDigits</literal> to the number of
+                        sub-second fraction digits to be stored. This will e.g. result in a <code>DATETIME(6)</code> column.
+                        The number of fraction digits to be generated can also be tweaked via the
+                        <code>@Column(scale=n)</code> annotation, where n is the number of digits.
+                        This setting has primarily an impact on the generated SQL.
+                    </para>
+                </listitem>
                 <listitem id="MySQLDictionary.DriverDeserializesBlobs">
                     <para>
                     <indexterm>