cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r666071 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java test/java/org/apache/cayenne/CayenneContextEJBQLTest.java test/resources/dml/CayenneContextEJBQLTest.xml
Date Tue, 10 Jun 2008 11:35:56 GMT
Author: aadamchik
Date: Tue Jun 10 04:35:56 2008
New Revision: 666071

URL: http://svn.apache.org/viewvc?rev=666071&view=rev
Log:
CAY-1072 org.apache.cayenne.query.SQLResultSetMapping must implement java.io.Serializable

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextEJBQLTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/CayenneContextEJBQLTest.xml
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java?rev=666071&r1=666070&r2=666071&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/EJBQLQueryMetadata.java
Tue Jun 10 04:35:56 2008
@@ -30,7 +30,7 @@
  */
 class EJBQLQueryMetadata extends BaseQueryMetadata {
 
-    private SQLResultSetMapping resultSetMapping;
+    private transient SQLResultSetMapping resultSetMapping;
 
     void setResultSetMapping(SQLResultSetMapping resultSetMapping) {
         this.resultSetMapping = resultSetMapping;

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextEJBQLTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextEJBQLTest.java?rev=666071&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextEJBQLTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneContextEJBQLTest.java
Tue Jun 10 04:35:56 2008
@@ -0,0 +1,63 @@
+/*****************************************************************
+ *   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;
+
+import java.util.List;
+
+import org.apache.cayenne.access.ClientServerChannel;
+import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.query.EJBQLQuery;
+import org.apache.cayenne.remote.ClientChannel;
+import org.apache.cayenne.remote.service.LocalConnection;
+import org.apache.cayenne.testdo.mt.ClientMtTable1;
+import org.apache.cayenne.unit.AccessStack;
+import org.apache.cayenne.unit.CayenneCase;
+import org.apache.cayenne.unit.CayenneResources;
+import org.apache.cayenne.unit.UnitLocalConnection;
+
+public class CayenneContextEJBQLTest extends CayenneCase {
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        deleteTestData();
+    }
+
+    @Override
+    protected AccessStack buildAccessStack() {
+        return CayenneResources.getResources().getAccessStack(MULTI_TIER_ACCESS_STACK);
+    }
+
+    public void testEJBQLSelect() throws Exception {
+        createTestData("testEJBQLSelect");
+        
+        DataContext context = createDataContext();
+        ClientServerChannel clientServerChannel = new ClientServerChannel(context);
+        UnitLocalConnection connection = new UnitLocalConnection(
+                clientServerChannel,
+                LocalConnection.HESSIAN_SERIALIZATION);
+        ClientChannel channel = new ClientChannel(connection);
+        CayenneContext clientContext = new CayenneContext(channel);
+
+        EJBQLQuery query = new EJBQLQuery("SELECT a FROM MtTable1 a");
+
+        List<ClientMtTable1> results = clientContext.performQuery(query);
+        assertEquals(2, results.size());
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/CayenneContextEJBQLTest.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/CayenneContextEJBQLTest.xml?rev=666071&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/CayenneContextEJBQLTest.xml
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/resources/dml/CayenneContextEJBQLTest.xml
Tue Jun 10 04:35:56 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans default-lazy-init="true">	
+	<!-- ======================================= -->
+	<!-- Named Queries -->
+	<!-- ======================================= -->
+	
+	<bean id="INSERT_MT_TABLE11" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.cayenne.testdo.mt.MtTable1</value></constructor-arg>
+		<constructor-arg><value>
+		insert into MT_TABLE1 (TABLE1_ID, GLOBAL_ATTRIBUTE1, SERVER_ATTRIBUTE1) values (1, 'g1',
's1')
+		</value></constructor-arg>
+	</bean>
+	
+	<bean id="INSERT_MT_TABLE12" class="org.apache.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.apache.cayenne.testdo.mt.MtTable1</value></constructor-arg>
+		<constructor-arg><value>
+		insert into MT_TABLE1 (TABLE1_ID, GLOBAL_ATTRIBUTE1, SERVER_ATTRIBUTE1) values (2, 'g2',
's2')
+		</value></constructor-arg>
+	</bean>
+	
+	
+	<!-- ======================================= -->
+	<!-- Data Sets -->
+	<!-- ======================================= -->	
+	<bean id="testEJBQLSelect" class="java.util.ArrayList">
+		<constructor-arg>
+			<list>
+				<ref bean="INSERT_MT_TABLE11"/>
+				<ref bean="INSERT_MT_TABLE12"/>
+			</list>
+		</constructor-arg>
+	</bean>
+</beans>
\ No newline at end of file



Mime
View raw message