You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2017/02/03 09:41:26 UTC

cayenne git commit: CAY-2217 cdbimport: update documentation and upgrade guide

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


CAY-2217 cdbimport: update documentation and upgrade guide


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

Branch: refs/heads/master
Commit: ce3ea42913daf9ead2c61da07b63183a48be6550
Parents: 99f4f21
Author: Nikita Timofeev <st...@gmail.com>
Authored: Fri Feb 3 12:40:35 2017 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Fri Feb 3 12:40:35 2017 +0300

----------------------------------------------------------------------
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |   1 +
 docs/doc/src/main/resources/UPGRADE.txt         |  26 +++
 .../src/docbkx/including-cayenne-in-project.xml | 219 ++++++++++++-------
 .../cayenne-guide/src/docbkx/re-filtering.xml   |  36 +--
 .../src/docbkx/re-introduction.xml              |  20 +-
 .../cayenne-guide/src/docbkx/re-modeler.xml     |  11 +
 .../src/docbkx/re-other-settings.xml            |  16 +-
 .../re-modeler-reverseengineering-dialog.png    | Bin 29936 -> 37668 bytes
 .../upgrade-guide/src/docbkx/new-features.xml   |  29 +--
 9 files changed, 231 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 216ce7c..c165ab6 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -27,6 +27,7 @@ CAY-2176 Java 7 diamond class generation templates
 CAY-2177 Sync auto generated state of PK between model and DB
 CAY-2187 Support for the scalar and aggregate SQL functions in ObjectSelect API
 CAY-2197 Update sqlite version and enable in-memory default config
+CAY-2212 cdbimport cleanup and configuration schema refactoring
 
 Bug Fixes:
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/doc/src/main/resources/UPGRADE.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/UPGRADE.txt b/docs/doc/src/main/resources/UPGRADE.txt
index 627e4d2..7c27cf7 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -6,6 +6,32 @@ IMPORTANT: be sure to read all notes for the intermediate releases between your
 -------------------------------------------------------------------------------
 UPGRADING TO 4.0.M5
 
+* Per CAY-2212 cdbimport tool revisited once again, so configuration of Maven plugin should be changed.
+  - "maven-cayenne-plugin" is deprecated, please switch to "cayenne-maven-plugin"
+  - <reverseEngineering> tag replaced with <dbimport> tag
+  - new <dataSource> tag introduced that should enclose all connection properties:
+    1. <driver>
+    2. <url>
+    3. <user>
+    4. <password>
+
+  - top level properties moved to <dbimport>:
+    1. <defaultPackage>
+    2. <forceDataMapCatalog>
+    3. <forceDataMapSchema>
+    4. <meaningfulPkTables>
+    5. <namingStrategy>
+    6. <stripFromTableNames>
+    7. <usePrimitives>
+
+  - Java 8 java.time.* types are now used by default in cdbimport (and in "Reengineer Database Schema" tool in Modeler)
+  This can be controlled by <useJava7Types> property in <dbimport> (or checkbox in Modeler).
+
+  - For Ant users: cayenne-tools.jar split into two parts:
+    1. cayenne-ant.jar for Ant tasks
+    2. cayenne-cgen.jar for class generation functionality (required only for cgen task)
+
+
 * Per CAY-2166, Cayenne supports auto-loading of DI modules. There are a few changes worth mentioning:
   - Service override policies. In the previous 4.0 milestones custom modules would override "builder" modules
   (i.e. implicit modules that wrap around various customizations made in response to the builder method calls). It

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/docbkx/including-cayenne-in-project.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/including-cayenne-in-project.xml b/docs/docbook/cayenne-guide/src/docbkx/including-cayenne-in-project.xml
index aba358b..d4c0942 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/including-cayenne-in-project.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/including-cayenne-in-project.xml
@@ -66,10 +66,10 @@
         <para>Additionally Cayenne provides a Maven plugin with a set of goals to perform various project
             tasks, such as synching generated Java classes with the mapping, described in the
             following subsection. The full plugin name is
-                <code>org.apache.cayenne.plugins:maven-cayenne-plugin</code>.</para>
+                <code>org.apache.cayenne.plugins:cayenne-maven-plugin</code>.</para>
         <section xml:id="mvn-cgen">
             <title>cgen</title>
-            <para><code>cgen</code> is a <code>maven-cayenne-plugin</code> goal that generates and maintains
+            <para><code>cgen</code> is a <code>cayenne-maven-plugin</code> goal that generates and maintains
                 source (.java) files of persistent objects based on a DataMap. By default, it is
                 bound to the generate-sources phase. If "makePairs" is set to "true" (which is the
                 recommended default), this task will generate a pair of classes
