Hi, my name's Michael, I'm one of the students working on the new
cascading feature. To that end, I'm currently trying to restructure
our tests but I keep running into problems...

Backstory: Previously, we patched ourselves into the cpactf package
(test2860; see the corresponding JIRA issue) but that hasn't been
working out so well, so Werner suggested we create our own package
(cascading-it) and make use of the Spring framework, like the JPA
extensions tests do (in jpa-extensions-it).

So I pretty much copied their stuff and tried to understand it and to
trim it down to for our purposes. I've attached a patch of the current
state of my efforts. I think it's pretty self-explanatory if you take
a quick look at the directory structure. (Note: the test functions in
the files are all the same because I know for sure that that one
works.)

Using "mvn clean test" all tests should and do finish successfully,
but here are the problems:

1) It doesn't seem to use the current state of it's parent castor
source, so the changes we've made to our trunk aren't there. (That's
why autostore is set to true, so the tests can run without making use
of our cascading feature.) I guess you can configure that in the
pom.xml?

2) @Transactional doesn't work. The tests run because all ids are
different, but if you were to e.g. make create2() use the same ids as
create() you'll get an error. The test classes are all
AbstractTransactionalJUnit4SpringContextTests and I'm pretty sure the
transactionManager gets injected correctly (at least everything's done
exactly like in jpa-extension-it). I've got to be missing something
here...

