polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [01/28] zest-java git commit: ZEST-180, ZEST-186, ZEST-187, ZEST-188 Big Identity refactoring UnitOfWorkFactory is auto added to all modules that doesn't declare one IdentityGenerator is auto-added to all modules that deosn't declare one. Removed DCI/DDD
Date Sun, 23 Oct 2016 14:23:42 GMT
Repository: zest-java
Updated Branches:
  refs/heads/develop e030bd8a5 -> 103c59cbe


http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tests/performance/src/perf/java/org/apache/zest/test/performance/indexing/rdf/QueryPerformanceTest.java
----------------------------------------------------------------------
diff --git a/tests/performance/src/perf/java/org/apache/zest/test/performance/indexing/rdf/QueryPerformanceTest.java
b/tests/performance/src/perf/java/org/apache/zest/test/performance/indexing/rdf/QueryPerformanceTest.java
index 2ac5add..54558ce 100644
--- a/tests/performance/src/perf/java/org/apache/zest/test/performance/indexing/rdf/QueryPerformanceTest.java
+++ b/tests/performance/src/perf/java/org/apache/zest/test/performance/indexing/rdf/QueryPerformanceTest.java
@@ -72,59 +72,59 @@ public class QueryPerformanceTest
     private Application application;
     private Module module;
     private UnitOfWorkFactory uowf;
-    private static final String QUERY1 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.entity.Identity#>
\n"
+    private static final String QUERY1 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.identity.HasIdentity#>
\n"
                                          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n"
                                          + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n"
                                          + "PREFIX ns1: <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead#>
\n"
-                                         + "SELECT ?entityType ?identity\n"
+                                         + "SELECT ?entityType ?reference\n"
                                          + "WHERE {\n"
                                          + "?entityType rdfs:subClassOf <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead>.
\n"
                                          + "?entity rdf:type ?entityType. \n"
-                                         + "?entity ns0:identity ?identity. \n"
+                                         + "?entity ns0:reference ?reference. \n"
                                          + "?entity ns1:name \"Lead64532\". \n"
                                          + "}";
-    private static final String QUERY2 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.entity.Identity#>
\n"
+    private static final String QUERY2 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.identity.HasIdentity#>
\n"
                                          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n"
                                          + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n"
                                          + "PREFIX ns1: <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead#>
\n"
-                                         + "SELECT ?entityType ?identity\n"
+                                         + "SELECT ?entityType ?reference\n"
                                          + "WHERE {\n"
                                          + "?entityType rdfs:subClassOf <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead>.
\n"
                                          + "?entity rdf:type ?entityType. \n"
-                                         + "?entity ns0:identity ?identity. \n"
+                                         + "?entity ns0:reference ?reference. \n"
                                          + "?entity ns1:name \"Lead98276\". \n"
                                          + "}";
-    private static final String QUERY3 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.entity.Identity#>
\n"
+    private static final String QUERY3 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.identity.HasIdentity#>
\n"
                                          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n"
                                          + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n"
                                          + "PREFIX ns1: <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead#>
\n"
-                                         + "SELECT ?entityType ?identity\n"
+                                         + "SELECT ?entityType ?reference\n"
                                          + "WHERE {\n"
                                          + "?entityType rdfs:subClassOf <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead>.
\n"
                                          + "?entity rdf:type ?entityType. \n"
-                                         + "?entity ns0:identity ?identity. \n"
+                                         + "?entity ns0:reference ?reference. \n"
                                          + "?entity ns1:name \"Lead2\". \n"
                                          + "}";
-    private static final String QUERY4 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.entity.Identity#>
\n"
+    private static final String QUERY4 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.identity.HasIdentity#>
\n"
                                          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n"
                                          + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n"
                                          + "PREFIX ns1: <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead#>
\n"
-                                         + "SELECT ?entityType ?identity\n"
+                                         + "SELECT ?entityType ?reference\n"
                                          + "WHERE {\n"
                                          + "?entityType rdfs:subClassOf <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead>.
\n"
                                          + "?entity rdf:type ?entityType. \n"