@@ -234,7 +234,7 @@
                 generated with default Maven source destination and superclass
                 package:<programlisting language="xml">&lt;plugin>
     &lt;groupId>org.apache.cayenne.plugins&lt;/groupId>
-    &lt;artifactId>maven-cayenne-plugin&lt;/artifactId>
+    &lt;artifactId>cayenne-maven-plugin&lt;/artifactId>
     &lt;version><?eval ${project.version}?>&lt;/version>
 
     &lt;configuration>
@@ -252,7 +252,7 @@
 		</section>
 		<section xml:id="mvn-cdbgen">
 			<title>cdbgen</title>
-			<para><code>cdbgen</code> is a <code>maven-cayenne-plugin</code> goal that drops and/or generates
+			<para><code>cdbgen</code> is a <code>cayenne-maven-plugin</code> goal that drops and/or generates
 				tables in a database on Cayenne DataMap. By default, it is bound to the
 				pre-integration-test phase.
 				<table frame="void">
@@ -355,7 +355,7 @@
 			<para>Example - creating a DB schema on a local HSQLDB
 				database:<programlisting language="xml">&lt;plugin>
     &lt;groupId>org.apache.cayenne.plugins&lt;/groupId>
-    &lt;artifactId>maven-cayenne-plugin&lt;/artifactId>
+    &lt;artifactId>cayenne-maven-plugin&lt;/artifactId>
     &lt;version><?eval ${project.version}?>&lt;/version>
     &lt;executions>
         &lt;execution>
@@ -375,20 +375,22 @@
 		</section>
 		<section xml:id="mvn-cdbimport">
 			<title>cdbimport</title>
-			<para><code>cdbimport</code> is a <code>maven-cayenne-plugin</code> goal that generates a DataMap
+			<para><code>cdbimport</code> is a <code>cayenne-maven-plugin</code> goal that generates a DataMap
 				based on an existing database schema. By default, it is bound to the
 				generate-sources phase. This allows you to generate your DataMap prior to building
 				your project, possibly followed by "cgen" execution to generate the classes.
-				CDBImport plugin described in details in chapter <link linkend="re-introduction">Reverse Engineering</link>
+				CDBImport plugin described in details in chapter <link linkend="re-introduction">"DB-First Flow"</link>
 				<table frame="void">
-					<caption>cdbimport required parameters</caption>
+					<caption>cdbimport parameters</caption>
 					<col width="14%"/>
 					<col width="7%"/>
-					<col width="79%"/>
+                    <col width="7%"/>
+					<col width="72%"/>
 					<thead>
 						<tr>
 							<th>Name</th>
 							<th>Type</th>
+                            <th>Required</th>
 							<th>Description</th>
 						</tr>
 					</thead>
@@ -397,6 +399,7 @@
 							<td><code>map</code>
 							</td>
 							<td>File</td>
+                            <td>Yes</td>
 							<td>DataMap XML file which is the destination of the schema import. Can
 								be an existing file. If this file does not exist, it is created when
 								cdbimport is executed. E.g.
@@ -407,24 +410,83 @@
 								such as default Java package, will be preserved (unless changed
 								explicitly in the plugin configuration).</td>
 						</tr>
-						<tr>
-							<td><code>driver</code></td>
-							<td>String</td>
-							<td>A class of JDBC driver to use for the target database.</td>
-						</tr>
-						<tr>
-							<td><code>url</code></td>
-							<td>String</td>
-							<td>JDBC URL of a target database.</td>
-						</tr>
+                        <tr>
+                            <td><code>adapter</code>
+                            </td>
+                            <td>String</td>
+                            <td>No</td>
+                            <td>A Java class name implementing org.apache.cayenne.dba.DbAdapter. This attribute is
+                                optional. If not specified, AutoAdapter is used, which will attempt
+                                to guess the DB type.</td>
+                        </tr>
+                        <tr>
+                            <td><code>dataSource</code>
+                            </td>
+                            <td>XML</td>
+                            <td>Yes</td>
+                            <td>An object that contains Data Source parameters</td>
+                        </tr>
+                        <tr>
+                            <td><code>dbimport</code>
+                            </td>
+                            <td>XML</td>
+                            <td>No</td>
+                            <td>An object that contains detailed reverse engineering rules about what DB objects should
+                                be processed. For full information about this parameter see <link
+                                        linkend="re-introduction">"DB-First Flow"</link> chapter.</td>
+                        </tr>
 					</tbody>
