polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [36/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.
Date Fri, 17 Apr 2015 16:08:48 GMT
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
index 1917853..05d2229 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
@@ -21,13 +21,12 @@ package org.qi4j.test.entity;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -54,7 +53,6 @@ import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.not;
-import static org.joda.time.DateTimeZone.UTC;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 
@@ -97,7 +95,7 @@ public abstract class AbstractEntityStoreTest
     {
         // Create entity
         EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder( TestEntity.class );
-        builder.instance().dateValue().set( new Date() );
+        builder.instance().dateValue().set( LocalDate.now() );
         TestEntity instance = builder.newInstance();
 
         instance.name().set( "Test" );
@@ -108,10 +106,10 @@ public abstract class AbstractEntityStoreTest
         instance.booleanValue().set( Boolean.TRUE );
         instance.bigIntegerValue().set( new BigInteger( "42" ) );
         instance.bigDecimalValue().set( new BigDecimal( "42" ) );
-        instance.dateValue().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-        instance.dateTimeValue().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-        instance.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) );
-        instance.localDateValue().set( new LocalDate( "2020-03-04" ) );
+        instance.dateValue().set( LocalDate.parse( "2020-03-04" ));
+        instance.dateTimeValue().set( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) );
+        instance.localDateTimeValue().set( LocalDateTime.parse( "2020-03-04T13:23:00" ) );
+        instance.localDateValue().set( LocalDate.parse( "2020-03-04" ) );
         instance.association().set( instance );
 
         ValueBuilder<Tjabba> valueBuilder4 = module.newValueBuilder( Tjabba.class );
@@ -195,19 +193,19 @@ public abstract class AbstractEntityStoreTest
 
             assertThat( "property 'dateValue' has correct value",
                         instance.dateValue().get(),
-                        equalTo( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() ) );
+                        equalTo( LocalDate.parse( "2020-03-04") ) );
 
             assertThat( "property 'dateTimeValue' has correct value",
                         instance.dateTimeValue().get(),
-                        equalTo( new DateTime( "2020-03-04T13:24:35", UTC ) ) );
+                        equalTo( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) ) );
 
             assertThat( "property 'localDateTimeValue' has correct value",
                         instance.localDateTimeValue().get(),
-                        equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );
+                        equalTo( LocalDateTime.parse( "2020-03-04T13:23:00" ) ) );
 
             assertThat( "property 'localDateValue' has correct value",
                         instance.localDateValue().get(),
-                        equalTo( new LocalDate( "2020-03-04" ) ) );
+                        equalTo( LocalDate.parse( "2020-03-04" ) ) );
 
             assertThat( "property 'name' has correct value",
                         instance.name().get(),
@@ -481,10 +479,10 @@ public abstract class AbstractEntityStoreTest
         Property<BigDecimal> bigDecimalValue();
 
         @Optional
-        Property<Date> dateValue();
+        Property<LocalDate> dateValue();
 
         @Optional
-        Property<DateTime> dateTimeValue();
+        Property<ZonedDateTime> dateTimeValue();
 
         @Optional
         Property<LocalDateTime> localDateTimeValue();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
index 38e36d8..00c4a21 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
@@ -22,11 +22,11 @@ package org.qi4j.test.indexing;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.qi4j.api.query.NotQueryableException;
@@ -47,8 +47,6 @@ import org.qi4j.test.indexing.model.QueryParam;
 
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsEqual.equalTo;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.joda.time.DateTimeZone.forID;
 import static org.junit.Assert.assertThat;
 import static org.qi4j.api.query.QueryExpressions.and;
 import static org.qi4j.api.query.QueryExpressions.contains;
@@ -569,7 +567,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.dateValue(), new DateTime( "2010-03-04T13:24:35", UTC ).toDate() ) ) );
+            eq( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script40_Date: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -581,7 +579,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateValue(), new DateTime( "2010-03-04T13:24:35", UTC ).toDate() ) ) );
+            ne( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script41_Date: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -593,7 +591,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateValue(), new DateTime( "2010-03-04T14:24:35", forID( "CET" ) ).toDate() ) ) );
+            ne( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script42_Date: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -605,8 +603,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.dateValue(), new DateTime( "2005-03-04T13:24:35", UTC ).toDate() ),
-                 lt( person.dateValue(), new DateTime( "2015-03-04T13:24:35", UTC ).toDate() ) ) ) );
+            and( gt( person.dateValue(), LocalDate.parse( "2005-03-04" ) ),
+                 lt( person.dateValue(), LocalDate.parse( "2015-03-04" ) ) ) ) );
         System.out.println( "*** script43_Date: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -618,7 +616,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.dateTimeValue(), new DateTime( "2010-03-04T13:24:35", UTC ) ) ) );
+            eq( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) ) ) );
         System.out.println( "*** script40_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -630,7 +628,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateTimeValue(), new DateTime( "2010-03-04T13:24:35", UTC ) ) ) );
+            ne( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) ) ) );
         System.out.println( "*** script41_DateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -642,7 +640,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateTimeValue(), new DateTime( "2010-03-04T14:24:35", forID( "CET" ) ) ) ) );
+            ne( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T14:24:35+01:00" ) ) ) );
         System.out.println( "*** script42_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe", "Joe Doe" );
@@ -654,8 +652,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.dateTimeValue(), new DateTime( "2005-03-04T13:24:35", UTC ) ),
-                 lt( person.dateTimeValue(), new DateTime( "2015-03-04T13:24:35", UTC ) ) ) ) );
+            and( gt( person.dateTimeValue(), ZonedDateTime.parse( "2005-03-04T13:24:35Z" ) ),
+                 lt( person.dateTimeValue(), ZonedDateTime.parse( "2015-03-04T13:24:35Z" ) ) ) ) );
         System.out.println( "*** script43_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -667,7 +665,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
+            eq( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script40_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -679,7 +677,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
+            ne( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script41_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -691,7 +689,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", forID( "CET" ) ) ) ) );
+            ne( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script42_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -703,8 +701,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.localDateTimeValue(), new LocalDateTime( "2005-03-04T13:24:35", UTC ) ),
-                 lt( person.localDateTimeValue(), new LocalDateTime( "2015-03-04T13:24:35", UTC ) ) ) ) );
+            and( gt( person.localDateTimeValue(), LocalDateTime.parse( "2005-03-04T13:24:35" ) ),
+                 lt( person.localDateTimeValue(), LocalDateTime.parse( "2015-03-04T13:24:35" ) ) ) ) );
         System.out.println( "*** script43_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -716,7 +714,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.localDateValue(), new LocalDate( "2010-03-04", UTC ) ) ) );
+            eq( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script40_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -728,7 +726,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateValue(), new LocalDate( "2010-03-04", UTC ) ) ) );
+            ne( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script41_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -740,7 +738,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateValue(), new LocalDate( "2010-03-04", forID( "CET" ) ) ) ) );
+            ne( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script42_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -752,8 +750,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.localDateValue(), new LocalDate( "2005-03-04", UTC ) ),
-                 lt( person.localDateValue(), new LocalDate( "2015-03-04", UTC ) ) ) ) );
+            and( gt( person.localDateValue(), LocalDate.parse( "2005-03-04" ) ),
+                 lt( person.localDateValue(), LocalDate.parse( "2015-03-04" ) ) ) ) );
         System.out.println( "*** script43_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
index 72dfe88..491d847 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
@@ -20,12 +20,12 @@ package org.qi4j.test.indexing;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -46,8 +46,6 @@ import org.qi4j.test.indexing.model.entities.CatEntity;
 import org.qi4j.test.indexing.model.entities.FemaleEntity;
 import org.qi4j.test.indexing.model.entities.MaleEntity;
 
-import static org.joda.time.DateTimeZone.UTC;
-
 /**
  * Utility class to populate Index/Query tests data.
  */
@@ -179,10 +177,10 @@ class TestData
                 joeDoe.address().set( address );
                 joeDoe.bigInteger().set( new BigInteger( "23232323232323232323232323" ) );
                 joeDoe.bigDecimal().set( new BigDecimal( "23.4276931348623157e+309" ) );
-                joeDoe.dateValue().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-                joeDoe.dateTimeValue().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-                joeDoe.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) );
-                joeDoe.localDateValue().set( new LocalDate( "2020-03-04" ) );
+                joeDoe.dateValue().set( LocalDate.parse( "2020-03-04" ));
+                joeDoe.dateTimeValue().set( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) );
+                joeDoe.localDateTimeValue().set( LocalDateTime.parse( "2020-03-04T13:23:00" ) );
+                joeDoe.localDateValue().set( LocalDate.parse( "2020-03-04" ) );
                 NameableAssert.trace( joeDoe );
             }
 
