]> source.dussan.org Git - jackcess.git/commitdiff
change the default DateTimeType to LOCAL_DATE_TIME
authorJames Ahlborn <jtahlborn@yahoo.com>
Sun, 3 May 2020 01:56:57 +0000 (01:56 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sun, 3 May 2020 01:56:57 +0000 (01:56 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1325 f203690c-595d-4dc9-a70b-905162fa7fd2

src/changes/changes.xml
src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java
src/test/java/com/healthmarketscience/jackcess/ComplexColumnTest.java
src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java
src/test/java/com/healthmarketscience/jackcess/IndexTest.java
src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java
src/test/java/com/healthmarketscience/jackcess/util/ExportTest.java

index c2f966856889820d2bade0fed5c4cb1a88abba59..5866d54c7ba986e2924c3c2a3c41c36c0b9ae529 100644 (file)
@@ -15,6 +15,9 @@
       <action dev="jahlborn" type="update">
         Enabled expression evaluation by default.
       </action>
+      <action dev="jahlborn" type="update">
+        Change the default DateTimeType to LOCAL_DATE_TIME.
+      </action>
     </release>
     <release version="3.0.1" date="2019-04-13">
       <action dev="jahlborn" type="update">
index 71b4c5ec90e05b4d889b100eb966349a88789b7a..532eb65167d533d35936dfa83605084fb56cfba6 100644 (file)
@@ -2115,13 +2115,13 @@ public class DatabaseImpl implements Database, DateTimeContext
 
   /**
    * Returns the default DateTimeType.  This defaults to
-   * {@link DateTimeType#DATE}, but can be overridden using the system
+   * {@link DateTimeType#LOCAL_DATE_TIME}, but can be overridden using the system
    * property {@value com.healthmarketscience.jackcess.Database#DATE_TIME_TYPE_PROPERTY}.
    * @usage _advanced_method_
    */
   public static DateTimeType getDefaultDateTimeType() {
     return getEnumSystemProperty(DateTimeType.class, DATE_TIME_TYPE_PROPERTY,
-                                 DateTimeType.DATE);
+                                 DateTimeType.LOCAL_DATE_TIME);
   }
 
   /**
index c8b81a3ab9a76a497d321955f9fd473c7cf2f6dd..e2fdc3d2224382bee6f177c776595b300440f6ab 100644 (file)
@@ -51,6 +51,7 @@ public class ComplexColumnTest extends TestCase
   {
     for(final TestDB testDB : TestDB.getSupportedForBasename(Basename.COMPLEX)) {
       Database db = openCopy(testDB);
+      db.setDateTimeType(DateTimeType.DATE);
       db.setTimeZone(TEST_TZ);
 
       Table t1 = db.getTable("Table1");
index e2e16e550e6a3ba410d1436d2d6e912c59417aa5..2d118a79cb28399354450b99e5c07b497b6ae7fe 100644 (file)
@@ -160,6 +160,8 @@ public class DatabaseTest extends TestCase
   public void testGetNextRow() throws Exception {
     for (final TestDB testDB : SUPPORTED_DBS_TEST_FOR_READ) {
       final Database db = open(testDB);
+      db.setDateTimeType(DateTimeType.DATE);
+
       assertEquals(4, db.getTableNames().size());
       final Table table = db.getTable("Table1");
 
@@ -623,6 +625,7 @@ public class DatabaseTest extends TestCase
   public void testWriteAndReadDate() throws Exception {
     for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
       Database db = createMem(fileFormat);
+      db.setDateTimeType(DateTimeType.DATE);
 
       Table table = new TableBuilder("test")
         .addColumn(new ColumnBuilder("name", DataType.TEXT))
@@ -693,6 +696,7 @@ public class DatabaseTest extends TestCase
 
     for (final FileFormat fileFormat : SUPPORTED_FILEFORMATS) {
       Database db = createMem(fileFormat);
+      db.setDateTimeType(DateTimeType.DATE);
       db.setTimeZone(tz);
 
       Table table = new TableBuilder("test")
@@ -716,6 +720,7 @@ public class DatabaseTest extends TestCase
 
     for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.OLD_DATES)) {
       Database db = openCopy(testDB);
+      db.setDateTimeType(DateTimeType.DATE);
 
       Table t = db.getTable("Table1");
 
index 8633dead593ca3d7358447d141af34c8a93bc841..483623184b56169d8c68184b9acfe15f467252af 100644 (file)
@@ -350,6 +350,7 @@ public class IndexTest extends TestCase {
   public void testUniqueEntryCount() throws Exception {
     for (final TestDB testDB : SUPPORTED_DBS_TEST) {
       Database db = openCopy(testDB);
+      db.setDateTimeType(DateTimeType.DATE);
       Table table = db.getTable("Table1");
       IndexImpl indA = (IndexImpl)table.getIndex("PrimaryKey");
       IndexImpl indB = (IndexImpl)table.getIndex("B");
index bf386d835a72fdb0b94306f3116b27ac38a2de69..cfcca8339f49a0853ca278fdab23592cf8e87082 100644 (file)
@@ -31,6 +31,7 @@ import com.healthmarketscience.jackcess.Cursor;
 import com.healthmarketscience.jackcess.CursorBuilder;
 import com.healthmarketscience.jackcess.DataType;
 import com.healthmarketscience.jackcess.Database;
+import com.healthmarketscience.jackcess.DateTimeType;
 import com.healthmarketscience.jackcess.Index;
 import com.healthmarketscience.jackcess.Row;
 import com.healthmarketscience.jackcess.Table;
@@ -65,6 +66,7 @@ public class IndexCodesTest extends TestCase {
   {
     for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX_CODES, true)) {
       Database db = openMem(testDB);
+      db.setDateTimeType(DateTimeType.DATE);
 
       for(Table t : db) {
         for(Index index : t.getIndexes()) {
index 5ffdbd94612e9ca7bbee7519a8c0d8954f26f4d6..8eb2c157bab2e09d3d19dd6e5d1411e7688ffe28 100644 (file)
@@ -26,6 +26,7 @@ import static com.healthmarketscience.jackcess.Database.*;
 import com.healthmarketscience.jackcess.ColumnBuilder;
 import com.healthmarketscience.jackcess.DataType;
 import com.healthmarketscience.jackcess.Database;
+import com.healthmarketscience.jackcess.DateTimeType;
 import com.healthmarketscience.jackcess.Table;
 import com.healthmarketscience.jackcess.TableBuilder;
 import com.healthmarketscience.jackcess.impl.JetFormatTest;
@@ -52,6 +53,7 @@ public class ExportTest extends TestCase
 
     for (final FileFormat fileFormat : JetFormatTest.SUPPORTED_FILEFORMATS) {
       Database db = create(fileFormat);
+      db.setDateTimeType(DateTimeType.DATE);
       db.setTimeZone(TEST_TZ);
 
       Table t = new TableBuilder("test")