Repository: cayenne Updated Branches: refs/heads/master 8d6629622 -> c04fa437a
Upgrade docs Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/85b879bf Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/85b879bf Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/85b879bf Branch: refs/heads/master Commit: 85b879bf983320bdf2fa8671b25a00059198b55a Parents: 69b731b Author: Arseni Bulatski <ancars...@gmail.com> Authored: Thu Aug 23 16:04:06 2018 +0300 Committer: Arseni Bulatski <ancars...@gmail.com> Committed: Thu Aug 23 16:04:06 2018 +0300 ---------------------------------------------------------------------- .../_cayenne-guide/part2/including.adoc | 4 ++ .../_cayenne-guide/part2/objectContext.adoc | 9 ++++ .../_cayenne-guide/part4/filtering.adoc | 22 ++++++++- .../_cayenne-guide/part4/introduction.adoc | 41 ++++++++-------- .../_cayenne-guide/part4/revEngineering.adoc | 47 ++++++++++++------- .../src/docs/asciidoc/_cayenne-guide/part5.adoc | 10 ++-- .../_cayenne-guide/part5/cayenneOsgi.adoc | 43 +++++++++++++++++ .../_cayenne-guide/part5/cayenneRopServer.adoc | 43 +++++++++++++++++ .../_cayenne-guide/part5/cayenneWeb.adoc | 43 +++++++++++++++++ .../asciidoc/_cayenne-guide/part5/jodaTime.adoc | 47 ------------------- .../re-modeler-reverseengineering-dialog.png | Bin 37668 -> 52923 bytes .../_getting-started-db-first/part1-setup.adoc | 2 +- .../part2-rr-setup.adoc | 15 +++++- .../_getting-started-db-first/part2.adoc | 2 - .../part4-java-classes.adoc | 7 --- .../part2/hessianWebServ.adoc | 9 +++- 16 files changed, 242 insertions(+), 102 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/including.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/including.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/including.adoc index dcda5bb..daa0050 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/including.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/including.adoc @@ -142,6 +142,10 @@ ${project.basedir}/src/main/resources/my.map.xml .^|createPropertyNames .^|boolean .^|If set to "true", will generate String Property names. Default is "false" + +.^|force +.^|boolean +.^|If set to "true", will force run from maven/gradle. |=== Example - a typical class generation scenario, where pairs of classes are generated with default Maven source destination and superclass package: http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/objectContext.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/objectContext.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/objectContext.adoc index 5ee0fdc..02f1855 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/objectContext.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part2/objectContext.adoc @@ -347,4 +347,13 @@ Transaction tx = BaseTransaction.getThreadTransaction(); tx.addConnection("mydatanode", myConnection); ---- +You can control transaction isolation level and propagation logic using TransactionDescriptor. +[source, java] +---- +TransactionDescriptor descriptor = new TransactionDescriptor( + Connection.TRANSACTION_SERIALIZABLE, + TransactionPropagation.REQUIRES_NEW + ); +transactionManager.performInTransaction(transactionalOperation, descriptor); +---- http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/filtering.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/filtering.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/filtering.adoc index 58a2a16..2da1181 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/filtering.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/filtering.adoc @@ -138,7 +138,7 @@ If you want to do reverse engineering for specific schemas, just remove unwanted </dbimport> ---- -==== Including and Excluding tables, columns and procedures +==== Including and Excluding tables, columns, procedures and relationships Cayenne reverse engineering let you fine tune table, columns and stored procedures names that you need to import to your model file. In every filter you can use regexp syntax. Here is some examples of configuration for common tasks. @@ -212,7 +212,16 @@ Cayenne reverse engineering let you fine tune table, columns and stored procedur </excludeProcedure> ---- -All filtering tags `<includeTable>`, `<excludeTable>`, `<includeColumn>`, `<excludeColumn>`, `<includeProcedure>` and `<excludeProcedure>` have 2 ways to pass filtering RegExp. +9) Exclude relationships: +[source, XML] +---- +<excludeRelationship>excludeRelationship01</excludeRelationship> +<excludeRelationship> + <pattern>excludeRelationship03</pattern> +</excludeRelationship> +---- + +All filtering tags `<includeTable>`, `<excludeTable>`, `<includeColumn>`, `<excludeColumn>`, `<includeProcedure>`, `<excludeProcedure>` and `<excludeRelationship>` have 2 ways to pass filtering RegExp. 1) text inside tag @@ -314,6 +323,12 @@ Letâs assume you have a lot of table prefixes with the same names. Cayenne all <pattern>excludeProcedure-02</pattern> </excludeProcedure> + <excludeRelationship>excludeRelationship-01</excludeRelationship> + + <excludeRelationship> + <pattern>excludeRelationship-02</pattern> + </excludeRelationship> + </catalog> </dbimport> ---- @@ -358,6 +373,9 @@ Here is config sample for `Ant` task: <excludeProcedure>excludeProcedure-01</excludeProcedure> <excludeProcedure pattern="excludeProcedure-02"/> + <excludeRelationship>excludeRelationship-01</excludeRelationship> + <excludeRelationship pattern="excludeRelationship-02"/> + </catalog> ---- http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/introduction.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/introduction.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/introduction.adoc index 262f562..209156c 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/introduction.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/introduction.adoc @@ -40,26 +40,27 @@ Here is a simple Maven configuration of "cdbimport" (for details see xref:mavenC [source, XML,subs="verbatim,attributes"] ---- <plugin> - <groupId>org.apache.cayenne.plugins</groupId> - <artifactId>cayenne-maven-plugin</artifactId> - <version>{version}</version> - - <configuration> - <map>${project.basedir}/src/main/resources/datamap.map.xml</map> - <dataSource> - <url><!-- jdbc url --></url> - <driver><!-- jdbc driver class --></driver> - <username>username</username> - <password>password</password> - </dataSource> - <dbimport> - <defaultPackage>com.example.package</defaultPackage> - <includeTable>.*</includeTable> - </dbimport> - </configuration> - <dependencies> - <!-- jdbc driver dependency --> - </dependencies> + <groupId>org.apache.cayenne.plugins</groupId> + <artifactId>cayenne-maven-plugin</artifactId> + <version>{version}</version> + + <configuration> + <cayenneProject>${project.basedir}/src/main/resources/cayenne/cayenne-project.xml</cayenneProject> + <map>${project.basedir}/src/main/resources/datamap.map.xml</map> + <dataSource> + <url><!-- jdbc url --></url> + <driver><!-- jdbc driver class --></driver> + <username>username</username> + <password>password</password> + </dataSource> + <dbimport> + <defaultPackage>com.example.package</defaultPackage> + <includeTable>.*</includeTable> + </dbimport> + </configuration> + <dependencies> + <!-- jdbc driver dependency --> + </dependencies> </plugin> ---- In the next chapters we will discuss various filtering and other reverse-engineering options. http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/revEngineering.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/revEngineering.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/revEngineering.adoc index cdd71a7..ebce425 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/revEngineering.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part4/revEngineering.adoc @@ -17,41 +17,56 @@ Alternative aproach to using <<cdbimport>> is doing reverse engineering from <<CayenneModeler Application, CayenneModeler>>. Currently modeler GUI doesn't support all features of ant/maven tasks but it suffice for general DB import. Especially it's a good place to quickly start working on your data model. -You can find reverse engineering tool in main modeler menu *Tools > Reengineer Database Schema* - -==== DataSource selection - -First you should select DataSource. If you don't have any DataSource yet you can create one from this menu. - -image::../images/re-modeler-datasource-select.png[align="center"] - -Datasource selection dialog. +You can find reverse engineering tool in dataMap view on *DbImport Tab*. ==== Reverse engineering options -Once DataSource is selected you can proceed to reverse engineering options. - image::../images/re-modeler-reverseengineering-dialog.png[align="center"] Reverse Engineering dialog. Here is a list of options to tune what will be processed by reverse engineering: -- *Select Catalog*: catalog to process +- *Add Catalog* + +- *Add Schema* + +- *Add Include Table* + +- *Add Exclude Table* -NOTE: You can only select one catalog. If you need to import multiple catalogs you need to run process several times. +- *Add Include Column* -- *Table Name Pattern*: RegExp to filter tables. Default pattern .* includes all tables. +- *Add Exclude Column* -- *Procedure Name Pattern*: RegExp to filter procedures. Default pattern .* includes all stored procedures. +- *Add Include Procedure* -- *Naming Strategy*: Currently there is only one naming strategy available. See ant/maven tools <<namingStrategy, documentation>> for details about naming strategy. +- *Add Exclude Procedure* - *Tables with Meaningful PK Pattern*: Comma separated list of RegExp's for tables that you want to have meaningful primary keys. By default no meaningful PKs are created. +- *Strip from table names*: Regex that matches the part of the table name that needs to be stripped off generating ObjEntity name. + +- *Skip relationships loading*: Whether to load relationships. + +- *Skip primary key loading*: Whether to load primary keys. + +- *Force datamap catalog*: will set DbEntity catalog to one in the DataMap. + +- *Force datamap schema*: will set DbEntity schema to one in the DataMap. + - *Use Java primitive types*: Use primitive types (e.g. *int*) or Object types (e.g. *java.lang.Integer*). - *Use old java.util.Date type*: Use *java.util.Date* for all columns with *DATE/TIME/TIMESTAMP* types. By default *java.time.* types will be used. +==== DataSource selection + +Then you click `Run Import` or `Configure Connection` to set DataSource. +If you don't have any DataSource yet you can create one from this menu. + +image::../images/re-modeler-datasource-select.png[align="center"] + +Datasource selection dialog. +Then click `continue` to start dbImport. http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5.adoc index 2003dc5..ef30145 100644 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5.adoc +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5.adoc @@ -22,8 +22,12 @@ include::part5/crypto.adoc[] include::part5/jCache.adoc[] -include::part5/jodaTime.adoc[] - include::part5/projectCompatibility.adoc[] -include::part5/apacheVelocity.adoc[] \ No newline at end of file +include::part5/apacheVelocity.adoc[] + +include::part5/cayenneWeb.adoc[] + +include::part5/cayenneOsgi.adoc[] + +include::part5/cayenneRopServer.adoc[] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneOsgi.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneOsgi.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneOsgi.adoc new file mode 100644 index 0000000..0d0d74d --- /dev/null +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneOsgi.adoc @@ -0,0 +1,43 @@ +// 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. + +include::../var.adoc[] + +=== Cayenne OSGI extension + +==== Description + +This module helps to bootstrap Cayenne in OSGi environment. + +==== Including in a project + +===== Maven + +[source, XML,subs="verbatim,attributes"] +---- +<dependency> + <groupId>org.apache.cayenne</groupId> + <artifactId>cayenne-osgi</artifactId> + <version>{version}</version> +</dependency> +---- + +===== Gradle + +[source, Groovy,subs="verbatim,attributes"] +---- +compile 'org.apache.cayenne:cayenne-osgi:{version}' +---- + + http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneRopServer.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneRopServer.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneRopServer.adoc new file mode 100644 index 0000000..ab943f4 --- /dev/null +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneRopServer.adoc @@ -0,0 +1,43 @@ +// 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. + +include::../var.adoc[] + +=== Cayenne Rop Server extension + +==== Description + +The goal of this module is to create services for the server-side of an ROP application based on Caucho Hessian. + +==== Including in a project + +===== Maven + +[source, XML,subs="verbatim,attributes"] +---- +<dependency> + <groupId>org.apache.cayenne</groupId> + <artifactId>cayenne-rop-server</artifactId> + <version>{version}</version> +</dependency> +---- + +===== Gradle + +[source, Groovy,subs="verbatim,attributes"] +---- +compile 'org.apache.cayenne:cayenne-rop-server:{version}' +---- + + http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneWeb.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneWeb.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneWeb.adoc new file mode 100644 index 0000000..87c7f0d --- /dev/null +++ b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/cayenneWeb.adoc @@ -0,0 +1,43 @@ +// 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. + +include::../var.adoc[] + +=== Cayenne Web extension + +==== Description + +The goal of this module is to create web application with Cayenne service in it. + +==== Including in a project + +===== Maven + +[source, XML,subs="verbatim,attributes"] +---- +<dependency> + <groupId>org.apache.cayenne</groupId> + <artifactId>cayenne-web</artifactId> + <version>{version}</version> +</dependency> +---- + +===== Gradle + +[source, Groovy,subs="verbatim,attributes"] +---- +compile 'org.apache.cayenne:cayenne-web:{version}' +---- + + http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/jodaTime.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/jodaTime.adoc b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/jodaTime.adoc deleted file mode 100644 index f217887..0000000 --- a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/_cayenne-guide/part5/jodaTime.adoc +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -include::../var.adoc[] - -[[ext-joda]] -=== Joda time extension - -==== Description - -Joda time module allows to use `org.joda.time.LocalTime`, `org.joda.time.LocalDate`, `org.joda.time.LocalDateTime` and `org.joda.time.DateTime` types for entity attributes. - -==== Including in a project - -===== Maven - -[source, XML,subs="verbatim,attributes"] ----- -<dependency> - <groupId>org.apache.cayenne</groupId> - <artifactId>cayenne-joda</artifactId> - <version>{version}</version> -</dependency> ----- - -===== Gradle - -[source, Groovy,subs="verbatim,attributes"] ----- -compile 'org.apache.cayenne:cayenne-joda:{version}' ----- - -==== Usage - -This module doesn't require any additional setup, you can just use new data types in your model. - http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/cayenne-guide/src/docs/asciidoc/images/re-modeler-reverseengineering-dialog.png ---------------------------------------------------------------------- diff --git a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/images/re-modeler-reverseengineering-dialog.png b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/images/re-modeler-reverseengineering-dialog.png index 8b09d07..ba6c89d 100644 Binary files a/docs/asciidoc/cayenne-guide/src/docs/asciidoc/images/re-modeler-reverseengineering-dialog.png and b/docs/asciidoc/cayenne-guide/src/docs/asciidoc/images/re-modeler-reverseengineering-dialog.png differ http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part1-setup.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part1-setup.adoc b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part1-setup.adoc index 6a5bf9d..59a5862 100644 --- a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part1-setup.adoc +++ b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part1-setup.adoc @@ -19,7 +19,7 @@ This chapter lists the recommended software used in the tutorial. ==== Java -Cayenne 4.0 requires JDK 1.7 or newer. +Cayenne 4.1 requires JDK 1.8 or newer. ==== IntelliJ IDEA IDE http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2-rr-setup.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2-rr-setup.adoc b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2-rr-setup.adoc index baaf44c..5f8455c 100644 --- a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2-rr-setup.adoc +++ b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2-rr-setup.adoc @@ -42,12 +42,23 @@ So let's begin, here is sample settings for the data source: NOTE: Don't forget to set your actual MySQL login and password -We have told plugin where it should load data from, now let's set where it should store Cayenne model: +We have told plugin where cayenne-project.xml will be located. [source,xml] ---- <configuration> ... </dataSource> + <cayenneProject>${project.basedir}/src/main/resources/cayenne/cayenne-project.xml</cayenneProject> +---- +- Without cayenneProject option you should create project file manually via Cayenne Modeler. +- If cayenneProject is set but no file exists it will be created and DataMap linked to it. +- If cayenneProject is and file already exists then DataMap should be linked to it (if it is new) or update existing one. + +We have told plugin where it should load data from, now let's set where it should store Cayenne model: +[source,xml] +---- +<configuration> + ...</cayenneProject> <map>${project.basedir}/src/main/resources/datamap.map.xml</map> ---- @@ -101,6 +112,6 @@ You can open created `datamap.map.xml` file and check it's content in IDEA: image::tutorial-new-datamap.png[align="center"] -Great! We now have Cayenne DataMap file that describe model from our database. +Great! We now have Cayenne DataMap file that describe model from our database and cayenne-project.xml file. NOTE: If you have some problems with configuration you can always delete `datamap.map.xml` file and try again. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2.adoc b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2.adoc index c2067ae..50e6232 100644 --- a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2.adoc +++ b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part2.adoc @@ -14,5 +14,3 @@ == Importing database include::part2-rr-setup.adoc[] - -include::part2-project-setup.adoc[] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part4-java-classes.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part4-java-classes.adoc b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part4-java-classes.adoc index e84cf3e..bde231d 100644 --- a/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part4-java-classes.adoc +++ b/docs/asciidoc/getting-started-db-first/src/docs/asciidoc/_getting-started-db-first/part4-java-classes.adoc @@ -50,16 +50,9 @@ Note that Cayenne code is unrecognized, that's because we need to include Cayenn <artifactId>cayenne-server</artifactId> <version>${cayenne.version}</version> </dependency> - <dependency> - <groupId>org.apache.cayenne</groupId> - <artifactId>cayenne-java8</artifactId> - <version>${cayenne.version}</version> - </dependency> </dependencies> ---- -NOTE: `cayenne-java8` module required to support Java 8 date/time types. - Additionally we need to tell `Maven compiler plugin` that our code uses Java 8: [source,xml] ---- http://git-wip-us.apache.org/repos/asf/cayenne/blob/85b879bf/docs/asciidoc/getting-started-rop/src/docs/asciidoc/_getting-started-rop/part2/hessianWebServ.adoc ---------------------------------------------------------------------- diff --git a/docs/asciidoc/getting-started-rop/src/docs/asciidoc/_getting-started-rop/part2/hessianWebServ.adoc b/docs/asciidoc/getting-started-rop/src/docs/asciidoc/_getting-started-rop/part2/hessianWebServ.adoc index cf83e3a..46fb2ba 100644 --- a/docs/asciidoc/getting-started-rop/src/docs/asciidoc/_getting-started-rop/part2/hessianWebServ.adoc +++ b/docs/asciidoc/getting-started-rop/src/docs/asciidoc/_getting-started-rop/part2/hessianWebServ.adoc @@ -17,8 +17,7 @@ ==== Setting up Dependencies Now lets get back to the "tutorial" project that contains a web application and set up dependencies. -The only extra one that we don't have yet is `resin-hessian.jar`, just like the client, so let's add it -(and the caucho repo declaration) to the `pom.xml`. +Let's add `resin-hessian.jar` (and the caucho repo declaration) and `cayenne-rop-server` to the `pom.xml` [source, XML] ---- @@ -28,6 +27,12 @@ The only extra one that we don't have yet is `resin-hessian.jar`, just like the <dependencies> ... <dependency> + <groupId>org.apache.cayenne</groupId> + <artifactId>cayenne-rop-server</artifactId> + <!-- Here specify the version of Cayenne you are actually using --> + <version>{version}</version> + </dependency> + <dependency> <groupId>com.caucho</groupId> <artifactId>hessian</artifactId> <version>4.0.38</version>