-				</table></para>
+				</table>
+            </para>
+            <para>
+                <table frame="void">
+                    <caption>&lt;dataSource> parameters</caption>
+                    <col width="14%"/>
+                    <col width="7%"/>
+                    <col width="7%"/>
+                    <col width="72%"/>
+                    <thead>
+                        <tr>
+                            <th>Name</th>
+                            <th>Type</th>
+                            <th>Required</th>
+                            <th>Description</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr>
+                            <td><code>driver</code></td>
+                            <td>String</td>
+                            <td>Yes</td>
+                            <td>A class of JDBC driver to use for the target database.</td>
+                        </tr>
+                        <tr>
+                            <td><code>url</code></td>
+                            <td>String</td>
+                            <td>Yes</td>
+                            <td>JDBC URL of a target database.</td>
+                        </tr>
+                        <tr>
+                            <td><code>username</code></td>
+                            <td>String</td>
+                            <td>No</td>
+                            <td>Database user name.</td>
+                        </tr>
+                        <tr>
+                            <td><code>password</code></td>
+                            <td>String</td>
+                            <td>No</td>
+                            <td>Database user password.</td>
+                        </tr>
+                    </tbody>
+                </table>
+            </para>
 			<para>
 				<table frame="void">
-					<caption>cdbimport optional parameters</caption>
-					<col width="24%"/>
+					<caption>&lt;dbimport> parameters</caption>
+					<col width="18%"/>
 					<col width="8%"/>
-					<col width="67%"/>
+					<col width="73%"/>
 					<thead>
 						<tr>
 							<th>Name</th>
@@ -434,14 +496,6 @@
 					</thead>
 					<tbody>
 						<tr>
-							<td><code>adapter</code>
-							</td>
-							<td>String</td>
-							<td>A Java class name implementing org.apache.cayenne.dba.DbAdapter. This attribute is
-								optional. If not specified, AutoAdapter is used, which will attempt
-								to guess the DB type.</td>
-						</tr>
-						<tr>
 							<td><code>defaultPackage</code></td>
 							<td>String</td>
 							<td>A Java package that will be set as the imported DataMap default and
@@ -483,37 +537,20 @@
 								names. Default is <code>org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator</code>.
 							</td>
 						</tr>
-						<tr>
-							<td><code>password</code></td>
-							<td>String</td>
-							<td>Database user password.</td>
-						</tr>
-						<tr xml:id="cdbimport-rr-parameter">
-							<td><code>reverseEngineering</code></td>
-							<td>XML</td>
-							<td> An object that contains detailed reverse engineering rules about what DB objects should
-                                be processed. For full information about this parameter see <link
-                                    linkend="re-introduction">"DB-First Flow</link> chapter. Here is
-                                some simple example:
-                                <programlisting language="xml">&lt;reverseEngineering&gt;
-	&lt;skipRelationshipsLoading&gt;false&lt;/skipRelationshipsLoading&gt;
-	&lt;skipPrimaryKeyLoading&gt;false&lt;/skipPrimaryKeyLoading&gt;
-
-	&lt;catalog name="test_catalog"&gt;
-		&lt;schema name="test_schema"&gt;
-			&lt;includeTable>".*"&lt;/includeTable>
-			&lt;excludeTable>test_table&lt;/excludeTable>
-		&lt;/schema&gt;
-	&lt;/catalog&gt;
-
-	&lt;includeProcedure pattern=".*"/&gt;
-&lt;/reverseEngineering&gt;</programlisting>
-                            </td>
-						</tr>
-						<tr>
-							<td><code>stripFromTableNames</code></td>
-							<td>String</td>
-							<td>Regex that matches the part of the table name that needs to be stripped off when
+                        <tr>
+                            <td><code>skipPrimaryKeyLoading</code></td>
+                            <td>boolean</td>
+                            <td>Whether to load primary keys. Default "false".</td>
+                        </tr>
+                        <tr>
+                            <td><code>skipRelationshipsLoading</code></td>
+                            <td>boolean</td>
+                            <td>Whether to load relationships. Default "false".</td>
+                        </tr>
+                        <tr>
+                            <td><code>stripFromTableNames</code></td>
+                            <td>String</td>
+                            <td>Regex that matches the part of the table name that needs to be stripped off when
                                 generating ObjEntity name. Here are some examples: <programlisting language="xml"><![CDATA[<!-- Strip prefix -->
 <stripFromTableNames>^myt_</stripFromTableNames>
 
@@ -523,36 +560,60 @@
 <!-- Strip multiple occurrences in the middle -->
 <stripFromTableNames>_abc</stripFromTableNames>]]></programlisting>
                             </td>
-						</tr>
-						<tr>
-							<td><code>username</code></td>
-							<td>String</td>
-							<td>Database user name.</td>
-						</tr>
-						<tr>
-							<td><code>usePrimitives</code></td>
-							<td>boolean</td>
-							<td>Whether numeric and boolean data types should be mapped as Java primitives or Java
+                        </tr>
+                        <tr>
+                            <td><code>usePrimitives</code></td>
+                            <td>boolean</td>
+                            <td>Whether numeric and boolean data types should be mapped as Java primitives or Java
                                 classes. Default is "true", i.e. primitives will be used.</td>