-                                         + "?entity ns0:identity ?identity. \n"
+                                         + "?entity ns0:reference ?reference. \n"
                                          + "?entity ns1:name \"Lead14332\". \n"
                                          + "}";
-    private static final String QUERY5 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.entity.Identity#>
\n"
+    private static final String QUERY5 = "PREFIX ns0: <urn:zest:type:org.apache.zest.api.identity.HasIdentity#>
\n"
                                          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
\n"
                                          + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
\n"
                                          + "PREFIX ns1: <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead#>
\n"
-                                         + "SELECT ?entityType ?identity\n"
+                                         + "SELECT ?entityType ?reference\n"
                                          + "WHERE {\n"
                                          + "?entityType rdfs:subClassOf <urn:zest:type:org.apache.zest.test.performance.indexing.rdf.QueryPerformanceTest-Lead>.
\n"
                                          + "?entity rdf:type ?entityType. \n"
-                                         + "?entity ns0:identity ?identity. \n"
+                                         + "?entity ns0:reference ?reference. \n"
                                          + "?entity ns1:name \"Lead632\". \n"
                                          + "}";
     private File indexingDataDir;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/main/java/org/apache/zest/envisage/print/PDFWriter.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/main/java/org/apache/zest/envisage/print/PDFWriter.java b/tools/envisage/src/main/java/org/apache/zest/envisage/print/PDFWriter.java
index 5ad5a68..2926473 100644
--- a/tools/envisage/src/main/java/org/apache/zest/envisage/print/PDFWriter.java
+++ b/tools/envisage/src/main/java/org/apache/zest/envisage/print/PDFWriter.java
@@ -308,7 +308,7 @@ public class PDFWriter
         if( objectDesciptor instanceof ServiceDetailDescriptor )
         {
             ServiceDescriptor descriptor = ( (ServiceDetailDescriptor) objectDesciptor ).descriptor();
-            writeString( "- identity: " + descriptor.identity() );
+            writeString( "- reference: " + descriptor.identity() );
             writeString( "- class: " + descriptor.toString() );
             writeString( "- visibility: " + descriptor.visibility().toString() );
             writeString( "- startup: " + ( (ServiceDetailDescriptor) objectDesciptor ).descriptor()

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java
b/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java
index 3a2e50e..31b871d 100644
--- a/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java
+++ b/tools/envisage/src/test/java/org/apache/zest/envisage/sample/EnvisageSample.java
@@ -20,6 +20,7 @@
 
 package org.apache.zest.envisage.sample;
 
+import org.apache.zest.api.identity.Identity;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.apache.zest.api.entity.EntityBuilder;
@@ -102,7 +103,7 @@ public class EnvisageSample
         }
     }
 
-    private String createCar( String manufacturer, String model, int year )
+    private Identity createCar(String manufacturer, String model, int year )
     {
         UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork();
         EntityBuilder<Car> builder = uow.newEntityBuilder( Car.class );
@@ -114,7 +115,7 @@ public class EnvisageSample
         return entity.identity().get();
     }
 
