cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1176918 - in /cayenne/main/trunk/tutorials/tutorial/src/main: java/org/apache/cayenne/tutorial/Main.java resources/UntitledDomainMap.map.xml resources/cayenne-UntitledDomain.xml resources/cayenne-project.xml resources/datamap.map.xml
Date Wed, 28 Sep 2011 15:25:12 GMT
Author: dkazimirchyk
Date: Wed Sep 28 15:25:11 2011
New Revision: 1176918

URL: http://svn.apache.org/viewvc?rev=1176918&view=rev
Log:
tutorial correction to correspond 3.1 changes

Added:
    cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-project.xml
    cayenne/main/trunk/tutorials/tutorial/src/main/resources/datamap.map.xml
Removed:
    cayenne/main/trunk/tutorials/tutorial/src/main/resources/UntitledDomainMap.map.xml
    cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-UntitledDomain.xml
Modified:
    cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java

Modified: cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java?rev=1176918&r1=1176917&r2=1176918&view=diff
==============================================================================
--- cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
(original)
+++ cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
Wed Sep 28 15:25:11 2011
@@ -39,7 +39,7 @@ public class Main {
 
 		// starting Cayenne
 		ServerRuntime cayenneRuntime = new ServerRuntime(
-				"cayenne-UntitledDomain.xml");
+				"cayenne-project.xml");
 
 		// getting a hold of ObjectContext
 		ObjectContext context = cayenneRuntime.getContext();

Added: cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-project.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-project.xml?rev=1176918&view=auto
==============================================================================
--- cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-project.xml (added)
+++ cayenne/main/trunk/tutorials/tutorial/src/main/resources/cayenne-project.xml Wed Sep 28
15:25:11 2011
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<domain project-version="6">
+	<map name="datamap"/>
+
+	<node name="datanode"
+		 factory="org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory"
+		 schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy"
+		>
+		<map-ref name="datamap"/>
+		<data-source>
+			<driver value="org.apache.derby.jdbc.EmbeddedDriver"/>
+			<url value="jdbc:derby:memory:testdb;create=true"/>
+			<connectionPool min="1" max="1"/>
+			<login/>
+		</data-source>
+	</node>
+</domain>

Added: cayenne/main/trunk/tutorials/tutorial/src/main/resources/datamap.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/tutorials/tutorial/src/main/resources/datamap.map.xml?rev=1176918&view=auto
==============================================================================
--- cayenne/main/trunk/tutorials/tutorial/src/main/resources/datamap.map.xml (added)
+++ cayenne/main/trunk/tutorials/tutorial/src/main/resources/datamap.map.xml Wed Sep 28 15:25:11
2011
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
+	 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="6">
+	<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" isMandatory="true"/>
+		<db-attribute name="NAME" type="VARCHAR" length="200"/>
+	</db-entity>
+	<db-entity name="GALLERY">
+		<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" isMandatory="true"/>
+		<db-attribute name="NAME" type="VARCHAR" length="200"/>
+	</db-entity>
+	<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.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.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">
+		<db-attribute-pair source="ID" target="ARTIST_ID"/>
+	</db-relationship>
+	<db-relationship name="paintings" source="GALLERY" target="PAINTING" toMany="true">
+		<db-attribute-pair source="ID" target="GALLERY_ID"/>
+	</db-relationship>
+	<db-relationship name="artist" source="PAINTING" target="ARTIST" toMany="false">
+		<db-attribute-pair source="ARTIST_ID" target="ID"/>
+	</db-relationship>
+	<db-relationship name="gallery" source="PAINTING" target="GALLERY" toMany="false">
+		<db-attribute-pair source="GALLERY_ID" target="ID"/>
+	</db-relationship>
+	<obj-relationship name="paintings" source="Artist" target="Painting" deleteRule="Cascade"
db-relationship-path="paintings"/>
+	<obj-relationship name="paintings" source="Gallery" target="Painting" deleteRule="Nullify"
db-relationship-path="paintings"/>
+	<obj-relationship name="artist" source="Painting" target="Artist" deleteRule="Nullify"
db-relationship-path="artist"/>
+	<obj-relationship name="gallery" source="Painting" target="Gallery" deleteRule="Nullify"
db-relationship-path="gallery"/>
+</data-map>



Mime
View raw message