You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2009/12/25 20:55:17 UTC

svn commit: r893881 - in /cayenne/main/branches/STABLE-3.0: ./ assembly/ assembly/src/main/assembly/ tutorials/ tutorials/tutorial/ tutorials/tutorial/src/main/java/org/apache/ tutorials/tutorial/src/main/java/org/apache/cayenne/ tutorials/tutorial/src...

Author: aadamchik
Date: Fri Dec 25 19:55:16 2009
New Revision: 893881

URL: http://svn.apache.org/viewvc?rev=893881&view=rev
Log:
Cayenne tutorial work:

* refactoring tutorial package names to clearly identify the source of this code
* removing database-generated PK, as CreateIfNoSchemaStrategy is now running at the right moment
* declaring objectstyle.org repository to ensure we are pulling Derby DB with the fixed pom
* proper use of generics
* including tutorials in the maven build and assembly
* adding apache headers to non-generated files

Added:
    cayenne/main/branches/STABLE-3.0/tutorials/pom.xml
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/Main.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Artist.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Artist.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Gallery.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Painting.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/UntitledDomainMap.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/UntitledDomainMap.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Artist.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Artist.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Gallery.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Gallery.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Painting.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Painting.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_UntitledDomainMap.java
      - copied, changed from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_UntitledDomainMap.java
Removed:
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/Main.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Artist.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Gallery.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Painting.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/UntitledDomainMap.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Artist.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Gallery.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Painting.java
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_UntitledDomainMap.java
Modified:
    cayenne/main/branches/STABLE-3.0/assembly/pom.xml
    cayenne/main/branches/STABLE-3.0/assembly/src/main/assembly/main.xml
    cayenne/main/branches/STABLE-3.0/pom.xml
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/pom.xml
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/detail.jsp
    cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/index.jsp

Modified: cayenne/main/branches/STABLE-3.0/assembly/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/assembly/pom.xml?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/assembly/pom.xml (original)
+++ cayenne/main/branches/STABLE-3.0/assembly/pom.xml Fri Dec 25 19:55:16 2009
@@ -50,7 +50,7 @@
 			<version>${version}</version>
 		</dependency>
 
-    <dependency>
+    	<dependency>
 			<groupId>org.apache.cayenne</groupId>
 			<artifactId>cayenne-tools</artifactId>
 			<version>${version}</version>
@@ -58,12 +58,6 @@
 
 		<dependency>
 			<groupId>org.apache.cayenne</groupId>
-			<artifactId>cayenne-agent</artifactId>
-			<version>${version}</version>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.cayenne</groupId>
 			<artifactId>cayenne-modeler</artifactId>
 			<version>${version}</version>
 		</dependency>

Modified: cayenne/main/branches/STABLE-3.0/assembly/src/main/assembly/main.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/assembly/src/main/assembly/main.xml?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/assembly/src/main/assembly/main.xml (original)
+++ cayenne/main/branches/STABLE-3.0/assembly/src/main/assembly/main.xml Fri Dec 25 19:55:16 2009
@@ -75,5 +75,16 @@
 				<exclude>META-INF/MANIFEST.MF</exclude>
 			</excludes>
 		</fileSet>
+		<fileSet>
+			<directory>../tutorials/</directory>
+			<outputDirectory>tutorials</outputDirectory>
+			<includes>
+				<include>tutorial/**</include>
+			</includes>
+			<excludes>
+				<exclude>**/target/**</exclude>
+				<exclude>**/derby.log</exclude>
+			</excludes>
+		</fileSet>
 	</fileSets>
 </assembly>

Modified: cayenne/main/branches/STABLE-3.0/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/pom.xml?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/pom.xml (original)
+++ cayenne/main/branches/STABLE-3.0/pom.xml Fri Dec 25 19:55:16 2009
@@ -43,6 +43,7 @@
 		<module>framework</module>
 		<module>itests</module>
 		<module>modeler</module>
+		<module>tutorials</module>
 		<module>docs</module>
 	</modules>
 