-    private String createAnimal( String name, String sound )
+    private Identity createAnimal( String name, String sound )
     {
         UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork();
         EntityBuilder<Animal> builder = uow.newEntityBuilder( Animal.class );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
index fe9e7b3..1597bc7 100644
--- a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
+++ b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
@@ -23,6 +23,7 @@ package org.apache.zest.envisage.school.domain.person.initialdata;
 import org.apache.zest.api.activation.ActivatorAdapter;
 import org.apache.zest.api.activation.Activators;
 import org.apache.zest.api.entity.EntityBuilder;
+import org.apache.zest.api.identity.StringIdentity;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.mixin.Mixins;
 import org.apache.zest.api.service.ServiceComposite;
@@ -95,7 +96,7 @@ public interface SamplePersonInitialData
 
         private void createPerson( UnitOfWork uow, String personId, String firstName, String
lastName )
         {
-            EntityBuilder<Person> person = uow.newEntityBuilder( Person.class, personId
);
+            EntityBuilder<Person> person = uow.newEntityBuilder( Person.class, new
StringIdentity( personId ) );
 
             PersonEntity.PersonState state = person.instanceFor( PersonEntity.PersonState.class
);
             state.firstName().set( firstName );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SchoolEntity.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SchoolEntity.java
b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SchoolEntity.java
index 5f36111..f9222c7 100644
--- a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SchoolEntity.java
+++ b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SchoolEntity.java
@@ -21,7 +21,8 @@
 package org.apache.zest.envisage.school.domain.school.assembly;
 
 import org.apache.zest.api.entity.EntityComposite;
-import org.apache.zest.api.entity.Identity;
+import org.apache.zest.api.identity.HasIdentity;
+import org.apache.zest.api.identity.Identity;
 import org.apache.zest.api.injection.scope.Service;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.injection.scope.This;
@@ -56,9 +57,9 @@ public interface SchoolEntity
         private SchoolState state;
         @Service
         private MailService mailer;
-        private final String schoolId;
+        private final Identity schoolId;
 
-        public SchoolMixin( @This Identity identity )
+        public SchoolMixin( @This HasIdentity identity )
         {
             schoolId = identity.identity().get();
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/StudentEntity.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/StudentEntity.java
b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/StudentEntity.java
index 213c36f..1213b01 100644
--- a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/StudentEntity.java
+++ b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/StudentEntity.java
@@ -23,6 +23,7 @@ package org.apache.zest.envisage.school.domain.school.assembly;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.association.ManyAssociation;
 import org.apache.zest.api.entity.EntityComposite;
+import org.apache.zest.api.identity.Identity;
 import org.apache.zest.api.injection.scope.This;
 import org.apache.zest.api.mixin.Mixins;
 import org.apache.zest.api.property.Property;
@@ -59,7 +60,7 @@ public interface StudentEntity
 
         Association<School> school();
 
-        Property<String> schoolId();
+        Property<Identity> schoolId();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SubjectEntity.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SubjectEntity.java
b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SubjectEntity.java
index b070251..833fb38 100644
--- a/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SubjectEntity.java
+++ b/tools/envisage/src/test/java/org/apache/zest/envisage/school/domain/school/assembly/SubjectEntity.java
@@ -22,6 +22,7 @@ package org.apache.zest.envisage.school.domain.school.assembly;
 
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.entity.EntityComposite;
+import org.apache.zest.api.identity.Identity;
 import org.apache.zest.api.injection.scope.This;
 import org.apache.zest.api.mixin.Mixins;
 import org.apache.zest.api.property.Property;
@@ -63,7 +64,7 @@ public interface SubjectEntity
 
         Property<String> description();
 
-        Property<String> schoolId();
+        Property<Identity> schoolId();
 
         Association<School> school();
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/CrudModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/CrudModule/bootstrap.tmpl b/tools/generator-zest/app/templates/CrudModule/bootstrap.tmpl
index 4db1a06..bfb6320 100644
--- a/tools/generator-zest/app/templates/CrudModule/bootstrap.tmpl
+++ b/tools/generator-zest/app/templates/CrudModule/bootstrap.tmpl
@@ -32,7 +32,6 @@ public class CrudModule
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
         throws AssemblyException
     {
-        module.withDefaultUnitOfWorkFactory();
         new CrudServiceAssembler().assemble( module );
         return module;
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/Heroes/Hero.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/Heroes/Hero.tmpl b/tools/generator-zest/app/templates/Heroes/Hero.tmpl
index f0b3f2e..c0ef111 100644
--- a/tools/generator-zest/app/templates/Heroes/Hero.tmpl
+++ b/tools/generator-zest/app/templates/Heroes/Hero.tmpl
@@ -19,10 +19,10 @@
 -%>
 package <%= packageName %>.model.heroes;
 
-import org.apache.zest.api.entity.Identity;
+import org.apache.zest.api.identity.HasIdentity;
 import org.apache.zest.api.property.Property;
 
-public interface Hero extends Identity
+public interface Hero extends HasIdentity
 {
     Property<String> name();
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/RdfIndexingModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/RdfIndexingModule/bootstrap.tmpl b/tools/generator-zest/app/templates/RdfIndexingModule/bootstrap.tmpl
index dd37698..3ce3378 100644
--- a/tools/generator-zest/app/templates/RdfIndexingModule/bootstrap.tmpl
+++ b/tools/generator-zest/app/templates/RdfIndexingModule/bootstrap.tmpl
@@ -42,8 +42,6 @@ public class RdfIndexingModule
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
         throws AssemblyException
     {
-        module.withDefaultUnitOfWorkFactory();
-
         configModule.entities( NativeConfiguration.class ).visibleIn( Visibility.application
);
         new RdfNativeSesameStoreAssembler(Visibility.application, Visibility.module).assemble(
module );
         return module;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/RestApiModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/RestApiModule/bootstrap.tmpl b/tools/generator-zest/app/templates/RestApiModule/bootstrap.tmpl
index 643da47..7c50b9e 100644
--- a/tools/generator-zest/app/templates/RestApiModule/bootstrap.tmpl
+++ b/tools/generator-zest/app/templates/RestApiModule/bootstrap.tmpl
@@ -40,8 +40,6 @@ public class RestApiModule
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
         throws AssemblyException
     {
-        module.withDefaultUnitOfWorkFactory();
-
         module.objects( SimpleVerifier.class, SimpleEnroler.class);
 
         new RestletCrudConnectivityAssembler().assemble( module );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/SecurityModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/SecurityModule/bootstrap.tmpl b/tools/generator-zest/app/templates/SecurityModule/bootstrap.tmpl
index c0ef420..5b7da75 100644
--- a/tools/generator-zest/app/templates/SecurityModule/bootstrap.tmpl
+++ b/tools/generator-zest/app/templates/SecurityModule/bootstrap.tmpl
@@ -36,7 +36,6 @@ public class SecurityModule
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
         throws AssemblyException
     {
-        module.withDefaultUnitOfWorkFactory();
         module.services( SecurityRepository.class )
             .withMixins( HardcodedSecurityRepositoryMixin.class )
             .visibleIn( Visibility.application )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/generator-zest/app/templates/StorageModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-zest/app/templates/StorageModule/bootstrap.tmpl b/tools/generator-zest/app/templates/StorageModule/bootstrap.tmpl
index a9a47d2..a9919e4 100644
--- a/tools/generator-zest/app/templates/StorageModule/bootstrap.tmpl
+++ b/tools/generator-zest/app/templates/StorageModule/bootstrap.tmpl
@@ -41,8 +41,6 @@ public class <%- zest.entitystore %>StorageModule
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
         throws AssemblyException
     {
-        module.withDefaultUnitOfWorkFactory();
-
         new <%- zest.entitystore %>EntityStoreAssembler()
             .visibleIn( Visibility.application  )
             .withConfig( configModule, Visibility.application )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/model-detail/src/test/java/org/apache/zest/tools/model/VisitableDetailTest.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/test/java/org/apache/zest/tools/model/VisitableDetailTest.java
b/tools/model-detail/src/test/java/org/apache/zest/tools/model/VisitableDetailTest.java
index bdc798f..177eac2 100644
--- a/tools/model-detail/src/test/java/org/apache/zest/tools/model/VisitableDetailTest.java
+++ b/tools/model-detail/src/test/java/org/apache/zest/tools/model/VisitableDetailTest.java
@@ -22,6 +22,8 @@ package org.apache.zest.tools.model;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import org.apache.zest.tools.model.descriptor.ServiceDetailDescriptor;
+import org.apache.zest.tools.model.descriptor.TransientDetailDescriptor;
 import org.junit.Test;
 import org.apache.zest.api.activation.ActivationException;
 import org.apache.zest.api.activation.ActivatorAdapter;
@@ -100,6 +102,10 @@ public class VisitableDetailTest
         public boolean visitEnter( Object visited )
             throws RuntimeException
         {
+            if( visited instanceof ServiceDetailDescriptor)
+            {
+                return true;
+            }
             String event = "visitEnter( " + visited + " )";
             events.add( event );
             System.out.println( event );
@@ -110,6 +116,10 @@ public class VisitableDetailTest
         public boolean visitLeave( Object visited )
             throws RuntimeException
         {
+            if( visited instanceof ServiceDetailDescriptor)
+            {
+                return true;
+            }
             String event = "visitLeave( " + visited + " )";
             events.add( event );
             System.out.println( event );
@@ -120,6 +130,10 @@ public class VisitableDetailTest
         public boolean visit( Object visited )
             throws RuntimeException
         {
+            if( visited instanceof TransientDetailDescriptor)
+            {
+                return true;
+            }
             String event = "visit( " + visited + " )";
             events.add( event );
             System.out.println( event );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CrudModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CrudModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CrudModuleWriter.java
index 5a6833b..6332b3b 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CrudModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CrudModuleWriter.java
@@ -53,7 +53,6 @@ public class CrudModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
                 "        new CrudServiceAssembler().assemble( module );\n" +
                 "        return module;\n" +
                 "    }\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CustomerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CustomerWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CustomerWriter.java
index 44b9d4b..d1f5aac 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CustomerWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/CustomerWriter.java
@@ -40,11 +40,11 @@ public class CustomerWriter
             pw.println( ".model.orders;" );
             pw.println();
             pw.println("import java.time.ZonedDateTime;");
-            pw.println("import org.apache.zest.api.entity.Identity;");
+            pw.println("import org.apache.zest.api.identity.HasIdentity;");
             pw.println("import org.apache.zest.api.property.Property;");
             pw.println();
             pw.println(
-                "public interface Customer extends Identity\n" +
+                "public interface Customer extends HasIdentity\n" +
                 "{\n" +
                 "    Property<String> name();\n\n" +
                 "    Property<String> address();\n\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/IndexingModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/IndexingModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/IndexingModuleWriter.java
index 78cd08c..72f9b84 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/IndexingModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/IndexingModuleWriter.java
@@ -63,8 +63,6 @@ public class IndexingModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
-                "\n" +
                 "        configModule.entities( NativeConfiguration.class ).visibleIn( Visibility.application
);\n" +
                 "        new RdfNativeSesameStoreAssembler(Visibility.application, Visibility.module).assemble(
module );\n" +
                 "        return module;\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderItemWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderItemWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderItemWriter.java
index 5748ef0..98f941b 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderItemWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderItemWriter.java
@@ -40,11 +40,11 @@ public class OrderItemWriter
             pw.println( ".model.orders;" );
             pw.println();
             pw.println("import java.math.BigDecimal;");
-            pw.println("import org.apache.zest.api.entity.Identity;");
+            pw.println("import org.apache.zest.api.identity.HasIdentity;");
             pw.println("import org.apache.zest.api.property.Property;");
             pw.println();
             pw.println(
-                "public interface OrderItem extends Identity\n" +
+                "public interface OrderItem extends HasIdentity\n" +
                 "{\n" +
                 "    Property<String> partNumber();\n\n" +
                 "    Property<BigDecimal> unitPrice();\n\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderModuleWriter.java
index 0c62bcf..aec0d31 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderModuleWriter.java
@@ -61,7 +61,6 @@ public class OrderModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
                 "        module.values( /* add value types */    );\n" +
                 "        module.entities( Customer.class, Order.class, OrderItem.class );\n"
+
                 "        module.services( /* add services */    )\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderWriter.java
index 58a7649..0c32ce5 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/OrderWriter.java
@@ -43,11 +43,11 @@ public class OrderWriter
             pw.println("import org.apache.zest.api.association.Association;");
             pw.println("import org.apache.zest.api.association.ManyAssociation;");
             pw.println("import org.apache.zest.api.common.Optional;");
-            pw.println("import org.apache.zest.api.entity.Identity;");
+            pw.println("import org.apache.zest.api.identity.HasIdentity;");
             pw.println("import org.apache.zest.api.property.Property;");
             pw.println();
             pw.println(
-                "public interface Order extends Identity\n" +
+                "public interface Order extends HasIdentity\n" +
                 "{\n" +
                 "    Property<String> orderNumber();\n\n" +
                 "    Property<ZonedDateTime> registered();\n\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/SecurityModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/SecurityModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/SecurityModuleWriter.java
index 4ff0297..f315e77 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/SecurityModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/SecurityModuleWriter.java
@@ -63,7 +63,6 @@ public class SecurityModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
                 "        module.services( SecurityRepository.class )\n" +
                 "            .withMixins( HardcodedSecurityRepositoryMixin.class )\n" +
                 "            .visibleIn( Visibility.application )\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/StorageModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/StorageModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/StorageModuleWriter.java
index f6967ee..8d8f8c8 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/StorageModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/common/StorageModuleWriter.java
@@ -63,7 +63,6 @@ public class StorageModuleWriter
                 "        throws AssemblyException\n" +
                 "    {\n" +
                 "\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n\n" +
                 "        new FileEntityStoreAssembler()\n" +
                 "            .visibleIn( Visibility.application  )\n" +
                 "            .withConfig( configModule, Visibility.application )\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/OrderModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/OrderModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/OrderModuleWriter.java
index 3bf9c1f..9eddcd1 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/OrderModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/OrderModuleWriter.java
@@ -62,7 +62,6 @@ public class OrderModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
                 "        module.values( /* add value types */    );\n" +
                 "        module.entities( /* add entity types */    );\n\n" +
                 "        // These assemblers sets up  CRUD access to the entity types listed.\n"
+

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/RestModuleWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/RestModuleWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/RestModuleWriter.java
index f8d849f..15d7ee0 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/RestModuleWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/restapp/RestModuleWriter.java
@@ -60,8 +60,6 @@ public class RestModuleWriter
                 "    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly
module )\n" +
                 "        throws AssemblyException\n" +
                 "    {\n" +
-                "        module.withDefaultUnitOfWorkFactory();\n" +
-                "\n" +
                 "        module.objects( SimpleVerifier.class, SimpleEnroler.class);\n" +
                 "\n" +
                 "        new RestletCrudConnectivityAssembler().assemble( module );\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
----------------------------------------------------------------------
diff --git a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
index 347bb70..df66321 100644
--- a/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
+++ b/tools/shell/src/main/java/org/apache/zest/tools/shell/create/project/singleton/SingletonApplicationAssemblerWriter.java
@@ -55,7 +55,6 @@ public class SingletonApplicationAssemblerWriter
                         "            public void assemble( ModuleAssembly module )\n" +
                         "                throws AssemblyException\n" +
                         "            {\n" +
-                        "                module.withDefaultUnitOfWorkFactory();\n" +
                         "                module.values( );\n" +
                         "                module.entities( );\n" +
                         "                module.services( StartupService.class );\n" +

http://git-wip-us.apache.org/repos/asf/zest-java/blob/103c59cb/tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest4.java
----------------------------------------------------------------------
diff --git a/tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest4.java
b/tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest4.java
index 1887561..93b6102 100644
--- a/tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest4.java
+++ b/tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest4.java
@@ -19,6 +19,8 @@
  */
 package org.apache.zest.tutorials.hello;
 
+import org.apache.zest.api.identity.Identity;
+import org.apache.zest.api.identity.StringIdentity;
 import org.junit.Test;
 import org.apache.zest.api.entity.EntityBuilder;
 import org.apache.zest.api.unitofwork.UnitOfWork;
@@ -32,6 +34,9 @@ import static org.junit.Assert.assertThat;
 
 public class HelloTest4 extends AbstractZestTest
 {
+
+    public static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+
     @Override
     public void assemble( ModuleAssembly module )
         throws AssemblyException
@@ -46,13 +51,13 @@ public class HelloTest4 extends AbstractZestTest
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
         try
         {
-            EntityBuilder<Hello> builder = uow.newEntityBuilder( Hello.class, "123"
);
+            EntityBuilder<Hello> builder = uow.newEntityBuilder( Hello.class, TEST_IDENTITY);
             builder.instanceFor( Hello.State.class ).phrase().set( "Hello" );
             builder.instanceFor( Hello.State.class ).name().set( "World" );
             builder.newInstance();
             uow.complete();
             uow = unitOfWorkFactory.newUnitOfWork();
-            Hello underTest = uow.get( Hello.class, "123" );
+            Hello underTest = uow.get( Hello.class, TEST_IDENTITY);
             String result = underTest.say();
             uow.complete();
             assertThat( result, equalTo( "Hello World" ) );


Mime
View raw message