cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [1/2] cayenne git commit: CAY-2275 Documentation: tutorial is out of sync with 4.0.M5 version
Date Wed, 05 Apr 2017 10:34:37 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 4ff5e0e71 -> 5008dcee2


CAY-2275 Documentation: tutorial is out of sync with 4.0.M5 version


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

Branch: refs/heads/master
Commit: 70060936645b9aae100e8a3b75a26dda3664ac09
Parents: 67225b3
Author: Anton Dreka <drekoas@gmail.com>
Authored: Wed Apr 5 12:41:09 2017 +0300
Committer: Anton Dreka <drekoas@gmail.com>
Committed: Wed Apr 5 12:41:09 2017 +0300

----------------------------------------------------------------------
 docs/doc/src/main/resources/RELEASE-NOTES.txt       |  1 +
 .../getting-started/src/docbkx/java-classes.xml     |  6 ++++++
 .../src/docbkx/persistent-objects.xml               | 16 ++++++++--------
 docs/docbook/getting-started/src/docbkx/webapp.xml  |  7 +++++--
 4 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/70060936/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 20f6164..7b3e18b 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -37,6 +37,7 @@ CAY-2243 ObjectContext.getGraphManager().unregisterObject() inconsistencies
 CAY-2256 Cannot Save/Insert an Object With null Flattened (complex) toOne Relationship (see
also CAY-2146)
 CAY-2265 ServerRuntime.builder() fails to set default runtime name when a the project file
doesn't follow recognized pattern
 CAY-2273 Modeler: default suggested cgen location is rooted in subpackage
+CAY-2275 Documentation: tutorial is out of sync with 4.0.M5 version
 
 ----------------------------------
 Release: 4.0.M5

http://git-wip-us.apache.org/repos/asf/cayenne/blob/70060936/docs/docbook/getting-started/src/docbkx/java-classes.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/getting-started/src/docbkx/java-classes.xml b/docs/docbook/getting-started/src/docbkx/java-classes.xml
index b90bb22..848699f 100644
--- a/docs/docbook/getting-started/src/docbkx/java-classes.xml
+++ b/docs/docbook/getting-started/src/docbkx/java-classes.xml
@@ -67,6 +67,12 @@
             &lt;!-- Here specify the version of Cayenne you are actually using --&gt;
             &lt;version&gt;<?eval ${project.version}?>&lt;/version&gt;
         &lt;/dependency&gt;
+        &lt;!--  For java.time.* types you need to use this dependency-->
+        &lt;dependency>
+            &lt;groupId>org.apache.cayenne&lt;/groupId>
+            &lt;artifactId>cayenne-java8&lt;/artifactId>
+            &lt;version>4.0.M5&lt;/version>
+        &lt;/dependency>
     &lt;/dependencies&gt;
 &lt;/project&gt;</programlisting></para>
         <para>Your computer must be connected to the internet. Once you edit the <code>pom.xml</code>,
IDEA

http://git-wip-us.apache.org/repos/asf/cayenne/blob/70060936/docs/docbook/getting-started/src/docbkx/persistent-objects.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/getting-started/src/docbkx/persistent-objects.xml b/docs/docbook/getting-started/src/docbkx/persistent-objects.xml
index 7135640..08396e3 100644
--- a/docs/docbook/getting-started/src/docbkx/persistent-objects.xml
+++ b/docs/docbook/getting-started/src/docbkx/persistent-objects.xml
@@ -34,10 +34,10 @@
             birth, taking a string argument for the date. It will be preserved even if the
model
             changes later:</para>
         <programlisting language="java">package org.example.cayenne.persistent;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+            
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
 
 import org.example.cayenne.persistent.auto._Artist;
 
@@ -53,11 +53,11 @@ public class Artist extends _Artist {
             setDateOfBirth(null);
         } else {
 
-            Date date;
+            LocalDate date;
             try {
-                date = new SimpleDateFormat(DEFAULT_DATE_FORMAT)
-                        .parse(yearMonthDay);
-            } catch (ParseException e) {
+                DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT);
+                date = LocalDate.parse(yearMonthDay, formatter);
+            } catch (DateTimeParseException e) {
                 throw new IllegalArgumentException(
                         "A date argument must be in format '"
                         + DEFAULT_DATE_FORMAT + "': " + yearMonthDay);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/70060936/docs/docbook/getting-started/src/docbkx/webapp.xml
----------------------------------------------------------------------
diff --git a/docs/docbook/getting-started/src/docbkx/webapp.xml b/docs/docbook/getting-started/src/docbkx/webapp.xml
index 73dc225..bab9815 100644
--- a/docs/docbook/getting-started/src/docbkx/webapp.xml
+++ b/docs/docbook/getting-started/src/docbkx/webapp.xml
@@ -126,6 +126,7 @@
 &lt;%@ page import="org.apache.cayenne.query.*" %>
 &lt;%@ page import="java.util.*" %&gt;
 &lt;%@ page import="java.text.*" %&gt;
+&lt;%@ page import="java.time.format.DateTimeFormatter" %>
 
 &lt;% 
     ObjectContext context = BaseContext.getThreadObjectContext();
@@ -160,8 +161,10 @@
     }
 
     String name = artist.getName() == null ? "" : artist.getName();
+
+    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
     String dob = artist.getDateOfBirth() == null
-            ? "" : new SimpleDateFormat("yyyyMMdd").format(artist.getDateOfBirth());
+                        ? "" :artist.getDateOfBirth().format(formatter);
 %&gt;
 &lt;html&gt;
     &lt;head&gt;
@@ -208,7 +211,7 @@
     &lt;plugins&gt;
         &lt;plugin&gt;
             &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
-            &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
+            &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
             &lt;version&gt;9.3.14.v20161028&lt;/version&gt;
         &lt;/plugin&gt;
     &lt;/plugins&gt;


Mime
View raw message