+                        </tr>
+                        <tr>
+                            <td><code>useJava7Types</code></td>
+                            <td>boolean</td>
+                            <td>Whether <code>DATE</code>, <code>TIME</code> and <code>TIMESTAMP</code> data types should be mapped
+                                as <code>java.util.Date</code> or <code>java.time.*</code> classes.
+                                Default is "false", i.e. <code>java.time.*</code> will be used.</td>
+                        </tr>
+						<tr xml:id="cdbimport-rr-parameter">
+							<td>filters configuration</td>
+							<td>XML</td>
+							<td>Detailed reverse engineering rules about what DB objects should be processed.
+                                For full information about this parameter see <link linkend="re-introduction">"DB-First Flow"</link> chapter.
+                                Here is some simple example:
+                                <programlisting language="xml">&lt;dbimport&gt;
+	&lt;catalog name="test_catalog"&gt;
+		&lt;schema name="test_schema"&gt;
+			&lt;includeTable>.*&lt;/includeTable>
+			&lt;excludeTable>test_table&lt;/excludeTable>
+		&lt;/schema&gt;
+	&lt;/catalog&gt;
+
+	&lt;includeProcedure pattern=".*"/&gt;
+&lt;/dbimport&gt;</programlisting>
+                            </td>
 						</tr>
 					</tbody>
 				</table>
 			</para>
 			<para>Example - loading a DB schema from a local HSQLDB database (essentially a reverse operation
-				compared to the cdbgen example above)
+                compared to the <code>cdbgen</code> example above)
 				:<programlisting language="xml">&lt;plugin>
     &lt;groupId>org.apache.cayenne.plugins&lt;/groupId>
-    &lt;artifactId>maven-cayenne-plugin&lt;/artifactId>
+    &lt;artifactId>cayenne-maven-plugin&lt;/artifactId>
     &lt;version><?eval ${project.version}?>&lt;/version>
 
     &lt;executions>
         &lt;execution>
             &lt;configuration>
                 &lt;map>${project.basedir}/src/main/resources/my.map.xml&lt;/map>
-                &lt;url>jdbc:mysql://127.0.0.1/mydb&lt;/url>
-                &lt;driver>com.mysql.jdbc.Driver&lt;/driver>                        
-                &lt;username>sa&lt;/username>
-                &lt;defaultPackage>com.example.cayenne&lt;/defaultPackage>
+                &lt;dataSource>
+                    &lt;url>jdbc:mysql://127.0.0.1/mydb&lt;/url>
+                    &lt;driver>com.mysql.jdbc.Driver&lt;/driver>
+                    &lt;username>sa&lt;/username>
+                &lt;/dataSource>
+                &lt;dbimport>
+                    &lt;defaultPackage>com.example.cayenne&lt;/defaultPackage>
+                &lt;/dbimport>
             &lt;/configuration>
             &lt;goals>
                 &lt;goal>cdbimport&lt;/goal>
@@ -572,7 +633,7 @@
         </section>
         <section xml:id="ant-cdbimport">
             <title>cdbimport</title>
-            <para>This is an Ant counterpart of "cdbimport" goal of maven-cayenne-plugin described
+            <para>This is an Ant counterpart of "cdbimport" goal of cayenne-maven-plugin described
                 above. It has exactly the same properties. Here is a usage
                 example:<programlisting language="xml"> &lt;cdbimport map="${context.dir}/WEB-INF/my.map.xml"
     driver="com.mysql.jdbc.Driver" 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/docbkx/re-filtering.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/re-filtering.xml b/docs/docbook/cayenne-guide/src/docbkx/re-filtering.xml
index a4a53f3..a54ac2f 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/re-filtering.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/re-filtering.xml
@@ -35,7 +35,7 @@
             The simplest example of reverse engineering is processing tables from one schema of catalog and there are several options to do this. 
             Basic syntax is described below:
         </para>
-        <programlisting language="xml">&lt;reverseEngineering&gt;
+        <programlisting language="xml">&lt;dbimport&gt;
     &lt;!-- Ant/Maven in case you only want to specify the schema to import --&gt;
     &lt;schema&gt;SCHEMA_NAME&lt;/schema&gt;
 
@@ -49,11 +49,11 @@
     &lt;schema name="SCHEMA_NAME"&gt;
         ...
     &lt;/schema&gt;
-&lt;/reverseEngineering&gt;        </programlisting>
+&lt;/dbimport&gt;        </programlisting>
         <para>
             The same options are available for catalogs:
         </para>