@@ -204,10 +202,10 @@ class TestData
                 jackDoe.address().set( address );
                 jackDoe.bigInteger().set( new BigInteger( "42424242424242424242424242" ) );
                 jackDoe.bigDecimal().set( new BigDecimal( "42.2376931348623157e+309" ) );
-                jackDoe.dateValue().set( new DateTime( "2010-03-04T13:24:35", UTC ).toDate() );
-                jackDoe.dateTimeValue().set( new DateTime( "2010-03-04T13:24:35", UTC ) );
-                jackDoe.localDateTimeValue().set( new LocalDateTime( "2010-03-04T13:23:00" ) );
-                jackDoe.localDateValue().set( new LocalDate( "2010-03-04" ) );
+                jackDoe.dateValue().set( LocalDate.parse( "2010-03-04" ) );
+                jackDoe.dateTimeValue().set( ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) );
+                jackDoe.localDateTimeValue().set( LocalDateTime.parse( "2010-03-04T13:23:00" ) );
+                jackDoe.localDateValue().set( LocalDate.parse( "2010-03-04" ) );
 
                 ValueBuilder<URL> urlBuilder = module.newValueBuilder( URL.class );
                 ValueBuilder<Protocol> protocolBuilder = module.newValueBuilder( Protocol.class );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
index 1b1819a..b6b947a 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
@@ -20,12 +20,10 @@ package org.qi4j.test.indexing.model;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
-import java.util.List;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.association.NamedAssociation;
@@ -86,10 +84,10 @@ public interface Person
     Property<BigDecimal> bigDecimal();
 
     @Optional
-    Property<Date> dateValue();
+    Property<LocalDate> dateValue();
 
     @Optional
-    Property<DateTime> dateTimeValue();
+    Property<ZonedDateTime> dateTimeValue();
 
     @Optional
     Property<LocalDateTime> localDateTimeValue();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
index 712691e..778cff9 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
@@ -17,16 +17,16 @@
  */
 package org.qi4j.test.value;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.List;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.type.CollectionType;
 import org.qi4j.api.type.ValueType;
 import org.qi4j.api.value.ValueDeserializer;
+import org.qi4j.api.value.ValueSerializationException;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.test.AbstractQi4jTest;
@@ -41,7 +41,7 @@ public class AbstractJsonDateFormatTest
     extends AbstractQi4jTest
 {
 
-    private final ValueType dateType = new ValueType( Date.class );
+    private final ValueType dateType = new ValueType( ZonedDateTime.class );
 
     @Override
     public void assemble( ModuleAssembly module )
@@ -62,27 +62,25 @@ public class AbstractJsonDateFormatTest
         throws Exception
     {
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"2009-08-12T14:54:27.895+0800\"]" );
-        assertEquals( new DateTime( "2009-08-12T06:54:27.895Z", DateTimeZone.UTC ).toDate(), value.get( 0 ) );
+        List<ZonedDateTime> value = valueDeserializer.deserialize( collectionType, "[\"2009-08-12T14:54:27.895+08:00\"]" );
+        assertEquals( ZonedDateTime.parse( "2009-08-12T06:54:27.895Z" ).toInstant(), value.get( 0 ).toInstant() );
     }
 
