diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2020-05-03 01:56:57 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2020-05-03 01:56:57 +0000 |
commit | 450ef90a1c039611141698c2724e5d70564bff0a (patch) | |
tree | 871835a71a8e77dd13218089b656a4a1ffe54858 | |
parent | 42c8f108f9e45d7f3e97b67f7c4fe2b8fa5453f1 (diff) | |
download | jackcess-450ef90a1c039611141698c2724e5d70564bff0a.tar.gz jackcess-450ef90a1c039611141698c2724e5d70564bff0a.zip |
change the default DateTimeType to LOCAL_DATE_TIME
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1325 f203690c-595d-4dc9-a70b-905162fa7fd2
7 files changed, 16 insertions, 2 deletions
diff --git a/src/changes/changes.xml b/src/changes/changes.xml index c2f9668..5866d54 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -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"> diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java index 71b4c5e..532eb65 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java @@ -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); } /** diff --git a/src/test/java/com/healthmarketscience/jackcess/ComplexColumnTest.java b/src/test/java/com/healthmarketscience/jackcess/ComplexColumnTest.java index c8b81a3..e2fdc3d 100644 --- a/src/test/java/com/healthmarketscience/jackcess/ComplexColumnTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/ComplexColumnTest.java @@ -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"); diff --git a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java index e2e16e5..2d118a7 100644 --- a/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/DatabaseTest.java @@ -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"); diff --git a/src/test/java/com/healthmarketscience/jackcess/IndexTest.java b/src/test/java/com/healthmarketscience/jackcess/IndexTest.java index 8633dea..4836231 100644 --- a/src/test/java/com/healthmarketscience/jackcess/IndexTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/IndexTest.java @@ -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"); diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java index bf386d8..cfcca83 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/IndexCodesTest.java @@ -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()) { diff --git a/src/test/java/com/healthmarketscience/jackcess/util/ExportTest.java b/src/test/java/com/healthmarketscience/jackcess/util/ExportTest.java index 5ffdbd9..8eb2c15 100644 --- a/src/test/java/com/healthmarketscience/jackcess/util/ExportTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/util/ExportTest.java @@ -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") |