-        <programlisting language="xml"> &lt;reverseEngineering>
+        <programlisting language="xml"> &lt;dbimport>
     &lt;!-- Ant/Maven in case you only want to specify the catalog to import --&gt;
     &lt;catalog&gt;CATALOG_NAME&lt;/catalog&gt;
 
@@ -67,7 +67,7 @@
     &lt;catalog name="CATALOG_NAME"&gt;
         ...
     &lt;/catalog&gt;
-&lt;/reverseEngineering&gt;</programlisting>
+&lt;/dbimport&gt;</programlisting>
         <note>
             <para>Current version of reverse engineering doesn't support catalog filtering for Postgres database.</para>
         </note>
@@ -78,7 +78,7 @@
             Cayenne supports combination of different schemas and catalogs, and it filters data according to your requirements. 
             You could achieve this by the following example of reverse engineering configuration:
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
 
     &lt;catalog>
         &lt;name>shop_01&lt;/name>
@@ -99,7 +99,7 @@
         &lt;schema>schema-name-03&lt;/schema>
     &lt;/catalog>
 
-&lt;/reverseEngineering></programlisting>
+&lt;/dbimport></programlisting>
         <para>
             In the example above, Cayenne reverse engineering process contains three catalogs named as shop_01, shop_02 and shop_03, 
             each of wich has their own schemas. Cayenne will load all data only from the declared catalogs and schemas.
@@ -107,18 +107,18 @@
         <para>
             If you want to load everything from database, you could simply declare catalog specification alone.
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
 
     &lt;catalog>shop_01&lt;/catalog>
     &lt;catalog>shop_02&lt;/catalog>
     &lt;catalog>shop_03&lt;/catalog>
 
-&lt;/reverseEngineering></programlisting>
+&lt;/dbimport></programlisting>
         <para>
             If you want to do reverse engineering for specific schemas, just remove unwanted schemas from the catalog section. 
             For example, if you want to process schema-name-01 and schema-name-03 schemas only, then you should change reverse engineering section like this.
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
 
     &lt;catalog>
         &lt;name>shop_01&lt;/name>
@@ -137,7 +137,7 @@
         &lt;schema>schema-name-03&lt;/schema>
     &lt;/catalog>
 
-&lt;/reverseEngineering></programlisting>
+&lt;/dbimport></programlisting>
     </section>
     <section xml:id="including-excluding-tables-columns-procedures">
         <title>Including and Excluding tables, columns and procedures</title>
@@ -216,7 +216,7 @@
             </orderedlist>
         </para>
         <para>
-            All filtering tags can be placed inside schema and catalog tags, but also inside <code>&lt;reverseEngineering&gt;</code> tag. It means that filtering rules
+            All filtering tags can be placed inside schema and catalog tags, but also inside <code>&lt;dbimport&gt;</code> tag. It means that filtering rules
             will be applied for all schemas and catalogs.
         </para>
     </section>
@@ -225,20 +225,20 @@
         <para>
             Initially, let\u2019s make a small sample. Consider the following reverse engineering configuration.
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
     &lt;catalog>shop-01&lt;/catalog>
-&lt;/reverseEngineering>   </programlisting>
+&lt;/dbimport>   </programlisting>
         <para>
             In this case reverse engineering will not filter anything from the shop-01 catalog. If you really want to filter database columns, tables, 
             stored procedures and relationships, you could do it in the following way.
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
     &lt;catalog>shop-01&lt;/catalog>
     &lt;catalog>
         &lt;name>shop-02&lt;/name>
         &lt;includeTable>includeTable-01&lt;/includeTable>
     &lt;/catalog>
-&lt;/reverseEngineering></programlisting>
+&lt;/dbimport></programlisting>
         <para>
             Then Cayenne will do reverse engineering for both shop-01 and shop-02 catalogs. First catalog will not be processed for filtering,
             but the second catalog will be processed with \u201cincludeTable-01\u201d filter. 
@@ -249,7 +249,7 @@
             They make your configuration more readable, understandable and straightforward. There is not complex.
             Let\u2019s see how to use patterns in reverse engineering configuration with complete example.
         </para>
-        <programlisting language="xml">&lt;reverseEngineering>
+        <programlisting language="xml">&lt;dbimport>
 
     &lt;catalog>shop-01&lt;/catalog>
 
@@ -302,7 +302,7 @@
         &lt;/excludeProcedure>
 
     &lt;/catalog>
-&lt;/reverseEngineering></programlisting>
+&lt;/dbimport></programlisting>
         <para>The example above should provide you more idea about how to use filtering and patterns
             in Cayenne reverse engineering. You could notice that this example demonstrates you the
             "name" and "pattern" configurations. Yes, you could use these as separates xml element
@@ -349,7 +349,7 @@
         </para>
         <note>
             <para>