-    @Test
+    @Test( expected = ValueSerializationException.class)
     public void givenAtDateFormatWhenConvertingFromSerializedStateExpectValidDate()
         throws Exception
     {
-        long tstamp = System.currentTimeMillis();
+        Instant tstamp = Instant.now();
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"@" + tstamp + "@\"]" );
-        assertEquals( new Date( tstamp ), value.get( 0 ) );
+        List<Instant> value = valueDeserializer.deserialize( collectionType, "[\"@" + tstamp + "@\"]" );
     }
 
-    @Test
+    @Test( expected = ValueSerializationException.class)
     public void givenMicrosoftDateFormatWhenConvertingFromSerializedStateExpectValidDate()
         throws Exception
     {
-        long tstamp = System.currentTimeMillis();
+        Instant tstamp = Instant.now();
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"/Date(" + tstamp + ")/\"]" );
-        assertEquals( new Date( tstamp ), value.get( 0 ) );
+        List<Instant> value = valueDeserializer.deserialize( collectionType, "[\"/Date(" + tstamp + ")/\"]" );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
index a99b1f2..cecf22f 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
@@ -18,10 +18,10 @@ package org.qi4j.test.value;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.entity.EntityReference;
@@ -31,9 +31,6 @@ import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.core.IsEqual.equalTo;
 import static org.hamcrest.core.IsNot.not;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.joda.time.DateTimeZone.forID;
-import static org.joda.time.DateTimeZone.forOffsetHours;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -179,42 +176,46 @@ public abstract class AbstractPlainValueSerializationTest
     @Test
     public void givenDateValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new DateTime( "2020-03-04T13:24:35", forID( "CET" ) ).toDate() );
-        assertThat( serialized, equalTo( "2020-03-04T12:24:35.000Z" ) );
+        ZonedDateTime refTime = ZonedDateTime.parse( "2020-03-04T13:24:35Z" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:24:35Z" ) );
 
-        Date deserialized = valueSerialization.deserialize( Date.class, serialized );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T13:24:35", forID( "CET" ) ).toDate() ) );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T12:24:35", UTC ).toDate() ) );
+        ZonedDateTime deserialized = valueSerialization.deserialize( ZonedDateTime.class, serialized );
+        assertThat( deserialized, equalTo( refTime ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test
     public void givenDateTimeValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new DateTime( "2020-03-04T13:24:35", forOffsetHours( 1 ) ) );
-        assertThat( serialized, equalTo( "2020-03-04T13:24:35.000+01:00" ) );
-        DateTime deserialized = valueSerialization.deserialize( DateTime.class, serialized );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T13:24:35", forOffsetHours( 1 ) ) ) );
+        OffsetDateTime refTime = OffsetDateTime.parse( "2020-03-04T13:24:35+08:00" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:24:35+08:00" ) );
+        OffsetDateTime deserialized = valueSerialization.deserialize( OffsetDateTime.class, serialized );
+        assertThat( deserialized, equalTo( refTime ));
     }
 
     @Test
     public void givenLocalDateTimeValueWhenSerializingAndDeserializingExpectEquals()
     {
         // Serialized without TimeZone
-        String serialized = valueSerialization.serialize( new LocalDateTime( "2020-03-04T13:23:00", forID( "CET" ) ) );
-        assertThat( serialized, equalTo( "2020-03-04T13:23:00.000" ) );
+        LocalDateTime refTime = LocalDateTime.parse( "2020-03-04T13:23:10" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:23:10" ) );
 
         LocalDateTime deserialized = valueSerialization.deserialize( LocalDateTime.class, serialized );
-        assertThat( deserialized, equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test
     public void givenLocalDateValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new LocalDate( "2020-03-04" ) );
+        LocalDate refTime = LocalDate.parse( "2020-03-04" );
+        String serialized = valueSerialization.serialize( refTime );
         assertThat( serialized, equalTo( "2020-03-04" ) );
 
         LocalDate deserialized = valueSerialization.deserialize( LocalDate.class, serialized );
-        assertThat( deserialized, equalTo( new LocalDate( "2020-03-04" ) ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
index 933503c..af483ad 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
@@ -19,13 +19,13 @@ package org.qi4j.test.value;
 
 import java.io.ByteArrayOutputStream;
 import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -164,10 +164,10 @@ public abstract class AbstractValueCompositeSerializationTest
         proto.string().set( "Foo\"Bar\"\nTest\t" );
         proto.string2().set( "/Foo/bar" );
         proto.number().set( 42L );
-        proto.date().set( new Date() );
-        proto.dateTime().set( new DateTime() );
-        proto.localDate().set( new LocalDate() );
-        proto.localDateTime().set( new LocalDateTime() );
+        proto.date().set( OffsetDateTime.now() );
+        proto.dateTime().set( ZonedDateTime.now());
+        proto.localDate().set( LocalDate.now() );
+        proto.localDateTime().set( LocalDateTime.now() );
         proto.entityReference().set( EntityReference.parseEntityReference( "12345" ) );
         proto.stringIntMap().get().put( "foo", 42 );
 
@@ -239,9 +239,9 @@ public abstract class AbstractValueCompositeSerializationTest
         @UseDefaults
         Property<Long> number();
 
-        Property<Date> date();
+        Property<OffsetDateTime> date();
 
-        Property<DateTime> dateTime();
+        Property<ZonedDateTime> dateTime();
 
         Property<LocalDate> localDate();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
index 0848a54..da4399f 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
@@ -21,6 +21,7 @@ package org.qi4j.entitystore.gae;
 import com.google.appengine.api.datastore.Entity;
 import com.google.appengine.api.datastore.Key;
 import com.google.appengine.api.datastore.Text;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -60,7 +61,8 @@ public class GaeEntityState
                            ValueSerialization valueSerialization,
                            Key key,
                            EntityDescriptor descriptor,
-                           Module module )
+                           Module module
+    )
     {
         System.out.println( "GaeEntityState( " + unitOfWork + ", " + key + ", " + descriptor + " )" );
         this.module = module;
@@ -84,7 +86,8 @@ public class GaeEntityState
     public GaeEntityState( GaeEntityStoreUnitOfWork unitOfWork,
                            ValueSerialization valueSerialization,
                            Entity entity,
-                           Module module )
+                           Module module
+    )
     {
         System.out.println( "GaeEntityState( " + unitOfWork + ", " + entity + " )" );
         if( entity == null )
@@ -143,9 +146,9 @@ public class GaeEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
-        Long lastModified = (Long) entity.getProperty( "$lastModified" );
+        Instant lastModified = Instant.ofEpochMilli( (Long) entity.getProperty( "$lastModified" ) );
         System.out.println( "lastModified()  -->  " + lastModified );
         return lastModified;
     }
@@ -438,7 +441,6 @@ public class GaeEntityState
         {
             return toList( assocs.keySet() ).iterator();
         }
-
     }
 
     private void markUpdated()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
index e4b591d..fbc8848 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
@@ -17,6 +17,7 @@
 package org.qi4j.entitystore.gae;
 
 import com.google.appengine.api.datastore.*;
+import java.time.Instant;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.entity.IdentityGenerator;
 import org.qi4j.api.injection.scope.Service;
@@ -61,7 +62,7 @@ public class GaeEntityStoreMixin
    }
 
     @Override
-   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
    {
        return new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization, generateId(), module, currentTime );
    }
