Repository: cayenne
Updated Branches:
  refs/heads/master 67282fb6d -> 99f4f21c1


CAY-2220 cdbimport: Java 8 date and time types
 - new property in cdbimport (Maven and Ant) configuration - useJava7Types with 
default false (i.e. Java 8 types will be used)
 - new flags in Reverse Engineering GUI in modeler (use primitives and use old 
java.util.Date types)


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/99f4f21c
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/99f4f21c
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/99f4f21c

Branch: refs/heads/master
Commit: 99f4f21c179da1abdaa8da2876f4da3991002b30
Parents: 67282fb
Author: Nikita Timofeev <stari...@gmail.com>
Authored: Thu Feb 2 16:40:45 2017 +0300
Committer: Nikita Timofeev <stari...@gmail.com>
Committed: Thu Feb 2 16:40:45 2017 +0300

----------------------------------------------------------------------
 .../apache/cayenne/tools/DbImporterTask.java    |  5 +++
 .../tools/build-include-table.map.xml-result    |  2 +-
 .../merge/context/EntityMergeSupport.java       | 22 ++++++++--
 .../dbsync/merge/context/MergerContext.java     |  9 +++-
 .../reverse/dbimport/DbImportConfiguration.java |  9 ++++
 .../reverse/dbimport/DefaultDbImportAction.java |  1 +
 .../reverse/dbimport/ReverseEngineering.java    |  9 ++++
 .../dbsync/merge/EntityMergeSupportIT.java      |  3 +-
 .../apache/cayenne/tools/DbImporterMojo.java    |  1 +
 .../cayenne/tools/DbImporterMojoTest.java       | 10 +++++
 .../dbimport/testDefaultPackage.map.xml-result  |  4 +-
 .../testFilteringWithSchema.map.xml-result      |  4 +-
 .../testForceDataMapSchema.map.xml-result       |  4 +-
 .../testImportAddTableAndColumn.map.xml-result  |  4 +-
 .../testImportNewDataMap.map.xml-result         |  2 +-
 .../tools/dbimport/testJava7Types-pom.xml       | 46 ++++++++++++++++++++
 .../tools/dbimport/testJava7Types.map.xml       | 26 +++++++++++
 .../dbimport/testJava7Types.map.xml-result      | 39 +++++++++++++++++
 .../cayenne/tools/dbimport/testJava7Types.sql   | 27 ++++++++++++
 .../tools/dbimport/testJava8Types-pom.xml       | 46 ++++++++++++++++++++
 .../tools/dbimport/testJava8Types.map.xml       | 26 +++++++++++
 .../dbimport/testJava8Types.map.xml-result      | 39 +++++++++++++++++
 .../cayenne/tools/dbimport/testJava8Types.sql   | 27 ++++++++++++
 .../testSchemasAndTableExclude.map.xml-result   |  2 +-
 .../dbimport/testViewsExclude.map.xml-result    |  2 +-
 .../modeler/action/CreateObjEntityAction.java   |  5 +--
 .../modeler/dialog/db/load/DbLoaderContext.java |  2 +
 .../dialog/db/load/DbLoaderOptionsDialog.java   | 22 ++++++++++
 .../dialog/objentity/EntitySyncController.java  |  4 +-
 29 files changed, 380 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-ant/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