Added: cayenne/main/branches/STABLE-3.0/tutorials/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/pom.xml?rev=893881&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/pom.xml (added)
+++ cayenne/main/branches/STABLE-3.0/tutorials/pom.xml Fri Dec 25 19:55:16 2009
@@ -0,0 +1,36 @@
+<?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/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.cayenne</groupId>
+		<artifactId>cayenne-parent</artifactId>
+		<version>3.0-SNAPSHOT</version>
+	</parent>
+	<groupId>org.apache.cayenne.parents</groupId>
+	<artifactId>cayenne-tutorials-parent</artifactId>
+	<name>Cayenne Tutorials</name>
+	<packaging>pom</packaging>
+
+	<modules>
+		<module>tutorial</module>
+	</modules>
+</project>

Modified: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/pom.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/pom.xml?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/pom.xml (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/pom.xml Fri Dec 25 19:55:16 2009
@@ -1,15 +1,32 @@
+
+	<!--
+		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/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.example.cayenne</groupId>
 	<artifactId>tutorial</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
+	<name>Cayenne Tutorial</name>
+	<version>3.0-SNAPSHOT</version>
 
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.cayenne</groupId>
 			<artifactId>cayenne-server</artifactId>
-			<version>3.0B1</version>
+			<version>3.0-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.derby</groupId>
@@ -18,14 +35,30 @@
 		</dependency>
 	</dependencies>
 
+	<repositories>
+		<repository>
+			<id>objectstyle</id>
+			<name>ObjectStyle Maven2 Repository</name>
+			<url>http://objectstyle.org/maven2</url>
+			<layout>default</layout>
+		</repository>
+	</repositories>
 	<build>
 		<plugins>
 			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			<plugin>
 				<groupId>org.mortbay.jetty</groupId>
 				<artifactId>maven-jetty-plugin</artifactId>
-				<version>6.1.18</version>
+				<version>6.1.22</version>
 			</plugin>
 		</plugins>
 	</build>
 
-</project>
\ No newline at end of file
+</project>

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/Main.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/Main.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/Main.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java Fri Dec 25 19:55:16 2009
@@ -1,4 +1,22 @@
-package org.example.cayenne;
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+package org.apache.cayenne.tutorial;
 
 import java.util.Calendar;
 import java.util.Collections;
@@ -11,9 +29,9 @@
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
-import org.example.cayenne.persistent.Artist;
-import org.example.cayenne.persistent.Gallery;
-import org.example.cayenne.persistent.Painting;
+import org.apache.cayenne.tutorial.persistent.Artist;
+import org.apache.cayenne.tutorial.persistent.Gallery;
+import org.apache.cayenne.tutorial.persistent.Painting;
 
 public class Main {
 

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Artist.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Artist.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Artist.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Artist.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Artist.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/Artist.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Artist.java Fri Dec 25 19:55:16 2009
@@ -1,10 +1,10 @@
-package org.example.cayenne.persistent;
+package org.apache.cayenne.tutorial.persistent;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import org.example.cayenne.persistent.auto._Artist;
+import org.apache.cayenne.tutorial.persistent.auto._Artist;
 
 public class Artist extends _Artist {
 

Added: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Gallery.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Gallery.java?rev=893881&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Gallery.java (added)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Gallery.java Fri Dec 25 19:55:16 2009
@@ -0,0 +1,7 @@
+package org.apache.cayenne.tutorial.persistent;
+
+import org.apache.cayenne.tutorial.persistent.auto._Gallery;
+
+public class Gallery extends _Gallery {
+
+}

Added: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Painting.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Painting.java?rev=893881&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Painting.java (added)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/Painting.java Fri Dec 25 19:55:16 2009
@@ -0,0 +1,7 @@
+package org.apache.cayenne.tutorial.persistent;
+
+import org.apache.cayenne.tutorial.persistent.auto._Painting;
+
+public class Painting extends _Painting {
+
+}

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/UntitledDomainMap.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/UntitledDomainMap.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/UntitledDomainMap.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/UntitledDomainMap.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/UntitledDomainMap.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/UntitledDomainMap.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/UntitledDomainMap.java Fri Dec 25 19:55:16 2009
@@ -1,6 +1,6 @@
-package org.example.cayenne.persistent;
+package org.apache.cayenne.tutorial.persistent;
 
-import org.example.cayenne.persistent.auto._UntitledDomainMap;
+import org.apache.cayenne.tutorial.persistent.auto._UntitledDomainMap;
 
 public class UntitledDomainMap extends _UntitledDomainMap {
 

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Artist.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Artist.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Artist.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Artist.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Artist.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Artist.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Artist.java Fri Dec 25 19:55:16 2009
@@ -1,10 +1,10 @@
-package org.example.cayenne.persistent.auto;
+package org.apache.cayenne.tutorial.persistent.auto;
 
 import java.util.Date;
 import java.util.List;
 
 import org.apache.cayenne.CayenneDataObject;
-import org.example.cayenne.persistent.Painting;
+import org.apache.cayenne.tutorial.persistent.Painting;
 
 /**
  * Class _Artist was generated by Cayenne.

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Gallery.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Gallery.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Gallery.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Gallery.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Gallery.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Gallery.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Gallery.java Fri Dec 25 19:55:16 2009
@@ -1,9 +1,9 @@
-package org.example.cayenne.persistent.auto;
+package org.apache.cayenne.tutorial.persistent.auto;
 
 import java.util.List;
 
 import org.apache.cayenne.CayenneDataObject;
-import org.example.cayenne.persistent.Painting;
+import org.apache.cayenne.tutorial.persistent.Painting;
 
 /**
  * Class _Gallery was generated by Cayenne.

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Painting.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Painting.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Painting.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Painting.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Painting.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_Painting.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_Painting.java Fri Dec 25 19:55:16 2009
@@ -1,8 +1,8 @@
-package org.example.cayenne.persistent.auto;
+package org.apache.cayenne.tutorial.persistent.auto;
 
 import org.apache.cayenne.CayenneDataObject;
-import org.example.cayenne.persistent.Artist;
-import org.example.cayenne.persistent.Gallery;
+import org.apache.cayenne.tutorial.persistent.Artist;
+import org.apache.cayenne.tutorial.persistent.Gallery;
 
 /**
  * Class _Painting was generated by Cayenne.

Copied: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_UntitledDomainMap.java (from r893694, cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_UntitledDomainMap.java)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_UntitledDomainMap.java?p2=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_UntitledDomainMap.java&p1=cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_UntitledDomainMap.java&r1=893694&r2=893881&rev=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/example/cayenne/persistent/auto/_UntitledDomainMap.java (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/persistent/auto/_UntitledDomainMap.java Fri Dec 25 19:55:16 2009
@@ -1,4 +1,4 @@
-package org.example.cayenne.persistent.auto;
+package org.apache.cayenne.tutorial.persistent.auto;
 
 
 

Modified: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml Fri Dec 25 19:55:16 2009
@@ -3,30 +3,30 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
   project-version="3.0.0.1">
-	<property name="defaultPackage" value="org.example.cayenne.persistent"/>
+	<property name="defaultPackage" value="org.apache.cayenne.tutorial.persistent"/>
 	<db-entity name="ARTIST">
 		<db-attribute name="DATE_OF_BIRTH" type="DATE"/>
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isGenerated="true" isMandatory="true"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="NAME" type="VARCHAR" length="200"/>
 	</db-entity>
 	<db-entity name="GALLERY">
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isGenerated="true" isMandatory="true"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="NAME" type="VARCHAR" length="200"/>
 	</db-entity>
 	<db-entity name="PAINTING">
 		<db-attribute name="ARTIST_ID" type="INTEGER"/>
 		<db-attribute name="GALLERY_ID" type="INTEGER"/>
-		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isGenerated="true" isMandatory="true"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="NAME" type="VARCHAR" length="200"/>
 	</db-entity>
-	<obj-entity name="Artist" className="org.example.cayenne.persistent.Artist" dbEntityName="ARTIST">
+	<obj-entity name="Artist" className="org.apache.cayenne.tutorial.persistent.Artist" dbEntityName="ARTIST">
 		<obj-attribute name="dateOfBirth" type="java.util.Date" db-attribute-path="DATE_OF_BIRTH"/>
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
 	</obj-entity>
-	<obj-entity name="Gallery" className="org.example.cayenne.persistent.Gallery" dbEntityName="GALLERY">
+	<obj-entity name="Gallery" className="org.apache.cayenne.tutorial.persistent.Gallery" dbEntityName="GALLERY">
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
 	</obj-entity>
-	<obj-entity name="Painting" className="org.example.cayenne.persistent.Painting" dbEntityName="PAINTING">
+	<obj-entity name="Painting" className="org.apache.cayenne.tutorial.persistent.Painting" dbEntityName="PAINTING">
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
 	</obj-entity>
 	<db-relationship name="paintings" source="ARTIST" target="PAINTING" toMany="true">

Modified: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/detail.jsp
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/detail.jsp?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/detail.jsp (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/detail.jsp Fri Dec 25 19:55:16 2009
@@ -1,5 +1,25 @@
+<!-- 
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+ -->
 <%@ page language="java" contentType="text/html" %>
-<%@ page import="org.example.cayenne.persistent.*" %>
+<%@ page import="org.apache.cayenne.tutorial.persistent.*" %>
 <%@ page import="org.apache.cayenne.*" %>
 <%@ page import="java.util.*" %>
 <%@ page import="java.text.*" %>
@@ -11,14 +31,14 @@
     // find artist for id
     Artist artist = null;
     if(id != null && id.trim().length() > 0) {
-        artist = (Artist) DataObjectUtils.objectForPK(context, Artist.class, Integer.parseInt(id));
+        artist = DataObjectUtils.objectForPK(context, Artist.class, Integer.parseInt(id));
     }
 
     if("POST".equals(request.getMethod())) {
         // if no id is saved in the hidden field, we are dealing with
         // create new artist request
         if(artist == null) {
-            artist = (Artist) context.newObject(Artist.class);
+            artist = context.newObject(Artist.class);
         }
 
         // note that in a real application we would so dome validation ...

Modified: cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/index.jsp?rev=893881&r1=893880&r2=893881&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/index.jsp (original)
+++ cayenne/main/branches/STABLE-3.0/tutorials/tutorial/src/main/webapp/index.jsp Fri Dec 25 19:55:16 2009
@@ -1,5 +1,25 @@
+<!-- 
+/*****************************************************************
+ *   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.
+ ****************************************************************/
+ -->
 <%@ page language="java" contentType="text/html" %>
-<%@ page import="org.example.cayenne.persistent.*" %>
+<%@ page import="org.apache.cayenne.tutorial.persistent.*" %>
 <%@ page import="org.apache.cayenne.*" %>
 <%@ page import="org.apache.cayenne.query.*" %>
 <%@ page import="org.apache.cayenne.exp.*" %>
@@ -7,10 +27,10 @@
 
 <% 
     SelectQuery query = new SelectQuery(Artist.class);
-    query.addOrdering(Artist.NAME_PROPERTY, true);
+    query.addOrdering(Artist.NAME_PROPERTY, SortOrder.ASCENDING);
 
     ObjectContext context = BaseContext.getThreadObjectContext();
-    List artists = context.performQuery(query);
+    List<Artist> artists = context.performQuery(query);
 %>
 <html>
     <head>
@@ -22,9 +42,7 @@
         <% if(artists.isEmpty()) {%>
         <p>No artists found</p>
         <% } else { 
-            Iterator it = artists.iterator();
-            while(it.hasNext()) {
-                Artist a = (Artist) it.next();
+        	for(Artist a : artists) {
         %>
         <p><a href="detail.jsp?id=<%=DataObjectUtils.intPKForObject(a)%>"> <%=a.getName()%> </a></p>
         <%