@@ -76,7 +77,7 @@ public class GaeEntityStoreMixin
          {
             final GaeEntityStoreUnitOfWork euow = new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization,
                                                                                 generateId(), module,
-                                                                                System.currentTimeMillis() );
+                                                                                Instant.now() );
             Query query = new Query();
             PreparedQuery q = datastoreService.prepare(query);
             final QueryResultIterable<Entity> iterable = q.asQueryResultIterable();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
index e32786d..fad9462 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
@@ -19,6 +19,7 @@
 package org.qi4j.entitystore.gae;
 
 import com.google.appengine.api.datastore.*;
+import java.time.Instant;
 import java.util.LinkedList;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -38,14 +39,14 @@ public class GaeEntityStoreUnitOfWork
     private final ValueSerialization valueSerialization;
     private final String identity;
     private final Module module;
-    private final long currentTime;
+    private final Instant currentTime;
     private final LinkedList<GaeEntityState> states;
 
     public GaeEntityStoreUnitOfWork( DatastoreService datastore,
                                      ValueSerialization valueSerialization,
                                      String identity,
                                      Module module,
-                                     long currentTime )
+                                     Instant currentTime )
     {
         this.datastore = datastore;
         this.valueSerialization = valueSerialization;
@@ -62,7 +63,7 @@ public class GaeEntityStoreUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
index 340f52f..15cccbe 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
@@ -1,5 +1,6 @@
 package org.qi4j.entitystore.neo4j;
 
+import java.time.Instant;
 import org.neo4j.graphdb.Direction;
 import org.neo4j.graphdb.DynamicRelationshipType;
 import org.neo4j.graphdb.Node;
@@ -32,7 +33,8 @@ public class NeoEntityState
     private EntityStatus status;
 
     NeoEntityState( ValueSerialization valueSerialization, NeoEntityStoreUnitOfWork work, Node node,
-                    EntityStatus status )
+                    EntityStatus status
+    )
     {
         this.valueSerialization = valueSerialization;
         this.uow = work;
@@ -47,7 +49,7 @@ public class NeoEntityState
             status = EntityStatus.UPDATED;
             Long version = (Long) underlyingNode.getProperty( VERSION );
             underlyingNode.setProperty( VERSION, version + 1 );
-            underlyingNode.setProperty( MODIFIED, uow.currentTime() );
+            underlyingNode.setProperty( MODIFIED, uow.currentTime().toEpochMilli() );
         }
     }
 
@@ -80,7 +82,7 @@ public class NeoEntityState
         underlyingNode.createRelationshipTo( node, namedAssociation );
         return new NeoNamedAssociationState( uow, this, node );
     }
-    
+
     @Override
     public ManyAssociationState manyAssociationValueOf( QualifiedName stateName )
     {
@@ -140,7 +142,8 @@ public class NeoEntityState
     {
         try
         {
-            PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
+            PropertyDescriptor persistentProperty = entityDescriptor().state()
+                .findPropertyModelByQualifiedName( stateName );
             Object prop = underlyingNode.getProperty( "prop::" + stateName.toString(), null );
             if( prop == null )
             {
@@ -168,7 +171,8 @@ public class NeoEntityState
         {
             if( prop != null )
             {
-                PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
+                PropertyDescriptor persistentProperty = entityDescriptor().state()
+                    .findPropertyModelByQualifiedName( stateName );
                 if( ValueType.isPrimitiveValueType( persistentProperty.valueType() ) )
                 {
                     underlyingNode.setProperty( "prop::" + stateName.toString(), prop );
@@ -263,10 +267,9 @@ public class NeoEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
-        long modified = (Long) underlyingNode.getProperty( MODIFIED );
-        return modified;
+        return Instant.ofEpochMilli( (Long) underlyingNode.getProperty( MODIFIED ) );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
index dd04f3a..412985e 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
@@ -1,6 +1,7 @@
 package org.qi4j.entitystore.neo4j;
 
 import java.io.File;
+import java.time.Instant;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.neo4j.graphdb.Direction;
@@ -74,7 +75,7 @@ public class NeoEntityStoreMixin
    }
 
     @Override
-   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
    {
       return new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, currentTime);
    }
@@ -92,7 +93,7 @@ public class NeoEntityStoreMixin
                @Override
                public <ReceiverThrowableType extends Throwable> void sendTo(Receiver<? super EntityState, ReceiverThrowableType> receiver) throws ReceiverThrowableType, EntityStoreException
                {
-                  NeoEntityStoreUnitOfWork uow = new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, System.currentTimeMillis());
+                  NeoEntityStoreUnitOfWork uow = new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, Instant.now());
 
                   try
                   {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
index b372355..ad89d14 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
@@ -1,5 +1,6 @@
 package org.qi4j.entitystore.neo4j;
 
+import java.time.Instant;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import org.neo4j.graphdb.Node;
@@ -25,7 +26,7 @@ public class NeoEntityStoreUnitOfWork
     private final EmbeddedGraphDatabase neo;
     private final IndexService indexService;
     private final ValueSerialization valueSerialization;
-    private long currentTime;
+    private Instant currentTime;
     private final TransactionManager tm;
 
     private final Transaction transaction;
@@ -34,7 +35,7 @@ public class NeoEntityStoreUnitOfWork
 
     NeoEntityStoreUnitOfWork( EmbeddedGraphDatabase neo, IndexService indexService, ValueSerialization valueSerialization,
                               String identity, Module module,
-                              long currentTime )
+                              Instant currentTime )
     {
         this.neo = neo;
         this.indexService = indexService;
@@ -54,7 +55,7 @@ public class NeoEntityStoreUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }
@@ -104,7 +105,7 @@ public class NeoEntityStoreUnitOfWork
         }
         node = neo.createNode();
         node.setProperty( NeoEntityState.VERSION, 0l );
-        node.setProperty( NeoEntityState.MODIFIED, currentTime );
+        node.setProperty( NeoEntityState.MODIFIED, currentTime.toEpochMilli() );
         node.createRelationshipTo( typeNode, RelTypes.IS_OF_TYPE );
         node.setProperty( NeoEntityState.ENTITY_ID, anIdentity.identity() );
         indexService.index( node, ENTITY_STATE_ID, anIdentity.identity() );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java b/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
index f7841e3..a14a8a7 100644
--- a/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
+++ b/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
@@ -30,8 +30,4 @@ public class SimpleNeoStoreTest
         new OrgJsonValueSerializationAssembler().assemble( module );
     }
 
-    @Override
-    public void givenConcurrentUnitOfWorksWhenUoWCompletesThenCheckConcurrentModification()
-    {
-    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
index ed48871..afc0a66 100644
--- a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
+++ b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
@@ -19,6 +19,7 @@
  */
 package org.qi4j.entitystore.prefs;
 
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -167,7 +168,7 @@ public class PreferencesEntityStoreMixin
     }
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecase, currentTime );
     }