----------------------------------------------------------------------
diff --git 
a/cayenne-ant/src/main/java/org/apache/cayenne/tools/DbImporterTask.java 
b/cayenne-ant/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
index 6c939c1..9a42ede 100644
--- a/cayenne-ant/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
+++ b/cayenne-ant/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
@@ -54,6 +54,7 @@ public class DbImporterTask extends Task {
     public DbImporterTask() {
         this.config = new DbImportConfiguration();
         this.config.setUsePrimitives(true);
+        this.config.setUseJava7Types(false);
         
this.config.setNamingStrategy(DefaultObjectNameGenerator.class.getName());
 
         // reverse engineering config is flattened into task...
@@ -215,6 +216,10 @@ public class DbImporterTask extends Task {
         config.setUsePrimitives(flag);
     }
 
+    public void setUseJava7Types(boolean flag) {
+        config.setUseJava7Types(flag);
+    }
+
     public void setForceDataMapCatalog(boolean flag) {
         config.setForceDataMapCatalog(flag);
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-ant/src/test/resources/org/apache/cayenne/tools/build-include-table.map.xml-result
----------------------------------------------------------------------
diff --git 
a/cayenne-ant/src/test/resources/org/apache/cayenne/tools/build-include-table.map.xml-result
 
b/cayenne-ant/src/test/resources/org/apache/cayenne/tools/build-include-table.map.xml-result
index 5c0d2b6..050561f 100644
--- 
a/cayenne-ant/src/test/resources/org/apache/cayenne/tools/build-include-table.map.xml-result
+++ 
b/cayenne-ant/src/test/resources/org/apache/cayenne/tools/build-include-table.map.xml-result
@@ -32,6 +32,6 @@
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
index 7f86dd2..72677c7 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
@@ -38,6 +38,7 @@ import org.apache.cayenne.util.EntityMergeListener;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -52,10 +53,14 @@ public class EntityMergeSupport {
 
     private static final Log LOGGER = 
LogFactory.getLog(EntityMergeSupport.class);
 
-    private static final Map<String, String> CLASS_TO_PRIMITIVE;
+    private static final Map<String, String> CLASS_TO_PRIMITIVE = new 
HashMap<>();
+
+    /**
+     * Type conversion to Java 8 types (now it's only java.time.* types)
+     */
+    private static final Map<Integer, String> SQL_TYPE_TO_JAVA8_TYPE = new 
HashMap<>();
 
     static {
-        CLASS_TO_PRIMITIVE = new HashMap<>();
         CLASS_TO_PRIMITIVE.put(Byte.class.getName(), "byte");
         CLASS_TO_PRIMITIVE.put(Long.class.getName(), "long");
         CLASS_TO_PRIMITIVE.put(Double.class.getName(), "double");
@@ -63,6 +68,10 @@ public class EntityMergeSupport {
         CLASS_TO_PRIMITIVE.put(Float.class.getName(), "float");
         CLASS_TO_PRIMITIVE.put(Short.class.getName(), "short");
         CLASS_TO_PRIMITIVE.put(Integer.class.getName(), "int");
+
+        SQL_TYPE_TO_JAVA8_TYPE.put(Types.DATE,      "java.time.LocalDate");
+        SQL_TYPE_TO_JAVA8_TYPE.put(Types.TIME,      "java.time.LocalTime");
+        SQL_TYPE_TO_JAVA8_TYPE.put(Types.TIMESTAMP, "java.time.LocalDateTime");
     }
 
     private final ObjectNameGenerator nameGenerator;
@@ -70,17 +79,20 @@ public class EntityMergeSupport {
     private final boolean removingMeaningfulFKs;
     private final NameFilter meaningfulPKsFilter;
     private final boolean usingPrimitives;
+    private final boolean usingJava7Types;
 
     public EntityMergeSupport(ObjectNameGenerator nameGenerator,
                               NameFilter meaningfulPKsFilter,
                               boolean removingMeaningfulFKs,
-                              boolean usingPrimitives) {
+                              boolean usingPrimitives,
+                              boolean usingJava7Types) {
 
         this.listeners = new ArrayList<>();
         this.nameGenerator = nameGenerator;
         this.removingMeaningfulFKs = removingMeaningfulFKs;
         this.meaningfulPKsFilter = meaningfulPKsFilter;
         this.usingPrimitives = usingPrimitives;
+        this.usingJava7Types = usingJava7Types;
 
         // will ensure that all created ObjRelationships would have
         // default delete rule
@@ -269,6 +281,10 @@ public class EntityMergeSupport {
     }
 
     private String getTypeForObjAttribute(DbAttribute dbAttribute) {
+        String java8Type;
+        if(!usingJava7Types && (java8Type = 
SQL_TYPE_TO_JAVA8_TYPE.get(dbAttribute.getType())) != null) {
+            return java8Type;
+        }
         String type = TypesMapping.getJavaBySqlType(dbAttribute.getType());
         String primitiveType;
         if (usingPrimitives && (primitiveType = CLASS_TO_PRIMITIVE.get(type)) 
!= null) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/MergerContext.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/MergerContext.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/MergerContext.java
index b048952..6bc05fb 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/MergerContext.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/MergerContext.java
@@ -103,6 +103,7 @@ public class MergerContext {
 
         private MergerContext context;
         private boolean usingPrimitives;
+        private boolean usingJava7Types;
         private NameFilter meaningfulPKsFilter;
 
         private Builder(DataMap dataMap) {
@@ -134,7 +135,8 @@ public class MergerContext {
             context.entityMergeSupport = new 
EntityMergeSupport(context.nameGenerator,
                     meaningfulPKsFilter,
                     true,
-                    usingPrimitives);
+                    usingPrimitives,
+                    usingJava7Types);
 
             return context;
         }
@@ -154,6 +156,11 @@ public class MergerContext {
             return this;
         }
 
+        public Builder usingJava7Types(boolean flag) {
+            this.usingJava7Types = flag;
+            return this;
+        }
+
         public Builder dataNode(DataNode dataNode) {
             this.context.dataNode = Objects.requireNonNull(dataNode);
             return this;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportConfiguration.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportConfiguration.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportConfiguration.java
index 2e568cb..d7350e7 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportConfiguration.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DbImportConfiguration.java
@@ -55,6 +55,7 @@ public class DbImportConfiguration {
     private String meaningfulPkTables;
     private String adapter;
     private boolean usePrimitives;
+    private boolean useJava7Types;
     private Log logger;
     private String namingStrategy;
     private String stripFromTableNames;
@@ -145,6 +146,14 @@ public class DbImportConfiguration {
         this.usePrimitives = usePrimitives;
     }
 
+    public boolean isUseJava7Types() {
+        return useJava7Types;
+    }
+
+    public void setUseJava7Types(boolean useJava7Types) {
+        this.useJava7Types = useJava7Types;
+    }
+
     public NameFilter createMeaningfulPKFilter() {
 
         if (meaningfulPkTables == null) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
index c7f9ceb..cd2838c 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/DefaultDbImportAction.java
@@ -325,6 +325,7 @@ public class DefaultDbImportAction implements 
DbImportAction {
                 .delegate(mergeDelegate)
                 .nameGenerator(nameGenerator)
                 .usingPrimitives(config.isUsePrimitives())
+                .usingJava7Types(config.isUseJava7Types())
                 .meaningfulPKFilter(config.createMeaningfulPKFilter())
                 .build();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/ReverseEngineering.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/ReverseEngineering.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/ReverseEngineering.java
index b42bc80..30a5e3d 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/ReverseEngineering.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbimport/ReverseEngineering.java
@@ -96,6 +96,11 @@ public class ReverseEngineering extends SchemaContainer 
implements Serializable
     private boolean usePrimitives = true;
 
     /**
+     * Use old Java 7 date types
+     */
+    private boolean useJava7Types = false;
+
+    /**
      * Typical types are: <ul>
      * <li> "TABLE"
      * <li> "VIEW"
@@ -207,4 +212,8 @@ public class ReverseEngineering extends SchemaContainer 
implements Serializable
     public boolean isUsePrimitives() {
         return usePrimitives;
     }
+
+    public boolean isUseJava7Types() {
+        return useJava7Types;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
----------------------------------------------------------------------
diff --git 
a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
 
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
index 82d567e..76c1731 100644
--- 
a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
+++ 
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
@@ -94,7 +94,8 @@ public class EntityMergeSupportIT extends MergeCase {
                                new 
DefaultObjectNameGenerator(NoStemStemmer.getInstance()),
                                NamePatternMatcher.EXCLUDE_ALL,
                                true,
-                               true);
+                               true,
+                               false);
                
assertTrue(entityMergeSupport.synchronizeWithDbEntities(Arrays.asList(objEntity1,
 objEntity2)));
                assertNotNull(objEntity1.getAttribute("name"));
                assertNotNull(objEntity1.getRelationship("newTable2s"));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
 
b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
index 8faf2ba..2d2d761 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
+++ 
b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
@@ -154,6 +154,7 @@ public class DbImporterMojo extends AbstractMojo {
         config.setUrl(dataSource.getUrl());
         config.setUsername(dataSource.getUsername());
         config.setUsePrimitives(dbImportConfig.isUsePrimitives());
+        config.setUseJava7Types(dbImportConfig.isUseJava7Types());
 
         return config;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
 
b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
index a99f309..eec1c18 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
@@ -247,6 +247,16 @@ public class DbImporterMojoTest extends 
AbstractMojoTestCase {
     }
 
     @Test
+    public void testJava7Types() throws Exception {
+        test("testJava7Types");
+    }
+
+    @Test
+    public void testJava8Types() throws Exception {
+        test("testJava8Types");
+    }
+
+    @Test
     public void testFilteringConfig() throws Exception {
         DbImporterMojo cdbImport = getCdbImport("config/pom-01.xml");
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
index 5373617..f581dc4 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testDefaultPackage.map.xml-result
@@ -40,13 +40,13 @@
     <obj-entity name="Child" className="com.example.test.Child" 
dbEntityName="CHILD">
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
         <obj-attribute name="parentId" type="java.lang.String" 
db-attribute-path="PARENT_ID"/>
     </obj-entity>
     <obj-entity name="Parent" className="com.example.test.Parent" 
dbEntityName="PARENT">
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
index a65e271..d5d7849 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testFilteringWithSchema.map.xml-result
@@ -39,13 +39,13 @@
     <obj-entity name="Child" className="Child" dbEntityName="CHILD">
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
         <obj-attribute name="parentId" type="java.lang.String" 
db-attribute-path="PARENT_ID"/>
     </obj-entity>
     <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
index 0eaaffd..4a6e490 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testForceDataMapSchema.map.xml-result
@@ -40,13 +40,13 @@
     <obj-entity name="Child" className="com.example.test.Child" 
dbEntityName="CHILD">
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
         <obj-attribute name="parentId" type="java.lang.String" 
db-attribute-path="PARENT_ID"/>
     </obj-entity>
     <obj-entity name="Parent" className="com.example.test.Parent" 
dbEntityName="PARENT">
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
index a5dd466..42a8e15 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportAddTableAndColumn.map.xml-result
@@ -38,13 +38,13 @@
     <obj-entity name="Child" className="Child" dbEntityName="CHILD">
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
         <obj-attribute name="parentId" type="java.lang.String" 
db-attribute-path="PARENT_ID"/>
     </obj-entity>
     <obj-entity name="Parent" className="Parent" dbEntityName="PARENT">
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
index 6133ac4..923f87b 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testImportNewDataMap.map.xml-result
@@ -32,6 +32,6 @@
                <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
                <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
                <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-               <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+               <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
        </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
new file mode 100644
index 0000000..347ea13
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types-pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+       http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+    <name>DbImporterMojo Test1</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>cayenne-maven-plugin</artifactId>
+                <configuration>
+                    
<map>target/test-classes/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml</map>
+                    <dataSource>
+                        <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+                        
<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+                    </dataSource>
+                    <dbimport>
+                        <schema>SCHEMA_01</schema>
+                        <useJava7Types>true</useJava7Types>
+                    </dbimport>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml
new file mode 100644
index 0000000..08ac7f7
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap 
http://cayenne.apache.org/schema/9/modelMap.xsd";
+          project-version="9">
+    <property name="defaultSchema" value="SCHEMA_01"/>
+</data-map>
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml-result
new file mode 100644
index 0000000..480c302
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.map.xml-result
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap 
http://cayenne.apache.org/schema/9/modelMap.xsd";
+          project-version="9">
+    <property name="defaultSchema" value="SCHEMA_01"/>
+
+    <db-entity name="CHILD" schema="SCHEMA_01">
+        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" 
isMandatory="true" length="10"/>
+        <db-attribute name="date" type="DATE" length="10" />
+        <db-attribute name="time" type="TIME" length="8" />
+        <db-attribute name="timestamp" type="TIMESTAMP" length="29" />
+    </db-entity>
+
+    <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+        <obj-attribute name="date" type="java.util.Date" 
db-attribute-path="date"/>
+        <obj-attribute name="time" type="java.util.Date" 
db-attribute-path="time"/>
+        <obj-attribute name="timestamp" type="java.util.Date" 
db-attribute-path="timestamp"/>
+    </obj-entity>
+</data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.sql
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.sql
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.sql
new file mode 100644
index 0000000..4a20013
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava7Types.sql
@@ -0,0 +1,27 @@
+--  Licensed to the Apache Software Foundation (ASF) under one
+--  or more contributor license agreements.  See the NOTICE file
+--  distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+--  to you under the Apache License, Version 2.0 (the
+--  "License"); you may not use this file except in compliance
+--  with the License.  You may obtain a copy of the License at
+--
+--    http://www.apache.org/licenses/LICENSE-2.0
+--
+--  Unless required by applicable law or agreed to in writing,
+--  software distributed under the License is distributed on an
+--  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+--  KIND, either express or implied.  See the License for the
+--  specific language governing permissions and limitations
+--  under the License.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.child (
+    "date" DATE,
+    "time" TIME,
+    "timestamp" TIMESTAMP,
+    id INTEGER NOT NULL,
+    PRIMARY KEY (id)
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
new file mode 100644
index 0000000..ea39308
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types-pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+       http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+
+    <name>DbImporterMojo Test1</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>cayenne-maven-plugin</artifactId>
+                <configuration>
+                    
<map>target/test-classes/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml</map>
+                    <dataSource>
+                        <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+                        
<url>jdbc:derby:memory:DbImporterMojoTest;create=true</url>
+                    </dataSource>
+                    <dbimport>
+                        <schema>SCHEMA_01</schema>
+                        <useJava7Types>false</useJava7Types>
+                    </dbimport>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml
new file mode 100644
index 0000000..08ac7f7
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap 
http://cayenne.apache.org/schema/9/modelMap.xsd";
+          project-version="9">
+    <property name="defaultSchema" value="SCHEMA_01"/>
+</data-map>
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml-result
new file mode 100644
index 0000000..687ac07
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.map.xml-result
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~   Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you under the Apache License, Version 2.0 (the
+  ~  "License"); you may not use this file except in compliance
+  ~  with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap 
http://cayenne.apache.org/schema/9/modelMap.xsd";
+          project-version="9">
+    <property name="defaultSchema" value="SCHEMA_01"/>
+
+    <db-entity name="CHILD" schema="SCHEMA_01">
+        <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" 
isMandatory="true" length="10"/>
+        <db-attribute name="date" type="DATE" length="10" />
+        <db-attribute name="time" type="TIME" length="8" />
+        <db-attribute name="timestamp" type="TIMESTAMP" length="29" />
+    </db-entity>
+
+    <obj-entity name="Child" className="Child" dbEntityName="CHILD">
+        <obj-attribute name="date" type="java.time.LocalDate" 
db-attribute-path="date"/>
+        <obj-attribute name="time" type="java.time.LocalTime" 
db-attribute-path="time"/>
+        <obj-attribute name="timestamp" type="java.time.LocalDateTime" 
db-attribute-path="timestamp"/>
+    </obj-entity>
+</data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.sql
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.sql
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.sql
new file mode 100644
index 0000000..4a20013
--- /dev/null
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testJava8Types.sql
@@ -0,0 +1,27 @@
+--  Licensed to the Apache Software Foundation (ASF) under one
+--  or more contributor license agreements.  See the NOTICE file
+--  distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+--  to you under the Apache License, Version 2.0 (the
+--  "License"); you may not use this file except in compliance
+--  with the License.  You may obtain a copy of the License at
+--
+--    http://www.apache.org/licenses/LICENSE-2.0
+--
+--  Unless required by applicable law or agreed to in writing,
+--  software distributed under the License is distributed on an
+--  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+--  KIND, either express or implied.  See the License for the
+--  specific language governing permissions and limitations
+--  under the License.
+
+CREATE SCHEMA schema_01;
+SET SCHEMA schema_01;
+
+CREATE TABLE schema_01.child (
+    "date" DATE,
+    "time" TIME,
+    "timestamp" TIMESTAMP,
+    id INTEGER NOT NULL,
+    PRIMARY KEY (id)
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
index 1870f1b..24f69a4 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testSchemasAndTableExclude.map.xml-result
@@ -33,6 +33,6 @@
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
----------------------------------------------------------------------
diff --git 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
index d24df6e..f3e21bf 100644
--- 
a/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
+++ 
b/maven-plugins/cayenne-maven-plugin/src/test/resources/org/apache/cayenne/tools/dbimport/testViewsExclude.map.xml-result
@@ -38,6 +38,6 @@
         <obj-attribute name="col2" type="java.lang.String" 
db-attribute-path="COL2"/>
         <obj-attribute name="col3" type="java.math.BigDecimal" 
db-attribute-path="COL3"/>
         <obj-attribute name="col4" type="java.lang.String" 
db-attribute-path="COL4"/>
-        <obj-attribute name="col5" type="java.util.Date" 
db-attribute-path="COL5"/>
+        <obj-attribute name="col5" type="java.time.LocalDate" 
db-attribute-path="COL5"/>
     </obj-entity>
 </data-map>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
index 068bd7c..d4e745b 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
@@ -113,14 +113,13 @@ public class CreateObjEntityAction extends CayenneAction {
 
         // TODO: Modeler-controlled defaults for all the hardcoded boolean 
flags here.
         EntityMergeSupport merger = new EntityMergeSupport(new 
DefaultObjectNameGenerator(NoStemStemmer.getInstance()),
-                NamePatternMatcher.EXCLUDE_ALL, true, true);
+                NamePatternMatcher.EXCLUDE_ALL, true, true, false);
         
merger.addEntityMergeListener(DeleteRuleUpdater.getEntityMergeListener());
         merger.synchronizeWithDbEntity(entity);
 
         fireObjEntityEvent(this, mediator, dataMap, entity);
 
-        application.getUndoManager().addEdit(
-                new CreateObjEntityUndoableEdit(dataMap, entity));
+        application.getUndoManager().addEdit(new 
CreateObjEntityUndoableEdit(dataMap, entity));
     }
 
     public void createObjEntity(DataMap dataMap, ObjEntity entity) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderContext.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderContext.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderContext.java
index 2fb85a0..4a62244 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderContext.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderContext.java
@@ -145,6 +145,8 @@ public class DbLoaderContext {
         
config.getDbLoaderConfig().setFiltersConfig(filtersConfigBuilder.build());
         config.setMeaningfulPkTables(dialog.getMeaningfulPk());
         config.setNamingStrategy(dialog.getNamingStrategy());
+        config.setUsePrimitives(dialog.isUsePrimitives());
+        config.setUseJava7Types(dialog.isUseJava7Typed());
         setConfig(config);
 
         prepareDataMap();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderOptionsDialog.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderOptionsDialog.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderOptionsDialog.java
index 192a5aa..f42c359 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderOptionsDialog.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoaderOptionsDialog.java
@@ -27,6 +27,7 @@ import 
org.apache.cayenne.modeler.util.NameGeneratorPreferences;
 import java.util.Collection;
 import java.util.Vector;
 import javax.swing.DefaultComboBoxModel;
+import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
 import javax.swing.JTextField;
 
@@ -41,6 +42,8 @@ public class DbLoaderOptionsDialog extends 
DbActionOptionsDialog {
     private JTextField procNamePatternField;
     private JComboBox<String> strategyCombo;
     protected String strategy;
+    private JCheckBox usePrimitives;
+    private JCheckBox useJava7Types;
 
     /**
      * Creates and initializes new ChooseSchemaDialog.
@@ -70,11 +73,22 @@ public class DbLoaderOptionsDialog extends 
DbActionOptionsDialog {
         strategyCombo = new JComboBox<>();
         strategyCombo.setEditable(true);
 
+        usePrimitives = new JCheckBox();
+        usePrimitives.setSelected(true);
+        usePrimitives.setToolTipText("<html>Use primitive types (e.g. int) or 
Object types (e.g. java.lang.Integer)</html>");
+
+        useJava7Types = new JCheckBox();
+        useJava7Types.setSelected(false);
+        useJava7Types.setToolTipText("<html>Use <b>java.util.Date</b> for all 
columns with <i>DATE/TIME/TIMESTAMP</i> types.<br>" +
+                "By default <b>java.time.*</b> types will be used.</html>");
+
         builder.append("Table Name Include Pattern:", 
tableIncludePatternField);
         builder.append("Table Name Exclude Pattern:", 
tableExcludePatternField);
         builder.append("Procedure Name Pattern:", procNamePatternField);
         builder.append("Naming Strategy:", strategyCombo);
         builder.append("Tables with Meaningful PK Pattern:", meaningfulPk);
+        builder.append("Use Java primitive types:", usePrimitives);
+        builder.append("Use old java.util.Date type:", useJava7Types);
     }
 
     protected void initFromModel(Collection<String> catalogs, 
Collection<String> schemas, String currentCatalog, String currentSchema) {
@@ -111,6 +125,14 @@ public class DbLoaderOptionsDialog extends 
DbActionOptionsDialog {
                 .getText();
     }
 
+    boolean isUsePrimitives() {
+        return usePrimitives.isSelected();
+    }
+
+    boolean isUseJava7Typed() {
+        return useJava7Types.isSelected();
+    }
+
     String getNamingStrategy() {
         return (String) strategyCombo.getSelectedItem();
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/99f4f21c/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
index e7134d0..2c68fd2 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
@@ -70,7 +70,7 @@ public class EntitySyncController extends CayenneController {
         }
 
         // TODO: Modeler-controlled defaults for all the hardcoded boolean 
flags here.
-        EntityMergeSupport merger = new EntityMergeSupport(namingStrategy, 
NamePatternMatcher.EXCLUDE_ALL, true, true);
+        EntityMergeSupport merger = new EntityMergeSupport(namingStrategy, 
NamePatternMatcher.EXCLUDE_ALL, true, true, false);
 
         // see if we need to remove meaningful attributes...
         for (ObjEntity entity : entities) {
@@ -116,7 +116,7 @@ public class EntitySyncController extends CayenneController 
{
         view.setVisible(true);
 
         // TODO: Modeler-controlled defaults for all the hardcoded flags here.
-        return cancel[0] ? null : new EntityMergeSupport(namingStrategy, 
NamePatternMatcher.EXCLUDE_ALL, removeFKs[0], true);
+        return cancel[0] ? null : new EntityMergeSupport(namingStrategy, 
NamePatternMatcher.EXCLUDE_ALL, removeFKs[0], true, false);
     }
 
     @Override

Reply via email to