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 2018/10/11 13:37:00 UTC
cayenne-website git commit: Udpate 4.1 docs
Repository: cayenne-website
Updated Branches:
refs/heads/asf-site 0f8aea157 -> ddd3290e9
Udpate 4.1 docs
Project: http://git-wip-us.apache.org/repos/asf/cayenne-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne-website/commit/ddd3290e
Tree: http://git-wip-us.apache.org/repos/asf/cayenne-website/tree/ddd3290e
Diff: http://git-wip-us.apache.org/repos/asf/cayenne-website/diff/ddd3290e
Branch: refs/heads/asf-site
Commit: ddd3290e9e2c25dc7ecb20bc6904b18093a779c7
Parents: 0f8aea1
Author: Nikita Timofeev <st...@gmail.com>
Authored: Thu Oct 11 16:36:57 2018 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Thu Oct 11 16:36:57 2018 +0300
----------------------------------------------------------------------
docs/4.1/cayenne-guide/index.html | 53 +++++++++++++++
docs/4.1/getting-started-db-first/index.html | 82 +++++++++++------------
2 files changed, 94 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cayenne-website/blob/ddd3290e/docs/4.1/cayenne-guide/index.html
----------------------------------------------------------------------
diff --git a/docs/4.1/cayenne-guide/index.html b/docs/4.1/cayenne-guide/index.html
index 81139f7..57c16a1 100644
--- a/docs/4.1/cayenne-guide/index.html
+++ b/docs/4.1/cayenne-guide/index.html
@@ -5262,6 +5262,27 @@ public class MyEntity extends _MyEntity {
<div class="paragraph">
<p>For advanced configuration and management please use provider specific options and tools.</p>
</div>
+ <div class="paragraph">
+ <p>JCache module supports custom configuration files for cache managers.</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="highlight"><code class="language-java java" data-lang="java">ServerRuntime.builder()
+ .addModule(binder ->
+ JCacheModule
+ .contributeJCacheProviderConfig(binder, "cache-config.xml"));</code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>Also JCache module supports contribution of preconfigured cache manager.</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="highlight"><code class="language-java java" data-lang="java">ServerRuntime.builder()
+ .addModule(binder ->
+ binder.bind(CacheManager.class).toInstance(customCacheManager));</code></pre>
+ </div>
+ </div>
<div class="admonitionblock note">
<table>
<tbody>
@@ -5275,6 +5296,38 @@ public class MyEntity extends _MyEntity {
<div class="paragraph">
<p>You may else be interested in <a href="#ext-cache-invalidation">Cache invalidation extension</a>.</p>
</div>
+ <div class="sect4">
+ <h5 id="ehcache-setup-example"><a class="anchor" href="#ehcache-setup-example"></a>Ehcache setup example</h5>
+ <div class="paragraph">
+ <p>Here is an example of using <code>ehcache</code> as cache manager.</p>
+ </div>
+ <div class="paragraph">
+ <p>First you need to include <code>ehcache</code> dependency:</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="highlight"><code class="language-XML XML" data-lang="XML"><dependency>
+ <groupId>org.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ <version>{ehcache-version}</version>
+</dependency></code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>If you need custom configuration you can contribute configuration file to JCache module:</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="highlight"><code class="language-java java" data-lang="java">ServerRuntime.builder()
+ .addModule(binder ->
+ JCacheModule
+ .contributeJCacheProviderConfig(binder, "file:/ehcache.xml"));</code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>As a result you will have <code>ehcache</code> manager as your default cache manager.</p>
+ </div>
+ </div>
</div>
</div>
<div class="sect2">
http://git-wip-us.apache.org/repos/asf/cayenne-website/blob/ddd3290e/docs/4.1/getting-started-db-first/index.html
----------------------------------------------------------------------
diff --git a/docs/4.1/getting-started-db-first/index.html b/docs/4.1/getting-started-db-first/index.html
index 80322a7..e99beb0 100644
--- a/docs/4.1/getting-started-db-first/index.html
+++ b/docs/4.1/getting-started-db-first/index.html
@@ -223,11 +223,11 @@
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-sql sql" data-lang="sql">CREATE SCHEMA IF NOT EXISTS cayenne_demo; USE cayenne_demo;
-CREATE TABLE ARTIST (DATE_OF_BIRTH DATE NULL, ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
-CREATE TABLE GALLERY (ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
-CREATE TABLE PAINTING (ARTIST_ID INT NULL, GALLERY_ID INT NULL, ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
-ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID) ON DELETE CASCADE;
-ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID) ON DELETE CASCADE;</code></pre>
+CREATE TABLE artist (DATE_OF_BIRTH DATE NULL, ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
+CREATE TABLE gallery (ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
+CREATE TABLE painting (ARTIST_ID INT NULL, GALLERY_ID INT NULL, ID INT NOT NULL AUTO_INCREMENT, NAME VARCHAR(200) NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
+ALTER TABLE painting ADD FOREIGN KEY (ARTIST_ID) REFERENCES artist (ID) ON DELETE CASCADE;
+ALTER TABLE painting ADD FOREIGN KEY (GALLERY_ID) REFERENCES gallery (ID) ON DELETE CASCADE;</code></pre>
</div>
</div>
<div class="paragraph">
@@ -380,25 +380,25 @@ ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID) ON DEL
<pre>...
[INFO] +++ Connecting: SUCCESS.
[INFO] Detected and installed adapter: org.apache.cayenne.dba.mysql.MySQLAdapter
-[INFO] Table: cayenne_demo.ARTIST
-[INFO] Table: cayenne_demo.GALLERY
-[INFO] Table: cayenne_demo.PAINTING
-[INFO] Db Relationship : toOne (PAINTING.GALLERY_ID, GALLERY.ID)
-[INFO] Db Relationship : toMany (GALLERY.ID, PAINTING.GALLERY_ID)
-[INFO] Db Relationship : toOne (PAINTING.ARTIST_ID, ARTIST.ID)
-[INFO] Db Relationship : toMany (ARTIST.ID, PAINTING.ARTIST_ID)
+[INFO] Table: cayenne_demo.artist
+[INFO] Table: cayenne_demo.gallery
+[INFO] Table: cayenne_demo.painting
+[INFO] Db Relationship : toOne (painting.GALLERY_ID, gallery.ID)
+[INFO] Db Relationship : toMany (gallery.ID, painting.GALLERY_ID)
+[INFO] Db Relationship : toOne (painting.ARTIST_ID, artist.ID)
+[INFO] Db Relationship : toMany (artist.ID, painting.ARTIST_ID)
[INFO]
[INFO] Map file does not exist. Loaded db model will be saved into '~/work/cayenne/db-first-tutorial/src/main/resources/datamap.map.xml'
[INFO]
[INFO] Detected changes:
-[INFO] Create Table ARTIST
-[INFO] Create Table PAINTING
-[INFO] Create Table GALLERY
+[INFO] Create Table artist
+[INFO] Create Table painting
+[INFO] Create Table gallery
[INFO]
-[WARNING] Can't find ObjEntity for PAINTING
-[WARNING] Db Relationship (Db Relationship : toMany (ARTIST.ID, PAINTING.ARTIST_ID)) will have GUESSED Obj Relationship reflection.
-[WARNING] Can't find ObjEntity for GALLERY
-[WARNING] Db Relationship (Db Relationship : toOne (PAINTING.GALLERY_ID, GALLERY.ID)) will have GUESSED Obj Relationship reflection.
+[WARNING] Can't find ObjEntity for painting
+[WARNING] Db Relationship (Db Relationship : toMany (artist.ID, painting.ARTIST_ID)) will have GUESSED Obj Relationship reflection.
+[WARNING] Can't find ObjEntity for gallery
+[WARNING] Db Relationship (Db Relationship : toOne (painting.GALLERY_ID, gallery.ID)) will have GUESSED Obj Relationship reflection.
[INFO] Migration Complete Successfully.</pre>
</div>
</div>
@@ -471,9 +471,9 @@ ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID) ON DEL
</div>
<div class="listingblock">
<div class="content">
- <pre class="highlight"><code class="language-sql sql" data-lang="sql">CREATE TABLE cayenne_demo.PAINTING_INFO (INFO VARCHAR(255) NULL, PAINTING_ID INT NOT NULL, PRIMARY KEY (PAINTING_ID)) ENGINE=InnoDB;
-ALTER TABLE cayenne_demo.GALLERY ADD COLUMN FOUNDED_DATE DATE;
-ALTER TABLE cayenne_demo.PAINTING_INFO ADD FOREIGN KEY (PAINTING_ID) REFERENCES cayenne_demo.PAINTING (ID);</code></pre>
+ <pre class="highlight"><code class="language-sql sql" data-lang="sql">CREATE TABLE cayenne_demo.painting_info (INFO VARCHAR(255) NULL, PAINTING_ID INT NOT NULL, PRIMARY KEY (PAINTING_ID)) ENGINE=InnoDB;
+ALTER TABLE cayenne_demo.gallery ADD COLUMN FOUNDED_DATE DATE;
+ALTER TABLE cayenne_demo.painting_info ADD FOREIGN KEY (PAINTING_ID) REFERENCES cayenne_demo.painting (ID);</code></pre>
</div>
</div>
</div>
@@ -493,21 +493,21 @@ ALTER TABLE cayenne_demo.PAINTING_INFO ADD FOREIGN KEY (PAINTING_ID) REFERENCES
<div class="listingblock">
<div class="content">
<pre>...
-[INFO] Table: cayenne_demo.ARTIST
-[INFO] Table: cayenne_demo.GALLERY
-[INFO] Table: cayenne_demo.PAINTING
-[INFO] Table: cayenne_demo.PAINTING_INFO
-[INFO] Db Relationship : toOne (PAINTING_INFO.PAINTING_ID, PAINTING.ID)
-[INFO] Db Relationship : toOne (PAINTING.ID, PAINTING_INFO.PAINTING_ID)
-[INFO] Db Relationship : toOne (PAINTING.GALLERY_ID, GALLERY.ID)
-[INFO] Db Relationship : toMany (GALLERY.ID, PAINTING.GALLERY_ID)
-[INFO] Db Relationship : toOne (PAINTING.ARTIST_ID, ARTIST.ID)
-[INFO] Db Relationship : toMany (ARTIST.ID, PAINTING.ARTIST_ID)
+[INFO] Table: cayenne_demo.artist
+[INFO] Table: cayenne_demo.gallery
+[INFO] Table: cayenne_demo.painting
+[INFO] Table: cayenne_demo.painting_info
+[INFO] Db Relationship : toOne (painting_info.PAINTING_ID, painting.ID)
+[INFO] Db Relationship : toOne (painting.ID, painting_info.PAINTING_ID)
+[INFO] Db Relationship : toOne (painting.GALLERY_ID, gallery.ID)
+[INFO] Db Relationship : toMany (gallery.ID, painting.GALLERY_ID)
+[INFO] Db Relationship : toOne (painting.ARTIST_ID, artist.ID)
+[INFO] Db Relationship : toMany (artist.ID, painting.ARTIST_ID)
[INFO]
[INFO] Detected changes:
-[INFO] Create Table PAINTING_INFO
-[INFO] Add Column GALLERY.FOUNDED_DATE
-[INFO] Add Relationship paintingInfo PAINTING->PAINTING_INFO.PAINTING_ID
+[INFO] Create Table painting_info
+[INFO] Add Column gallery.FOUNDED_DATE
+[INFO] Add Relationship paintingInfo painting->painting_info.PAINTING_ID
[INFO]
[INFO] Migration Complete Successfully.</pre>
</div>
@@ -580,10 +580,10 @@ ALTER TABLE cayenne_demo.PAINTING_INFO ADD FOREIGN KEY (PAINTING_ID) REFERENCES
</div>
<div class="listingblock">
<div class="content">
- <pre class="highlight"><code class="language-sql sql" data-lang="sql">CREATE TABLE cayenne_demo.LEGACY_PAINTING_INFO (ID INT NOT NULL AUTO_INCREMENT, INFO VARCHAR(255) NULL, PAINTING_ID INT NOT NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
-ALTER TABLE cayenne_demo.ARTIST ADD COLUMN __service_column INT;
-ALTER TABLE cayenne_demo.GALLERY ADD COLUMN __service_column INT;
-ALTER TABLE cayenne_demo.PAINTING ADD COLUMN __service_column INT;</code></pre>
+ <pre class="highlight"><code class="language-sql sql" data-lang="sql">CREATE TABLE cayenne_demo.legacy_painting_info (ID INT NOT NULL AUTO_INCREMENT, INFO VARCHAR(255) NULL, PAINTING_ID INT NOT NULL, PRIMARY KEY (ID)) ENGINE=InnoDB;
+ALTER TABLE cayenne_demo.artist ADD COLUMN __service_column INT;
+ALTER TABLE cayenne_demo.gallery ADD COLUMN __service_column INT;
+ALTER TABLE cayenne_demo.painting ADD COLUMN __service_column INT;</code></pre>
</div>
</div>
</div>
@@ -594,7 +594,7 @@ ALTER TABLE cayenne_demo.PAINTING ADD COLUMN __service_column INT;</code></pre>
</div>
<div class="listingblock">
<div class="content">
- <pre class="highlight"><code class="language-xml xml" data-lang="xml"><excludeTable>LEGACY_PAINTING_INFO</excludeTable>
+ <pre class="highlight"><code class="language-xml xml" data-lang="xml"><excludeTable>legacy_painting_info</excludeTable>
<excludeColumn>__service_column</excludeColumn></code></pre>
</div>
</div>
@@ -809,7 +809,7 @@ context.commitChanges();</code></pre>
...
[main] INFO org.apache.cayenne.datasource.DriverDataSource - +++ Connecting: SUCCESS.
[main] INFO org.apache.cayenne.log.JdbcEventLogger - --- transaction started.
-[main] INFO org.apache.cayenne.log.JdbcEventLogger - INSERT INTO cayenne_demo.ARTIST (DATE_OF_BIRTH, NAME) VALUES (?, ?)
+[main] INFO org.apache.cayenne.log.JdbcEventLogger - INSERT INTO cayenne_demo.artist (DATE_OF_BIRTH, NAME) VALUES (?, ?)
[main] INFO org.apache.cayenne.log.JdbcEventLogger - [bind: 1->DATE_OF_BIRTH:NULL, 2->NAME:'Picasso']
[main] INFO org.apache.cayenne.log.JdbcEventLogger - Generated PK: ARTIST.ID = 2
[main] INFO org.apache.cayenne.log.JdbcEventLogger - === updated 1 row.