@@ -194,7 +195,7 @@ public class PreferencesEntityStoreMixin
                             newUnitOfWorkId(),
                             module,
                             visitUsecase,
-                            System.currentTimeMillis() );
+                            Instant.now() );
                         try
                         {
                             String[] identities = root.childrenNames();
@@ -434,7 +435,7 @@ public class PreferencesEntityStoreMixin
 
             return new DefaultEntityState( desuw,
                                            entityPrefs.get( "version", "" ),
-                                           entityPrefs.getLong( "modified", unitOfWork.currentTime() ),
+                                           Instant.ofEpochMilli( entityPrefs.getLong( "modified", unitOfWork.currentTime().toEpochMilli() ) ),
                                            identity,
                                            status,
                                            entityDescriptor,
@@ -499,7 +500,7 @@ public class PreferencesEntityStoreMixin
     protected void writeEntityState( DefaultEntityState state,
                                      Preferences entityPrefs,
                                      String identity,
-                                     long lastModified
+                                     Instant lastModified
     )
         throws EntityStoreException
     {
@@ -508,7 +509,7 @@ public class PreferencesEntityStoreMixin
             // Store into Preferences API
             entityPrefs.put( "type", first( state.entityDescriptor().types() ).getName() );
             entityPrefs.put( "version", identity );
-            entityPrefs.putLong( "modified", lastModified );
+            entityPrefs.putLong( "modified", lastModified.toEpochMilli() );
 
             // Properties
             Preferences propsPrefs = entityPrefs.node( "properties" );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
index 8ba2aac..36ffb3d 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
@@ -23,6 +23,7 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -248,7 +249,7 @@ public class SQLEntityStoreMixin
     }
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSPI, newUnitOfWorkId(), module, usecase, currentTime );
     }
@@ -300,7 +301,7 @@ public class SQLEntityStoreMixin
         Usecase usecase = builder.withMetaInfo( CacheOptions.NEVER ).newUsecase();
         final DefaultEntityStoreUnitOfWork uow = new DefaultEntityStoreUnitOfWork( entityStoreSPI,
                                                                                    newUnitOfWorkId(), module, usecase,
-                                                                                   System.currentTimeMillis() );
+                                                                                   Instant.now() );
         try
         {
             connection = database.getConnection();
@@ -348,7 +349,7 @@ public class SQLEntityStoreMixin
             EntityStatus status = EntityStatus.LOADED;
 
             String version = jsonObject.getString( JSONKeys.VERSION );
-            long modified = jsonObject.getLong( JSONKeys.MODIFIED );
+            Instant modified = Instant.ofEpochMilli( jsonObject.getLong( JSONKeys.MODIFIED ) );
             String identity = jsonObject.getString( JSONKeys.IDENTITY );
 
             // Check if version is correct
@@ -549,7 +550,7 @@ public class SQLEntityStoreMixin
                 key( JSONKeys.APPLICATION_VERSION ).value( application.version() ).
                 key( JSONKeys.TYPE ).value( first( state.entityDescriptor().types() ).getName() ).
                 key( JSONKeys.VERSION ).value( version ).
-                key( JSONKeys.MODIFIED ).value( state.lastModified() ).
+                key( JSONKeys.MODIFIED ).value( state.lastModified().toEpochMilli() ).
                 key( JSONKeys.PROPERTIES ).object();
 
             for( PropertyDescriptor persistentProperty : state.entityDescriptor().state().properties() )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
index cdbbe0f..eb641eb 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
@@ -19,6 +19,7 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.time.Instant;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.service.ServiceComposite;
 
@@ -103,10 +104,10 @@ public interface DatabaseSQLService
     void populateGetAllEntitiesStatement( PreparedStatement ps )
         throws SQLException;
 
-    void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Long lastModified )
+    void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Instant lastModified )
         throws SQLException;
 
-    void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Long lastModified )
+    void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Instant lastModified )
         throws SQLException;
 
     void populateRemoveEntityStatement( PreparedStatement ps, Long entityPK, EntityReference ref )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
index 532b788..c235684 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
@@ -17,6 +17,7 @@ package org.qi4j.entitystore.sql.internal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.time.Instant;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.This;
 