-                In Ant task configuration all filter tags located inside root tag <code>&lt;cdbimport></code> as there is no <code>&lt;reverseEngineering></code> tag.
+                In Ant task configuration all filter tags located inside root tag <code>&lt;cdbimport></code> as there is no <code>&lt;dbimport></code> tag.
             </para>
         </note>
     </section>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/docbkx/re-introduction.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/re-introduction.xml b/docs/docbook/cayenne-guide/src/docbkx/re-introduction.xml
index f65bc52..37609ac 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/re-introduction.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/re-introduction.xml
@@ -54,24 +54,26 @@
     </section>
 	<section xml:id="re-configuration-file">
 		<title>Introduction to "cdbimport"</title>
-		<para>Here is a simple Maven configuration of "cdbimport" (for details see <link linkend="mvn-cdbimport">maven-cayenne-plugin</link> documentation)</para>
+		<para>Here is a simple Maven configuration of "cdbimport" (for details see <link linkend="mvn-cdbimport">cayenne-maven-plugin</link> documentation)</para>
 		<para>
 			<programlisting language="xml">
 	&lt;plugin&gt;
 		&lt;groupId&gt;org.apache.cayenne.plugins&lt;/groupId&gt;
-		&lt;artifactId&gt;maven-cayenne-plugin&lt;/artifactId&gt;
+		&lt;artifactId&gt;cayenne-maven-plugin&lt;/artifactId&gt;
 		&lt;version&gt;<?eval ${project.version}?>&lt;/version&gt;
 
 		&lt;configuration&gt;
 			&lt;map>${project.basedir}/src/main/resources/datamap.map.xml&lt;/map>
-			&lt;url>&lt;!-- jdbc url -->&lt;/url&gt;
-			&lt;driver>&lt;!-- jdbc driver class --&gt;&lt;/driver&gt;
-			&lt;username>username&lt;/username>
-			&lt;password&gt;password&lt;/password&gt;
-			&lt;defaultPackage&gt;com.example.package&lt;/defaultPackage&gt;
-			&lt;reverseEngineering&gt;
+			&lt;dataSource>
+				&lt;url>&lt;!-- jdbc url -->&lt;/url&gt;
+				&lt;driver>&lt;!-- jdbc driver class --&gt;&lt;/driver&gt;
+				&lt;username>username&lt;/username>
+				&lt;password&gt;password&lt;/password&gt;
+			&lt;/dataSource>
+			&lt;dbimport&gt;
+				&lt;defaultPackage&gt;com.example.package&lt;/defaultPackage&gt;
 			    &lt;includeTable>.*&lt;/includeTable>
-			&lt;/reverseEngineering&gt;
+			&lt;/dbimport&gt;
 		&lt;/configuration&gt;
 		&lt;dependencies&gt;
 			&lt;!-- jdbc driver dependency --&gt;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/docbkx/re-modeler.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/re-modeler.xml b/docs/docbook/cayenne-guide/src/docbkx/re-modeler.xml
index b1c0eda..1347658 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/re-modeler.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/re-modeler.xml
@@ -105,6 +105,17 @@
                         By default no meaningful PKs are created.
                     </para>
                 </listitem>
+                <listitem>
+                    <para><emphasis role="strong">Use Java primitive types</emphasis>:
+                        Use primitive types (e.g. <code>int</code>) or Object types (e.g. <code>java.lang.Integer</code>).
+                    </para>
+                </listitem>
+                <listitem>
+                    <para><emphasis role="strong">Use old java.util.Date type</emphasis>:
+                        Use <code>java.util.Date</code> for all columns with <code>DATE/TIME/TIMESTAMP</code> types.
+                        By default <code>java.time.*</code> types will be used.
+                    </para>
+                </listitem>
             </itemizedlist>
         </para>
     </section>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/docbkx/re-other-settings.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/docbkx/re-other-settings.xml b/docs/docbook/cayenne-guide/src/docbkx/re-other-settings.xml
index 3463984..29d0c22 100644
--- a/docs/docbook/cayenne-guide/src/docbkx/re-other-settings.xml
+++ b/docs/docbook/cayenne-guide/src/docbkx/re-other-settings.xml
@@ -28,9 +28,9 @@
             You are able to skip relationships loading by the <code language="xml">&lt;skipRelationshipsLoading&gt;</code> element.
         </para>
         <programlisting language="xml">
-    &lt;reverseEngineering&gt;
+    &lt;dbimport&gt;
         &lt;skipRelationshipsLoading&gt;true&lt;/skipRelationshipsLoading&gt;
-    &lt;/reverseEngineering&gt;</programlisting>
+    &lt;/dbimport&gt;</programlisting>
     </section>
     <section xml:id="skip-pk-loading">
         <title>Skip Primary Keys Loading</title>
