From a7969c120bfba06b883f319788fc50ca0ef06b69 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Fri, 5 Apr 2019 13:58:05 +0200 Subject: [PATCH] OPENJPA-2555 rename DBDictionary property to dateFractionDigits dateFractionDigits is more self-explaning than defaultFractionDigits. It also fits better into the already existing date* config settings. --- .../java/org/apache/openjpa/jdbc/sql/DBDictionary.java | 10 +++++----- .../org/apache/openjpa/jdbc/sql/MariaDBDictionary.java | 2 +- .../org/apache/openjpa/jdbc/sql/MySQLDictionary.java | 2 +- .../openjpa/persistence/TestMixedMappingLocation.java | 2 +- .../openjpa/persistence/access/TestExplicitAccess.java | 2 +- .../persistence/access/xml/TestXMLExplicitAccess.java | 2 +- .../jdbc/maps/m2mmapex10/TestMany2ManyMapEx10.java | 2 +- .../persistence/jdbc/query/TestHintedQuery.java | 2 +- .../query/TestTemporalTypeQueryParameterBinding.java | 2 +- .../openjpa/persistence/xml/TestSimpleXmlEntity.java | 2 +- .../openjpa/persistence/xml/TestXmlOverrideEntity.java | 2 +- 11 files changed, 15 insertions(+), 15 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 903f3b66c..22ac05ce6 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 @@ -451,9 +451,9 @@ public class DBDictionary * This value is only being used if no explicit {@code @Column(scale=n)} is set or n is zero. * Use {@code @Column(scale=-1)} to disable the explicit fraction part in the SQL generator. * @see #fractionalTypeNameSet - * @see #getFractionLength(Column, String) + * @see #getDateFractionDigits(Column, String) */ - public int defaultFractionLength = 6; + public int dateFractionDigits = 6; protected final Set typeModifierSet = new HashSet<>(); @@ -2009,7 +2009,7 @@ public class DBDictionary colSize = col.getDecimalDigits() == -1 ? 0 : col.getDecimalDigits(); } else { - colSize = getFractionLength(col, typeName); + colSize = getDateFractionDigits(col, typeName); } size = "(" + colSize + ")"; } else if (colSize > 0) { @@ -2030,8 +2030,8 @@ public class DBDictionary * @return the fraction length of types which have a fraction * @see #fractionalTypeNameSet */ - protected int getFractionLength(Column col, String typeName) { - return defaultFractionLength; + protected int getDateFractionDigits(Column col, String typeName) { + return dateFractionDigits; } /** diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java index 454288cc7..c377954fc 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MariaDBDictionary.java @@ -166,7 +166,7 @@ public class MariaDBDictionary extends DBDictionary { fixedSizeTypeNameSet.remove("NUMERIC"); - defaultFractionLength = 0; + dateFractionDigits = 0; } @Override 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 256bd3637..31aa32681 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 @@ -167,7 +167,7 @@ public class MySQLDictionary fixedSizeTypeNameSet.remove("NUMERIC"); - defaultFractionLength = 0; + dateFractionDigits = 0; } @Override diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/TestMixedMappingLocation.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/TestMixedMappingLocation.java index ea09d09b6..27ebac7e2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/TestMixedMappingLocation.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/TestMixedMappingLocation.java @@ -33,7 +33,7 @@ public class TestMixedMappingLocation extends SingleEMFTestCase { @Override public void setUp() { setUp(DROP_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", MixedMappingLocationEmbeddedId.class, MixedMappingLocation.class); } /** diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java index 18787695f..7d1867327 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/TestExplicitAccess.java @@ -41,7 +41,7 @@ public class TestExplicitAccess extends SingleEMFTestCase { @Override public void setUp() { setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", PropAccess.class, FieldAccess.class, DefFieldMixedPropAccess.class , DefPropMixedFieldAccess.class, AbstractMappedSuperField.class, PropertySub.class, diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java index 8891028a7..7d047b087 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/xml/TestXMLExplicitAccess.java @@ -34,7 +34,7 @@ public class TestXMLExplicitAccess extends SingleEMFTestCase { @Override public void setUp() throws Exception { super.setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)"); + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)"); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/TestMany2ManyMapEx10.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/TestMany2ManyMapEx10.java index 5495d3021..636ccec7a 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/TestMany2ManyMapEx10.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/maps/m2mmapex10/TestMany2ManyMapEx10.java @@ -60,7 +60,7 @@ public class TestMany2ManyMapEx10 extends SQLListenerTestCase { @Override public void setUp() { super.setUp(DROP_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", EmployeePK.class, PhonePK.class, Employee.class, PhoneNumber.class); createObj(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestHintedQuery.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestHintedQuery.java index c1165db1a..4fc7b6c09 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestHintedQuery.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestHintedQuery.java @@ -39,7 +39,7 @@ public class TestHintedQuery extends SQLListenerTestCase { @Override public void setUp() { super.setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", TimeKeeper.class); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java index a4f4c2a69..90c9cbd1f 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestTemporalTypeQueryParameterBinding.java @@ -64,7 +64,7 @@ public class TestTemporalTypeQueryParameterBinding extends SingleEMFTestCase { @Override public void setUp() throws Exception { super.setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", TimeKeeper.class, TimeEntity.class); em = emf.createEntityManager(); diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestSimpleXmlEntity.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestSimpleXmlEntity.java index 0016d570f..60bdc1639 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestSimpleXmlEntity.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestSimpleXmlEntity.java @@ -27,7 +27,7 @@ public class TestSimpleXmlEntity @Override public void setUp() { setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", org.apache.openjpa.persistence.embed.attrOverrides.AnnoOverEmbed.class); } diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestXmlOverrideEntity.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestXmlOverrideEntity.java index 9a8fcb7a2..9c29a77ca 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestXmlOverrideEntity.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/xml/TestXmlOverrideEntity.java @@ -36,7 +36,7 @@ public class TestXmlOverrideEntity extends SingleEMFTestCase { @Override public void setUp() throws ClassNotFoundException { setUp(CLEAR_TABLES, - "openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)", + "openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)", org.apache.openjpa.persistence.embed.attrOverrides.AnnoOverEmbed.class); // make sure that XmlOverrideEntity is registered for our metadata tests