@@ -83,12 +84,12 @@ public abstract class DatabaseSQLServiceStatementsMixin
     }
 
     @Override
-    public void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Long lastModified )
+    public void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Instant lastModified )
             throws SQLException
     {
         ps.setString( 1, ref.identity() );
         ps.setString( 2, entity );
-        ps.setLong( 3, lastModified );
+        ps.setLong( 3, lastModified.toEpochMilli() );
     }
 
     @Override
@@ -99,12 +100,12 @@ public abstract class DatabaseSQLServiceStatementsMixin
     }
 
     @Override
-    public void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Long lastModified )
+    public void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Instant lastModified )
             throws SQLException
     {
         ps.setLong( 1, entityOptimisticLock + 1 );
         ps.setString( 2, entity );
-        ps.setLong( 3, lastModified );
+        ps.setLong( 3, lastModified.toEpochMilli() );
         ps.setLong( 4, entityPK );
         ps.setLong( 5, entityOptimisticLock );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
index 1286049..aced663 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
@@ -14,6 +14,7 @@
  */
 package org.qi4j.entitystore.sql.internal;
 
+import java.time.Instant;
 import org.qi4j.api.common.QualifiedName;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -124,7 +125,7 @@ public interface SQLEntityState
         }
 
         @Override
-        public long lastModified()
+        public Instant lastModified()
         {
             return state.lastModified();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
index 58172d5..ed27403 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.index.elasticsearch;
 
+import java.time.Instant;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -98,7 +99,7 @@ public interface ElasticSearchIndexer
             EntityStoreUnitOfWork uow = entityStore.newUnitOfWork(
                 UsecaseBuilder.newUsecase( "Load associations for indexing" ),
                 module,
-                System.currentTimeMillis()
+                Instant.now()
             );
 
             // Bulk index request builder

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
index 93515e7..a1ec557 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
@@ -19,7 +19,6 @@ package org.qi4j.index.rdf.query;
 
 import org.openrdf.query.QueryLanguage;
 import org.qi4j.api.injection.scope.Service;
-import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.service.qualifier.Tagged;
@@ -27,7 +26,6 @@ import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.api.value.ValueSerializer;
 import org.qi4j.index.rdf.UnsupportedLanguageException;
 import org.qi4j.index.rdf.query.internal.RdfQueryParserImpl;
-import org.qi4j.spi.Qi4jSPI;
 
 @Mixins( RdfQueryParserFactory.RdfQueryParserFactoryMixin.class )
 public interface RdfQueryParserFactory
@@ -38,8 +36,6 @@ public interface RdfQueryParserFactory
     abstract class RdfQueryParserFactoryMixin
         implements RdfQueryParserFactory
     {
-        @Structure
-        private Qi4jSPI spi;
         @Service
         @Tagged( ValueSerialization.Formats.JSON )
         private ValueSerializer valueSerializer;
@@ -49,7 +45,7 @@ public interface RdfQueryParserFactory
         {
             if( language.equals( QueryLanguage.SPARQL ) )
             {
-                return new RdfQueryParserImpl( spi, valueSerializer );
+                return new RdfQueryParserImpl( valueSerializer );
             }
             throw new UnsupportedLanguageException( language );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
index 30958b1..676e5e5 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
@@ -17,16 +17,12 @@
  */
 package org.qi4j.index.rdf.query.internal;
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.TimeZone;
 import java.util.function.Predicate;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.qi4j.api.composite.Composite;
@@ -68,23 +64,11 @@ import static java.lang.String.format;
 public class RdfQueryParserImpl
     implements RdfQueryParser
 {
-    private static final ThreadLocal<DateFormat> ISO8601_UTC = new ThreadLocal<DateFormat>()
-    {
-        @Override
-        protected DateFormat initialValue()
-        {
-            SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
-            dateFormat.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
-            return dateFormat;
-        }
-    };
-
     private static final Map<Class<? extends ComparisonSpecification>, String> OPERATORS;
     private static final Set<Character> RESERVED_CHARS;
 
     private final Namespaces namespaces = new Namespaces();
     private final Triples triples = new Triples( namespaces );
-    private final Qi4jSPI spi;
     private final ValueSerializer valueSerializer;
     private Map<String, Object> variables;
 
@@ -103,9 +87,8 @@ public class RdfQueryParserImpl
         ) );
     }
 
-    public RdfQueryParserImpl( Qi4jSPI spi, ValueSerializer valueSerializer )
+    public RdfQueryParserImpl( ValueSerializer valueSerializer )
     {
-        this.spi = spi;
         this.valueSerializer = valueSerializer;
     }
 
@@ -331,7 +314,7 @@ public class RdfQueryParserImpl
     {
         for( Integer x = 0; x < strings.length; ++x )
         {
-            builder.append( strings[ x] );
+            builder.append( strings[ x ] );
             if( x + 1 < strings.length )
             {
                 builder.append( delimiter );
@@ -357,7 +340,7 @@ public class RdfQueryParserImpl
         char[] chars = jsonStr.toCharArray();
         for( int i = 0; i < chars.length; i++ )
         {
-            char c = chars[ i];
+            char c = chars[ i ];
 
             /*
              if ( reservedJsonChars.contains( c ))
@@ -404,7 +387,7 @@ public class RdfQueryParserImpl
                 }
                 jsonStr = escapeJSONString( serialized );
             }
-            strings[ x] = this.createRegexStringForContaining( valueVariable, jsonStr );
+            strings[ x ] = this.createRegexStringForContaining( valueVariable, jsonStr );
             x++;
         }
 
@@ -554,11 +537,7 @@ public class RdfQueryParserImpl
             return null;
         }
 
-        if( value instanceof Date )
-        {
-            return ISO8601_UTC.get().format( (Date) value );
-        }
-        else if( value instanceof EntityComposite )
+        if( value instanceof EntityComposite )
         {
             return "urn:qi4j:entity:" + value.toString();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
index e038a4e..1abfa04 100644
--- a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
+++ b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
@@ -148,7 +148,7 @@ public abstract class SolrEntityIndexerMixin
         SolrInputDocument input = new SolrInputDocument();
         input.addField( "id", entityState.identity().identity() );
         input.addField( "type", first(entityState.entityDescriptor().types()).getName() );
-        input.addField( "lastModified", new Date( entityState.lastModified() ) );
+        input.addField( "lastModified", new Date( entityState.lastModified().toEpochMilli() ) );
 
         for( Statement statement : graph )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
index 265b52f..273dd0d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
@@ -19,9 +19,14 @@ package org.qi4j.index.sql.support.common;
 
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.common.QualifiedName;
@@ -107,7 +112,12 @@ public final class QNameInfo
                 Number.class.isAssignableFrom( finalClass )//
                 || Boolean.class.isAssignableFrom( finalClass ) //
                 || Character.class.isAssignableFrom( finalClass ) //
-                || Date.class.isAssignableFrom( finalClass ) //
+                || LocalDate.class.isAssignableFrom( finalClass ) //
+                || LocalTime.class.isAssignableFrom( finalClass ) //
+                || LocalDateTime.class.isAssignableFrom( finalClass ) //
+                || OffsetTime.class.isAssignableFrom( finalClass ) //
+                || OffsetDateTime.class.isAssignableFrom( finalClass ) //
+                || ZonedDateTime.class.isAssignableFrom( finalClass ) //
                 || Enum.class.isAssignableFrom( finalClass ) //
                 || String.class.isAssignableFrom( finalClass )//
                 ;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
index e85bba2..df8f925 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
@@ -22,7 +22,12 @@ import java.lang.reflect.Type;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Timestamp;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -41,10 +46,11 @@ public interface PostgreSQLTypeHelper
     /**
      * Adds the specified object at specified index in specified prepared statement.
      *
-     * @param ps The prepared statement.
-     * @param index The index for the object to be inserted in prepared statemtent ({@code > 0}).
-     * @param primitive The object to insert.
+     * @param ps            The prepared statement.
+     * @param index         The index for the object to be inserted in prepared statemtent ({@code > 0}).
+     * @param primitive     The object to insert.
      * @param primitiveType The type of object.
+     *
      * @throws SQLException If something underlying throws it.
      */
     void addPrimitiveToPS( PreparedStatement ps, Integer index, @Optional Object primitive, Type primitiveType )
@@ -66,13 +72,33 @@ public interface PostgreSQLTypeHelper
                 if( primitive instanceof Character )
                 {
                     primitive = Character.codePointAt( new char[]
-                    {
-                        (Character) primitive
-                    }, 0 );
+                                                           {
+                                                               (Character) primitive
+                                                           }, 0 );
+                }
+                else if( primitive instanceof OffsetDateTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof OffsetTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof LocalDateTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof LocalTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
                 }
-                else if( primitive instanceof Date )
+                else if( primitive instanceof LocalDate )
                 {
-                    primitive = new Timestamp( ( (Date) primitive ).getTime() );
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof ZonedDateTime )
+                {
+                    primitive = new Timestamp( ( (ZonedDateTime) primitive ).toInstant().toEpochMilli() );
                 }
                 else if( primitive instanceof Byte )
                 {
@@ -125,5 +151,4 @@ public interface PostgreSQLTypeHelper
             return sqlType;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
index aab952d..ac0b021 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
@@ -358,7 +358,7 @@ public abstract class AbstractSQLIndexing
         throws SQLException
     {
         ps.setString( startingIndex, state.identity().identity() );
-        ps.setTimestamp( startingIndex + 1, new Timestamp( state.lastModified() ) );
+        ps.setTimestamp( startingIndex + 1, new Timestamp( state.lastModified().toEpochMilli() ) );
         ps.setString( startingIndex + 2, state.version() );
         ps.setString( startingIndex + 3, this._app.version() );
     }
@@ -1004,7 +1004,7 @@ public abstract class AbstractSQLIndexing
 
         // Update state
         ps.setString( 1, state.identity().identity() );
-        ps.setTimestamp( 2, new Timestamp( state.lastModified() ) );
+        ps.setTimestamp( 2, new Timestamp( state.lastModified().toEpochMilli() ) );
         ps.setString( 3, state.version() );
         ps.setString( 4, this._app.version() );
         ps.setLong( 5, entityPK );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
index 8a62b59..5a4274d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
@@ -30,7 +30,6 @@ import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -292,12 +291,19 @@ public abstract class AbstractSQLStartup
         this._primitiveTypes.put( Long.class, dt.bigInt() );
         this._primitiveTypes.put( Float.class, dt.real() );
         this._primitiveTypes.put( Double.class, dt.doublePrecision() );
-        this._primitiveTypes.put( Date.class, dt.timeStamp( true ) );
         this._primitiveTypes.put( Character.class, dt.integer() );
         this._primitiveTypes.put( String.class, dt.sqlVarChar( 5000 ) );
         this._primitiveTypes.put( BigInteger.class, dt.decimal() );
         this._primitiveTypes.put( BigDecimal.class, dt.decimal() );
 
+        // TODO - ???
+//        this._primitiveTypes.put( LocalDate.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( LocalDateTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( LocalTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( OffsetTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( OffsetDateTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( ZonedDateTime.class, dt.timeStamp( true ) );
+
         Map<Class<?>, Integer> jdbcTypes = new HashMap<>();
         jdbcTypes.put( Boolean.class, Types.BOOLEAN );
         jdbcTypes.put( Byte.class, Types.SMALLINT );
@@ -306,13 +312,20 @@ public abstract class AbstractSQLStartup
         jdbcTypes.put( Long.class, Types.BIGINT );
         jdbcTypes.put( Float.class, Types.REAL );
         jdbcTypes.put( Double.class, Types.DOUBLE );
-        jdbcTypes.put( Date.class, Types.TIMESTAMP );
         jdbcTypes.put( Character.class, Types.INTEGER );
         jdbcTypes.put( String.class, Types.VARCHAR );
         jdbcTypes.put( BigInteger.class, Types.NUMERIC );
         jdbcTypes.put( BigDecimal.class, Types.NUMERIC );
         this._state.javaTypes2SQLTypes().set( jdbcTypes );
 
+        // TODO - ???
+//        jdbcTypes.put( LocalDate.class, Types.TIMESTAMP );
+//        jdbcTypes.put( LocalDateTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( LocalTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( OffsetTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( OffsetDateTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( ZonedDateTime.class, Types.TIMESTAMP );
+
         this._customizableTypes = new HashMap<>();
         this._customizableTypes.put( //
             String.class, //
@@ -361,7 +374,7 @@ public abstract class AbstractSQLStartup
     private static class ApplicationInfo
     {
 
-        private final Map<String, EntityDescriptor> entityDescriptors = new HashMap<>();
+        private final Map<String, EntityDescriptor> entityDescriptors = new HashMap<String, EntityDescriptor>();
 
         private final Set<CompositeDescriptorInfo> usedValueComposites = new HashSet<>();
 
@@ -554,8 +567,19 @@ public abstract class AbstractSQLStartup
                                 .get( ENTITY_PK_TYPE ), false, AutoGenerationPolicy.BY_DEFAULT ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_IDENTITY_COLUMN_NAME, this._primitiveTypes
                                 .get( String.class ), false ) )
-                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
-                                .get( Date.class ), false ) )
+// TODO -??
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalDate.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalDateTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( OffsetTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( OffsetDateTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( ZonedDateTime.class ), false ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_VERSION_COLUMN_NAME, this._primitiveTypes
                                 .get( String.class ), false ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_APPLICATION_VERSION_COLUMN_NAME, this._primitiveTypes

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index 82fe6de..8f65d8d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.index.sql.support.skeletons;
 
+import java.time.Instant;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import org.qi4j.api.association.AssociationDescriptor;
@@ -112,7 +113,7 @@ import org.slf4j.LoggerFactory;
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
         return wrappedEntityState.lastModified();
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index 97e87a0..6ea0d1b 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -30,7 +30,6 @@ def jedisVersion = '2.5.1'
 def jettyVersion = '9.2.1.v20140609'
 def jgoodiesLooksVersion = '2.5.3'
 def jodaMoneyVersion = '0.9.1'
-def jodaTimeVersion = '2.3'
 def jrubyVersion = '1.7.8' // 1.7.12 - Fails to run!
 def jtaVersion = '1.1'
 def leveldbVersion = '0.7'
@@ -202,7 +201,6 @@ rootProject.ext {
           // Library & Extension dependencies
           jackson_mapper: "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
           jodamoney: "org.joda:joda-money:$jodaMoneyVersion",
-          jodatime: "joda-time:joda-time:$jodaTimeVersion",
           ehcache: "net.sf.ehcache:ehcache:$ehcacheVersion",
           elasticsearch: "org.elasticsearch:elasticsearch:$elasticsearchVersion",
           h2: "com.h2database:h2:$h2Version",

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
index 7d6ea26..07d12e6 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.Locale;
 import java.util.ResourceBundle;
 import org.qi4j.api.injection.scope.Service;
@@ -62,7 +62,7 @@ public interface AlarmEvent
      *
      * @return the timestamp when this event occurred.
      */
-    Property<Date> eventTime();
+    Property<ZonedDateTime> eventTime();
 
     /**
      * Returns the Name of the event.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
index d2c7df1..00e3f2d 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.Locale;
 import java.util.ResourceBundle;
 import org.qi4j.api.common.Optional;
@@ -60,7 +60,7 @@ public interface AlarmStatus extends ValueComposite
          * @return the timestamp of when the state was created.
          */
         @Optional
-        Property<Date> creationDate();
+        Property<ZonedDateTime> creationDate();
 
         /**
          * Returns the Name of the AlarmStatus.
@@ -101,7 +101,7 @@ public interface AlarmStatus extends ValueComposite
         {
             if( state.creationDate().get() == null )
             {
-                state.creationDate().set( new Date() );
+                state.creationDate().set( ZonedDateTime.now() );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
index c3e3702..d7ec0b2 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
@@ -18,8 +18,8 @@
 
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -224,7 +224,7 @@ public interface AlarmSystem
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
             statePrototype.name().set( status );
-            statePrototype.creationDate().set( new Date() );
+            statePrototype.creationDate().set( ZonedDateTime.now() );
             return builder.newInstance();
         }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
index dbb764e..5544fae 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -406,7 +406,7 @@ public interface ExtendedAlarmModelService
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State prototype = builder.prototypeFor(AlarmStatus.State.class);
             prototype.name().set( status );
-            prototype.creationDate().set( new Date() );
+            prototype.creationDate().set( ZonedDateTime.now() );
             return builder.newInstance();
         }
 
@@ -419,7 +419,7 @@ public interface ExtendedAlarmModelService
             ValueBuilder<AlarmEvent> builder = vbf.newValueBuilder( AlarmEvent.class );
             AlarmEvent prototype = builder.prototype();
             prototype.alarmIdentity().set( alarmId.identity().get() );
-            prototype.eventTime().set( new Date() );
+            prototype.eventTime().set( ZonedDateTime.now() );
             prototype.newStatus().set( newStatus );
             prototype.oldStatus().set( oldStatus );
             prototype.systemName().set( eventSystemName );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
index 378709e..1eb07b6 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -229,7 +229,7 @@ public interface SimpleAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State prototype = builder.prototypeFor(AlarmStatus.State.class);
             prototype.name().set( status );
-            prototype.creationDate().set( new Date() );
+            prototype.creationDate().set( ZonedDateTime.now());
             return builder.newInstance();
         }
 
@@ -241,7 +241,7 @@ public interface SimpleAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmEvent> builder = vbf.newValueBuilder( AlarmEvent.class );
             AlarmEvent prototype = builder.prototype();
             prototype.alarmIdentity().set( alarmId.identity().get() );
-            prototype.eventTime().set( new Date() );
+            prototype.eventTime().set( ZonedDateTime.now() );
             prototype.newStatus().set( newStatus );
             prototype.oldStatus().set( oldStatus );
             prototype.systemName().set( eventSystemName );


Mime
View raw message