@@ -39,9 +39,9 @@
             and avoid their management in database, you\u2019ll find useful to turn off primary keys synchronization at all.
         </para>
         <programlisting language="xml">
-    &lt;reverseEngineering&gt;
+    &lt;dbimport&gt;
         &lt;skipPrimaryKeyLoading&gt;true&lt;/skipPrimaryKeyLoading&gt;
-    &lt;/reverseEngineering&gt;</programlisting>
+    &lt;/dbimport&gt;</programlisting>
     </section>
     <section>
         <title>Table Types</title>
@@ -51,15 +51,15 @@
                 >&lt;tableType&gt;&lt;/tableType&gt;</code> element is used. Some examples:</para>
         <para> Import tables only (skip views and others and other
             types):<programlisting language="xml">
-    &lt;reverseEngineering&gt;
+    &lt;dbimport&gt;
         &lt;tableType&gt;TABLE&lt;/tableType&gt;
-    &lt;/reverseEngineering&gt;</programlisting>
+    &lt;/dbimport&gt;</programlisting>
         </para>
         <para> Tables and views (<emphasis>the default
             option</emphasis>):<programlisting language="xml">
-    &lt;reverseEngineering&gt;
+    &lt;dbimport&gt;
         &lt;tableType&gt;TABLE&lt;/tableType&gt;
         &lt;tableType&gt;VIEWS&lt;/tableType&gt;
-    &lt;/reverseEngineering&gt;</programlisting></para>
+    &lt;/dbimport&gt;</programlisting></para>
     </section>
 </chapter>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/cayenne-guide/src/images/re-modeler-reverseengineering-dialog.png
----------------------------------------------------------------------
diff --git a/docs/docbook/cayenne-guide/src/images/re-modeler-reverseengineering-dialog.png b/docs/docbook/cayenne-guide/src/images/re-modeler-reverseengineering-dialog.png
index bea9c78..8b09d07 100644
Binary files a/docs/docbook/cayenne-guide/src/images/re-modeler-reverseengineering-dialog.png and b/docs/docbook/cayenne-guide/src/images/re-modeler-reverseengineering-dialog.png differ

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ce3ea429/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/upgrade-guide/src/docbkx/new-features.xml b/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
index 176158c..1ae6b9a 100644
--- a/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
+++ b/docs/docbook/upgrade-guide/src/docbkx/new-features.xml
@@ -14,7 +14,9 @@
     the specific language governing permissions and limitations under the
     License.
 -->
-<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
+		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd">
 	<title>Guide to 4.0 Features</title>
 	<para>This guide highlights the new features and changes introduced in Apache Cayenne 4.0. For a full list of changes consult
 		RELEASE-NOTES.txt included in Cayenne download. For release-specific upgrade instructions check UPGRADE.txt.</para>
@@ -31,7 +33,7 @@
 			<para>Cayenne 3.1 introduced dependency injection and ServerRuntime. 4.0 provides a very convenient utility to create a custom runtime
 				with various extensions. This reduces the code needed to integrate Cayenne in your environment to just a few lines and no
 				boilerplate.
-				E.g.:<programlisting>ServerRuntime runtime = new ServerRuntimeBuilder("myproject")
+				E.g.:<programlisting language="java">ServerRuntime runtime = new ServerRuntimeBuilder("myproject")
         .addConfigs("cayenne-project1.xml", "cayenne-project2.xml")
         .addModule(binder -> binder.bind(JdbcEventLogger.class).toInstance(myLogger))
         .dataSource(myDataSource)
@@ -48,7 +50,7 @@
 				decorators. True to the "smallest-footprint" DI philosophy, decorator approach is
 				very simple and does not require proxies or class enhancement. Just implement the
 				decorated interface and provide a constructor that takes a delegate instance being
