From d8ddf87a4752921f75e759f735282a70143dd139 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Fri, 5 Apr 2019 23:04:44 +0200 Subject: [PATCH] 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 a021dc021..6de9dacfd 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 "CURRENT_TIMESTAMP". + + + + + JDBC + + + DateFractionDigits + + + DateFractionDigits + 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 dateFractionDigits=3 will e.g. lead to a DATETIME(3) on some databases. + + Note that this default can be overwritten to an integer value n per column via + @Column(scale=n). + A @Column(scale=-1) will set the fraction digits to zero. + + @@ -3897,6 +3918,26 @@ The mysql dictionary also understands the following properties: + + + + + MySQL + + + DateFractionDigits + + + DateFractionDigits: + Since MySQL 5.8 a timestamp (DATETIME) 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 DateFractionDigits to the number of + sub-second fraction digits to be stored. This will e.g. result in a DATETIME(6) column. + The number of fraction digits to be generated can also be tweaked via the + @Column(scale=n) annotation, where n is the number of digits. + This setting has primarily an impact on the generated SQL. + +