3) It doesn't work with JUnit in Eclipse. It can't find the database.
(I used to get something along the lines of "schema TEST doesn't
exist" but now all I'm getting is "Database target/test not found")


I hope it's not all just dumb mistakes, but it's getting late and I'm
pretty much stuck. Thanks in advance for all advice!
Index: cascading-it/pom.xml
===================================================================
--- cascading-it/pom.xml        (revision 0)
+++ cascading-it/pom.xml        (revision 0)
@@ -0,0 +1,179 @@
+<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.codehaus.castor</groupId>
+    <artifactId>cascading-it</artifactId>
+    <version>1.3.1-SNAPSHOT</version>
+
+    <parent>
+      <artifactId>castor</artifactId>
+      <groupId>org.codehaus.castor</groupId>
+      <version>1.3.1-SNAPSHOT</version>
+    </parent>
+
+    <!-- <packaging>jar</packaging> -->
+    <name>Castor JDO - Integration tests for cascading support</name>
+    <url>http://www.castor.org</url>
+    <description>Integration tests for cascading support of Castor 
JDO.</description>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/test/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/test/sources</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>castor-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>sql-maven-plugin</artifactId>
+                <version>1.3</version>
+                <configuration>
+                    <username>test</username>
+                    <password>test</password>
+                    <driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
+                    <!-- <skip>${maven.test.skip}</skip> -->
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.derby</groupId>
+                        <artifactId>derby</artifactId>
+                        <version>10.4.1.3</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>create schema</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            
<url>jdbc:derby:${basedir}/target/test;create=true</url>
+                            <autocommit>true</autocommit>
+                            <srcFiles>
+                                
<srcFile>src/test/resources/create-derby.sql</srcFile>
+                            </srcFiles>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>derby shutdown</id>
+                        <phase>process-test-resources</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            
<url>jdbc:derby:${basedir}/target/test;shutdown=true</url>
+                            <skipOnConnectionError>true</skipOnConnectionError>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+         <dependency>
+            <groupId>org.codehaus.castor</groupId>
+            <artifactId>castor-jdo</artifactId>
+         </dependency>
+        <dependency>
+            <groupId>org.codehaus.castor</groupId>
+            <artifactId>spring-orm</artifactId>
+            <version>1.5-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.persistence</groupId>
+            <artifactId>persistence-api</artifactId>
+            <version>1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <version>2.5.5</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <version>2.5.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>2.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-aop</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+<!-- 
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+ -->        
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-orm</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jdbc</artifactId>
+            <version>2.5.4</version>
+        </dependency>
+        <!--  -->
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.2.2</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+            <version>10.4.1.3</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <repositories>
+        <repository>
+            <id>codehaus-snapshots</id>
+            <name>Maven Codehaus Snapshots</name>
+            <url> http://snapshots.repository.codehaus.org </url>
+        </repository>
+    </repositories>
+</project>
Index: cascading-it/src/test/java/org/castor/cascading/one_to_one/Author.java
===================================================================
--- cascading-it/src/test/java/org/castor/cascading/one_to_one/Author.java      
(revision 0)
+++ cascading-it/src/test/java/org/castor/cascading/one_to_one/Author.java      
(revision 0)
@@ -0,0 +1,44 @@
+package org.castor.cascading.one_to_one;
+
+import org.exolab.castor.jdo.TimeStampable;
+import org.junit.Ignore;
+
+...@ignore
+public class Author implements TimeStampable {
+    private int id;
+    private long timestamp;
+    private String name;
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public long jdoGetTimeStamp() {
+       return timestamp;
+    }
+
+    public void jdoSetTimeStamp(long timestamp) {
+       this.timestamp = timestamp;
+    }
+    
+    public long getTimestamp() {
+       return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+       this.timestamp = timestamp;
+    }
+
+    public void setName(String name) {
+       this.name = name;
+    }
+
+    public String getName() {
+       return name;
+    }
+}
+
Index: cascading-it/src/test/java/org/castor/cascading/one_to_one/Book.java
===================================================================
--- cascading-it/src/test/java/org/castor/cascading/one_to_one/Book.java        
(revision 0)
+++ cascading-it/src/test/java/org/castor/cascading/one_to_one/Book.java        
(revision 0)
@@ -0,0 +1,45 @@
+package org.castor.cascading.one_to_one;
+
+import org.exolab.castor.jdo.TimeStampable;
+import org.junit.Ignore;
+
+...@ignore
+public class Book implements TimeStampable {
+    private int id;
+    private Author author;
+    private long timestamp;
+    private String name;
+    
+    public int getId() {
+        return id;
+    }
+    public void setId(int id) {
+        this.id = id;
+    }
+    public void setAuthor(Author author) {
+       this.author = author;
+    }
+    public Author getAuthor() {
+       return author;
+    }
+    public long jdoGetTimeStamp() {
+       return timestamp;
+    }
+    public void jdoSetTimeStamp(long timestamp) {
+       this.timestamp = timestamp;     
+    }
+    
+    public long getTimestamp() {
+       return timestamp;
+    }
+
+    public void setTimestamp(long timestamp) {
+       this.timestamp = timestamp;
+    }
+    public void setName(String name) {
+       this.name = name;
+    }
+    public String getName() {
+       return name;
+    }
+}
Index: 
cascading-it/src/test/java/org/castor/cascading/one_to_one/CreateTest.java
===================================================================
--- cascading-it/src/test/java/org/castor/cascading/one_to_one/CreateTest.java  
(revision 0)
+++ cascading-it/src/test/java/org/castor/cascading/one_to_one/CreateTest.java  
(revision 0)
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2009 Werner Guttmann
+ *
+ * Licensed 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.castor.cascading.one_to_one;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.castor.spring.orm.CastorObjectRetrievalFailureException;
+import org.exolab.castor.jdo.Database;
+import org.exolab.castor.jdo.JDOManager;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import 
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
+import org.springframework.test.context.transaction.TransactionConfiguration;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * This class is part of the functional test suite for Castor JDO
+ * and assists in testing JPA annotation support.
+ * 
+ * @author Werner Guttmann
+ * @since 1.3.1
+ */
+...@contextconfiguration(locations = { "spring-config-create.xml" })
+...@transactionconfiguration(transactionManager = "transactionManager", 
defaultRollback = true)
+public class CreateTest extends AbstractTransactionalJUnit4SpringContextTests {
+
+    @Autowired
+    private JDOManager jdoManager;
+               
+       @Test
+       @Transactional
+       public void create() throws Exception {
+               Database _db = jdoManager.getDatabase();
+               // cascading must be independent of autostore
+               _db.setAutoStore(true);         // TODO: set back to false
+               
+               Author author = new Author();
+               author.setId(2);
+               
+               Book book = new Book();
+               book.setId(1);
+               book.setAuthor(author);
+               
+               // persist book and therefore author 
+               // (because cascading=true for the relation book --> author)
+               _db.begin();
+               _db.create(book);
+               _db.commit();
+               
+               // now let's see if book & author were properly commited/created
+               _db.begin();
+               Book db_book = _db.load(Book.class, 1);
+               Author db_author = _db.load(Author.class, 2);
+               _db.commit();
+               
+               assertEquals(1, db_book.getId());
+               assertEquals(2, db_author.getId());
+               _db.close();
+       }
+       
+       @Test
+       @Transactional
+       public void create2() throws Exception {
+               Database _db = jdoManager.getDatabase();
+               // cascading must be independent of autostore
+               _db.setAutoStore(true);         // TODO: set back to false
+               
+               Author author = new Author();
+               author.setId(12);
+               
+               Book book = new Book();
+               book.setId(11);
+               book.setAuthor(author);
+               
+               // persist book and therefore author 
+               // (because cascading=true for the relation book --> author)
+               _db.begin();
+               _db.create(book);
+               _db.commit();
+               
+               // now let's see if book & author were properly commited/created
+               _db.begin();
+               Book db_book = _db.load(Book.class, 11);
+               Author db_author = _db.load(Author.class, 12);
+               _db.commit();
+               
+               assertEquals(11, db_book.getId());
+               assertEquals(12, db_author.getId());
+               _db.close();
+       }
+
+}
Index: 
cascading-it/src/test/java/org/castor/cascading/one_to_one/UpdateTest.java
===================================================================
--- cascading-it/src/test/java/org/castor/cascading/one_to_one/UpdateTest.java  
(revision 0)
+++ cascading-it/src/test/java/org/castor/cascading/one_to_one/UpdateTest.java  
(revision 0)
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2009 Werner Guttmann
+ *
+ * Licensed 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.castor.cascading.one_to_one;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.castor.spring.orm.CastorObjectRetrievalFailureException;
+import org.exolab.castor.jdo.Database;
+import org.exolab.castor.jdo.JDOManager;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import 
org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;
+import org.springframework.test.context.transaction.TransactionConfiguration;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * This class is part of the functional test suite for Castor JDO
+ * and assists in testing JPA annotation support.
+ * 
+ * @author Werner Guttmann
+ * @since 1.3.1
+ */
+...@contextconfiguration(locations = { "spring-config-update.xml" })
+...@transactionconfiguration(transactionManager = "transactionManager", 
defaultRollback = true)
+public class UpdateTest extends AbstractTransactionalJUnit4SpringContextTests {
+
+    @Autowired
+    private JDOManager jdoManager;
+               
+       @Test
+       @Transactional
+       public void create() throws Exception {
+               Database _db = jdoManager.getDatabase();
+               // cascading must be independent of autostore
+               _db.setAutoStore(true);         // TODO: set back to false
+               
+               Author author = new Author();
+               author.setId(102);
+               
+               Book book = new Book();
+               book.setId(101);
+               book.setAuthor(author);
+               
+               // persist book and therefore author 
+               // (because cascading=true for the relation book --> author)
+               _db.begin();
+               _db.create(book);
+               _db.commit();
+               
+               // now let's see if book & author were properly commited/created
+               _db.begin();
+               Book db_book = _db.load(Book.class, 101);
+               Author db_author = _db.load(Author.class, 102);
+               _db.commit();
+               
+               assertEquals(101, db_book.getId());
+               assertEquals(102, db_author.getId());
+               _db.close();
+       }
+       
+       @Test
+       @Transactional
+       public void create2() throws Exception {
+               Database _db = jdoManager.getDatabase();
+               // cascading must be independent of autostore
+               _db.setAutoStore(true);         // TODO: set back to false
+               
+               Author author = new Author();
+               author.setId(112);
+               
+               Book book = new Book();
+               book.setId(111);
+               book.setAuthor(author);
+               
+               // persist book and therefore author 
+               // (because cascading=true for the relation book --> author)
+               _db.begin();
+               _db.create(book);
+               _db.commit();
+               
+               // now let's see if book & author were properly commited/created
+               _db.begin();
+               Book db_book = _db.load(Book.class, 111);
+               Author db_author = _db.load(Author.class, 112);
+               _db.commit();
+               
+               assertEquals(111, db_book.getId());
+               assertEquals(112, db_author.getId());
+               _db.close();
+       }
+
+}
Index: cascading-it/src/test/resources/create-derby.sql
===================================================================
--- cascading-it/src/test/resources/create-derby.sql    (revision 0)
+++ cascading-it/src/test/resources/create-derby.sql    (revision 0)
@@ -0,0 +1,15 @@
+CREATE SCHEMA TEST;
+
+CREATE TABLE OneToOne_Author (
+    id INTEGER PRIMARY KEY,
+    time_stamp bigint,
+    name varchar(100)
+);
+
+CREATE TABLE OneToOne_Book (
+    id INTEGER PRIMARY KEY,
+    author_id INTEGER NOT NULL,
+    time_stamp bigint,
+    name varchar(100),
+    FOREIGN KEY (author_id) REFERENCES OneToOne_Author (id)
+);
\ No newline at end of file
Index: cascading-it/src/test/resources/log4j.xml
===================================================================
--- cascading-it/src/test/resources/log4j.xml   (revision 0)
+++ cascading-it/src/test/resources/log4j.xml   (revision 0)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
+        
+    <appender name="console" class="org.apache.log4j.ConsoleAppender">
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d{dd MMM yyyy 
HH:mm:ss.SSS} [%p] [%t] [%c] - %m%n"/>
+        </layout>
+    </appender>
+
+<!--
+    <appender name="file" class="org.apache.log4j.RollingFileAppender">
+        <param name="File" value="castor-jpa-it.log"/>
+        <param name="MaxFileSize" value="2MB"/>
+        <param name="MaxBackupIndex" value="2"/>
+        <layout class="org.apache.log4j.PatternLayout">
+            <param name="ConversionPattern" value="%d{dd MMM yyyy 
HH:mm:ss.SSS} [%p] [%t] [%c] - %m%n"/>
+        </layout>
+    </appender>
+-->    
+
+    <!-- to set the level to DEBUG for Castor, please uncomment -->
+    
+    <category name="org.exolab.castor">
+      <priority value="info" />
+    </category>
+    
+
+    <root>
+        <priority value="warn" />
+        <appender-ref ref="console"/>
+<!--
+        <appender-ref ref="file"/>
+-->
+    </root>
+
+</log4j:configuration>
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-create.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-create.xml
    (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-create.xml
    (revision 0)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns:tx="http://www.springframework.org/schema/tx";
+    xsi:schemaLocation="
+    http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+    http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd";>
+    
+    <!-- Enable transaction support using Annotations -->
+    <tx:annotation-driven transaction-manager="transactionManager" />
+               
+       <bean id="myDataSource"
+               class="org.apache.commons.dbcp.BasicDataSource"
+               destroy-method="close">
+               <property name="driverClassName" value="${driver}" />
+               <property name="url" value="${url}" />
+               <property name="username" value="${user}" />
+               <property name="password" value="${password}" />
+       </bean>
+
+       <bean id="transactionManager" 
+             class="org.castor.spring.orm.CastorTransactionManager">
+             <property name="JDOManager" ref="jdoManager" />
+       </bean>
+
+       <bean id="jdoManager"
+               class="org.castor.spring.orm.LocalCastorFactoryBean">
+               <property name="databaseName" value="testOneToOne" />
+               <property name="configLocation"
+                       
value="classpath:org/castor/cascading/one_to_one/create/jdo-conf.xml" />
+       </bean>
+       
+</beans>
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-update.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-update.xml
    (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/spring-config-update.xml
    (revision 0)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns:tx="http://www.springframework.org/schema/tx";
+    xsi:schemaLocation="
+    http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+    http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd";>
+    
+    <!-- Enable transaction support using Annotations -->
+    <tx:annotation-driven transaction-manager="transactionManager" />
+       
+       <bean id="myDataSource"
+               class="org.apache.commons.dbcp.BasicDataSource"
+               destroy-method="close">
+               <property name="driverClassName" value="${driver}" />
+               <property name="url" value="${url}" />
+               <property name="username" value="${user}" />
+               <property name="password" value="${password}" />
+       </bean>
+
+       <bean id="transactionManager" 
+             class="org.castor.spring.orm.CastorTransactionManager">
+             <property name="JDOManager" ref="jdoManager" /> 
+       </bean>
+
+       <bean id="jdoManager"
+               class="org.castor.spring.orm.LocalCastorFactoryBean">
+               <property name="databaseName" value="testOneToOne" />
+               <property name="configLocation"
+                       
value="classpath:org/castor/cascading/one_to_one/update/jdo-conf.xml" />
+       </bean>
+       
+</beans>
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/jdo-conf.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/jdo-conf.xml
 (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/jdo-conf.xml
 (revision 0)
@@ -0,0 +1,15 @@
+<?xml version="1.0" ?>
+<!DOCTYPE jdo-conf PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 
1.0//EN"
+                           "http://castor.org/jdo-conf.dtd";>
+
+<jdo-conf>
+       <database name="testOneToOne" engine="derby">
+               <driver url="jdbc:derby:target/test;"
+                       class-name="org.apache.derby.jdbc.EmbeddedDriver">
+                       <param name="user" value="test" />
+                       <param name="password" value="test" />
+               </driver>
+               <mapping href="mapping.xml" />
+       </database>
+       <transaction-demarcation mode="local" />
+</jdo-conf>
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/mapping.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/mapping.xml
  (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/create/mapping.xml
  (revision 0)
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" 
"http://castor.org/mapping.dtd";>
+
+<mapping>
+       <class name="org.castor.cascading.one_to_one.Author" identity="id">
+               <cache-type type="none" />
+               <map-to table="OneToOne_Author" />
+               <field name="id" type="integer">
+                       <sql name="id" type="integer" />
+               </field>
+               <field name="timestamp" type="long">
+                       <sql name="time_stamp" type="numeric" />
+               </field>
+               <field name="name" type="string">
+                       <sql name="name" type="char" />
+               </field>
+       </class>
+       <class name="org.castor.cascading.one_to_one.Book" identity="id">
+               <cache-type type="none" />
+               <map-to table="OneToOne_Book" />
+               <field name="id" type="integer">
+                       <sql name="id" type="integer" />
+               </field>
+               <field name="timestamp" type="long">
+                       <sql name="time_stamp" type="numeric" />
+               </field>
+               <field name="name" type="string">
+                       <sql name="name" type="char" />
+               </field>
+               <field name="author" 
type="org.castor.cascading.one_to_one.Author">
+                       <sql name="author_id" cascading="create" />
+               </field>
+       </class>
+</mapping>
\ No newline at end of file
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/jdo-conf.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/jdo-conf.xml
 (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/jdo-conf.xml
 (revision 0)
@@ -0,0 +1,15 @@
+<?xml version="1.0" ?>
+<!DOCTYPE jdo-conf PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 
1.0//EN"
+                           "http://castor.org/jdo-conf.dtd";>
+
+<jdo-conf>
+       <database name="testOneToOne" engine="derby">
+               <driver url="jdbc:derby:target/test;"
+                       class-name="org.apache.derby.jdbc.EmbeddedDriver">
+                       <param name="user" value="test" />
+                       <param name="password" value="test" />
+               </driver>
+               <mapping href="mapping.xml" />
+       </database>
+       <transaction-demarcation mode="local" />
+</jdo-conf>
Index: 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/mapping.xml
===================================================================
--- 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/mapping.xml
  (revision 0)
+++ 
cascading-it/src/test/resources/org/castor/cascading/one_to_one/update/mapping.xml
  (revision 0)
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" 
"http://castor.org/mapping.dtd";>
+
+<mapping>
+       <class name="org.castor.cascading.one_to_one.Author" identity="id">
+               <cache-type type="none" />
+               <map-to table="OneToOne_Author" />
+               <field name="id" type="integer">
+                       <sql name="id" type="integer" />
+               </field>
+               <field name="timestamp" type="long">
+                       <sql name="time_stamp" type="numeric" />
+               </field>
+               <field name="name" type="string">
+                       <sql name="name" type="char" />
+               </field>
+       </class>
+       <class name="org.castor.cascading.one_to_one.Book" identity="id">
+               <cache-type type="none" />
+               <map-to table="OneToOne_Book" />
+               <field name="id" type="integer">
+                       <sql name="id" type="integer" />
+               </field>
+               <field name="timestamp" type="long">
+                       <sql name="time_stamp" type="numeric" />
+               </field>
+               <field name="name" type="string">
+                       <sql name="name" type="char" />
+               </field>
+               <field name="author" 
type="org.castor.cascading.one_to_one.Author">
+                       <sql name="author_id" cascading="update" />
+               </field>
+       </class>
+</mapping>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to