-				decorated:<programlisting>public class MyInterfaceDecorator implements MyInterface {
+				decorated:<programlisting language="java">public class MyInterfaceDecorator implements MyInterface {
 
     private MyInterface delegate;
 
@@ -80,7 +82,7 @@ Module module = new Module() {
 			<section>
 				<title>ObjectSelect</title>
 				<para>A "chainable" analog of SelectQuery.
-					<programlisting>Artist a = ObjectSelect
+					<programlisting language="java">Artist a = ObjectSelect
      .query(Artist.class)
      .where(Artist.ARTIST_NAME.eq("Picasso"))
      .selectOne(context);</programlisting></para>
@@ -88,7 +90,7 @@ Module module = new Module() {
 			<section>
 				<title>SQLSelect</title>
 				<para>A "chainable" analog of SQLTemplate used specifically to run selecting raw
-					SQL:<programlisting>List&lt;Long> ids = SQLSelect
+					SQL:<programlisting language="java">List&lt;Long> ids = SQLSelect
      .scalarQuery(Long.class, "SELECT ARTIST_ID FROM ARTIST ORDER BY ARTIST_ID")
      .select(context);</programlisting></para>
 			</section>
@@ -96,7 +98,7 @@ Module module = new Module() {
 				<title>SelectById</title>
 				<para>There's really no good analog of SelectById in Cayenne prior to 4.0. Previously available ObjectIdQuery didn't support half of
 					the features of SelectById (e.g. caching consistent with other queries, prefetches, etc.)
-					:<programlisting>Artist a = SelectById
+					:<programlisting language="java">Artist a = SelectById
      .query(Artist.class, 3)
      .useLocalCache("g1")
      .selectOne(context)</programlisting></para>
@@ -108,7 +110,7 @@ Module module = new Module() {
 				<title>Callback-based Object Iterator</title>
 				<para>ObjectContext now features a simpler way to iterate over large result sets, based on callback interface that can be
 					implemented with a
-					lambda:<programlisting>SelectQuery&lt;Artist> q = new SelectQuery&lt;Artist>(Artist.class);
+					lambda:<programlisting language="java">SelectQuery&lt;Artist> q = new SelectQuery&lt;Artist>(Artist.class);
 
 context.iterate(q, (Artist a) -> {
     // do something with the object...
@@ -131,7 +133,7 @@ context.iterate(q, (Artist a) -> {
 			<para>Expressions and SQLTemplate traditionally supported binding of parameters by name as a map. Cayenne 4.0 introduces a very easy
 				form of positional bindings. It works with the same named template format, only parameters are bound by position, left-to-right.
 				Here we showing a more complex example with the same parameter name being used more than once in the
-				query:<programlisting>// two distinct names, 3 positional parameters.
+				query:<programlisting language="java">// two distinct names, 3 positional parameters.
 // "price" is set to 23, "maxPrice" - to 50
 Expression e = ExpressionFactory.exp(
      "price = $price or averagePrice = $price and maxPrice = $maxPrice", 23, 50);</programlisting>This
@@ -142,7 +144,7 @@ Expression e = ExpressionFactory.exp(
 			<title>Improved Transaction API</title>
 			<para>Transaction factory is now setup via DI (instead of being configured in the Modeler). There's a utility method on ServerRuntime
 				to perform multiple operations as one
-				transaction:<programlisting>runtime.performInTransaction(() -> {
+				transaction:<programlisting language="java">runtime.performInTransaction(() -> {
 	// ... do some changes
 	context.commitChanges();
 
@@ -159,7 +161,7 @@ Expression e = ExpressionFactory.exp(
 				regular DB storage. Encrypted values can be stored in (VAR)BINARY and (VAR)CHAR columns. Currently "cayenne-crypto" supports
 				AES/CBC/PKCS5Padding encryption (though other cyphers can be added). It also supports encrypted data compression. Here is an example
 				of building a crypto DI module that can be added to
-				ServerRuntime:<programlisting>Module cryptoExtensions = new CryptoModuleBuilder()
+				ServerRuntime:<programlisting language="java">Module cryptoExtensions = new CryptoModuleBuilder()
 	.keyStore("file:///mykeystore", "keystorepassword".toCharArray(), "keyalias")
 	.compress()
 	.build();</programlisting></para>
@@ -176,8 +178,8 @@ Expression e = ExpressionFactory.exp(
 			<title>Dropped Support for Mapping Listeners</title>
 			<para>Managing listeners in the DataMap XML model is counterproductive and confusing, so support for listeners was removed from both
 				the XML and the Modeler. If you previously had listeners mapped in the model, annotate their callback methods, and perform listener
-				registration in the code: <programlisting>runtime.getDataDomain().addListener(myListener);</programlisting>Entity callbacks on the
-				other hand are managed in the Modeler as before.</para>
+				registration in the code: <programlisting language="java">runtime.getDataDomain().addListener(myListener);</programlisting>
+				Entity callbacks on the other hand are managed in the Modeler as before.</para>
 		</section>
 	</section>
 	<section xml:id="build-tools">
@@ -189,7 +191,8 @@ Expression e = ExpressionFactory.exp(
 				merge algorithm will ensure that custom changes to the model are not overridden on subsequent runs of "cdbimport". Second, the
 				mechanism for specifing DB reverse-engineering parameters, such as name filtering, is made much more powerful with many new options.
 				E.g. we started supporting filters by catalogs and schemas, table name filters can be added per catalog/schema or at the top level,
-				etc. Also configuration can be "inlined" in a Maven pom.xml or specified as a separate file.</para>
+				etc.
+			</para>
 		</section>
 		<section>
 			<title>cgen</title>