cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1553810 - in /cayenne/main/trunk: cayenne-client/src/test/java/org/apache/cayenne/ cayenne-client/src/test/java/org/apache/cayenne/access/ cayenne-client/src/test/java/org/apache/cayenne/query/ cayenne-client/src/test/java/org/apache/cayen...
Date Sat, 28 Dec 2013 12:04:37 GMT
Author: aadamchik
Date: Sat Dec 28 12:04:37 2013
New Revision: 1553810

URL: http://svn.apache.org/r1553810
Log:
CAY-1885 Null value in subclass's field.

test patch by Oleg Artyukevich - split by server and client modules

Added:
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/SelectQueryAbstractEntityTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass1.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass2.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass1.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass2.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass1.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass2.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass1.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass2.java
Removed:
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass.java
Modified:
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextInheritanceTest.java
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelTest.java
    cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMultiTier.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MultiTier.java
    cayenne/main/trunk/cayenne-server/src/test/resources/multi-tier.map.xml

Modified: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextInheritanceTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextInheritanceTest.java?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextInheritanceTest.java
(original)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/CayenneContextInheritanceTest.java
Sat Dec 28 12:04:37 2013
@@ -27,7 +27,7 @@ import org.apache.cayenne.query.SelectQu
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.mt.ClientMtTable1;
-import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass;
+import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1;
 import org.apache.cayenne.unit.di.client.ClientCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
@@ -61,10 +61,10 @@ public class CayenneContextInheritanceTe
 
     public void testInsertSubclass() throws Exception {
 
-        ClientMtTable1Subclass object = context.newObject(ClientMtTable1Subclass.class);
+        ClientMtTable1Subclass1 object = context.newObject(ClientMtTable1Subclass1.class);
         object.setGlobalAttribute1("sub1");
         object.setServerAttribute1("sa1");
-        object.setSubclassAttribute1("suba1");
+        object.setSubclass1Attribute1("suba1");
 
         context.commitChanges();
 
@@ -80,11 +80,11 @@ public class CayenneContextInheritanceTe
         tMtTable1.insert(2, "sub1", "zzz", "sa1");
         tMtTable1.insert(3, "1111", "aaa", null);
 
-        SelectQuery query = new SelectQuery(ClientMtTable1Subclass.class);
-        List<ClientMtTable1Subclass> objects = context.performQuery(query);
+        SelectQuery query = new SelectQuery(ClientMtTable1Subclass1.class);
+        List<ClientMtTable1Subclass1> objects = context.performQuery(query);
 
         assertEquals(1, objects.size());
-        assertEquals("sa1", objects.get(0).getSubclassAttribute1());
+        assertEquals("sa1", objects.get(0).getSubclass1Attribute1());
     }
 
     public void testPerformQueryInheritanceSuper() throws Exception {
@@ -107,8 +107,8 @@ public class CayenneContextInheritanceTe
                 checkedFields++;
             }
             else if (id == 2) {
-                assertEquals("sa1", ((ClientMtTable1Subclass) objects.get(i))
-                        .getSubclassAttribute1());
+                assertEquals("sa1", ((ClientMtTable1Subclass1) objects.get(i))
+                        .getSubclass1Attribute1());
                 checkedFields++;
             }
 
@@ -139,8 +139,8 @@ public class CayenneContextInheritanceTe
                 checkedFields++;
             }
             else if (id == 2) {
-                assertEquals("sa1", ((ClientMtTable1Subclass) objects.get(i))
-                        .getSubclassAttribute1());
+                assertEquals("sa1", ((ClientMtTable1Subclass1) objects.get(i))
+                        .getSubclass1Attribute1());
                 checkedFields++;
             }
 

Modified: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelTest.java?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelTest.java
(original)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/access/ClientServerChannelTest.java
Sat Dec 28 12:04:37 2013
@@ -41,7 +41,7 @@ import org.apache.cayenne.remote.QueryMe
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.mt.ClientMtTable1;
-import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass;
+import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1;
 import org.apache.cayenne.testdo.mt.ClientMtTable2;
 import org.apache.cayenne.testdo.mt.ClientMtTable3;
 import org.apache.cayenne.testdo.mt.MtTable1;
@@ -185,8 +185,8 @@ public class ClientServerChannelTest ext
         assertEquals(1, results.size());
 
         Object result = results.get(0);
-        assertTrue("Result is of wrong type: " + result, result instanceof ClientMtTable1Subclass);
-        ClientMtTable1Subclass clientObject = (ClientMtTable1Subclass) result;
+        assertTrue("Result is of wrong type: " + result, result instanceof ClientMtTable1Subclass1);
+        ClientMtTable1Subclass1 clientObject = (ClientMtTable1Subclass1) result;
 
         assertEquals("sub1", clientObject.getGlobalAttribute1());
     }

Added: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/SelectQueryAbstractEntityTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/SelectQueryAbstractEntityTest.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/SelectQueryAbstractEntityTest.java
(added)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/query/SelectQueryAbstractEntityTest.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,92 @@
+package org.apache.cayenne.query;
+
+import java.util.List;
+
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.test.jdbc.DBHelper;
+import org.apache.cayenne.test.jdbc.TableHelper;
+import org.apache.cayenne.testdo.mt.MtTable1;
+import org.apache.cayenne.testdo.mt.MtTable1Subclass1;
+import org.apache.cayenne.testdo.mt.MtTable1Subclass2;
+import org.apache.cayenne.unit.di.client.ClientCase;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+
+@UseServerRuntime(ClientCase.MULTI_TIER_PROJECT)
+public class SelectQueryAbstractEntityTest extends ServerCase {
+    
+    @Inject
+    private ObjectContext context;
+
+    @Inject
+    private DBHelper dbHelper;
+    
+    private TableHelper mtTable;
+    
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("MT_TABLE1");
+        
+        mtTable = new TableHelper(dbHelper, "MT_TABLE1");
+        mtTable.setColumns("TABLE1_ID", "GLOBAL_ATTRIBUTE1", "SERVER_ATTRIBUTE1", "SUBCLASS_ATTRIBUTE1");
+    }
+    
+    protected void createDataSet() throws Exception{     
+
+        for (int i = 1; i <= 10; i++){
+            mtTable.insert(i, "sub2", "sub2_" + i, "sub2attr");
+        }
+        
+        for (int i = 11; i <= 20; i++){
+            mtTable.insert(i, "sub1", "sub1_" + i, "sub1attr");
+        }
+       
+    }
+    
+    public void testSublclassEntitySelect() throws Exception{
+        createDataSet();
+        
+        SelectQuery<MtTable1Subclass1> query = 
+                new SelectQuery<MtTable1Subclass1>(MtTable1Subclass1.class);
+        final List<MtTable1Subclass1> sub1List = context.select(query);
+        
+        SelectQuery<MtTable1Subclass2> query2 = 
+                new SelectQuery<MtTable1Subclass2>(MtTable1Subclass2.class);
+        final List<MtTable1Subclass2> sub2List = context.select(query2);
+        
+        assertNotNull(sub1List);
+        assertNotNull(sub2List);
+    }
+    
+    public void test1AbstractEntitySelect() throws Exception{
+        createDataSet();
+
+        SelectQuery<MtTable1> query = new SelectQuery<MtTable1>(MtTable1.class);
+        final List<MtTable1> list = context.select(query);
+
+        assertNotNull(list);
+
+        for (MtTable1 sub : list){
+            if(sub instanceof MtTable1Subclass1){
+                assertNotNull(((MtTable1Subclass1) sub).getSubclass1Attribute1());
+            }
+        }
+    }
+    
+    public void test2AbstractEntitySelect() throws Exception{
+        createDataSet();
+        
+        SelectQuery<MtTable1> query = new SelectQuery<MtTable1>(MtTable1.class);
+        final List<MtTable1> list = context.select(query);
+        
+        assertNotNull(list);
+        
+        for (MtTable1 sub : list){
+            if(sub instanceof MtTable1Subclass2){
+                assertNotNull(((MtTable1Subclass2) sub).getSubclass2Attribute1());
+            }
+        }
+    }
+    
+}

Modified: cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorTest.java?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorTest.java
(original)
+++ cayenne/main/trunk/cayenne-client/src/test/java/org/apache/cayenne/remote/ValueInjectorTest.java
Sat Dec 28 12:04:37 2013
@@ -23,8 +23,8 @@ import org.apache.cayenne.access.DataCon
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.map.ObjEntity;
-import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass;
-import org.apache.cayenne.testdo.mt.MtTable1Subclass;
+import org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1;
+import org.apache.cayenne.testdo.mt.MtTable1Subclass1;
 import org.apache.cayenne.unit.di.client.ClientCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
@@ -35,16 +35,16 @@ public class ValueInjectorTest extends R
     protected DataContext serverContext;
 
     public void testServer() {
-        ObjEntity entity = serverContext.getEntityResolver().getObjEntity(MtTable1Subclass.class);
+        ObjEntity entity = serverContext.getEntityResolver().getObjEntity(MtTable1Subclass1.class);
         Expression qualifier = entity.getDeclaredQualifier();
 
         try {
-            MtTable1Subclass ee = serverContext.newObject(MtTable1Subclass.class);
+            MtTable1Subclass1 ee = serverContext.newObject(MtTable1Subclass1.class);
             assertEquals(ee.getGlobalAttribute1(), "sub1");
 
             // check AND
             entity.setDeclaredQualifier(qualifier.andExp(Expression.fromString("serverAttribute1
= 'sa'")));
-            ee = serverContext.newObject(MtTable1Subclass.class);
+            ee = serverContext.newObject(MtTable1Subclass1.class);
             assertEquals(ee.getGlobalAttribute1(), "sub1");
             assertEquals(ee.getServerAttribute1(), "sa");
         } finally {
@@ -54,16 +54,16 @@ public class ValueInjectorTest extends R
 
     public void testClient() {
         ObjectContext context = createROPContext();
-        ObjEntity entity = context.getEntityResolver().getObjEntity(ClientMtTable1Subclass.class);
+        ObjEntity entity = context.getEntityResolver().getObjEntity(ClientMtTable1Subclass1.class);
         Expression qualifier = entity.getDeclaredQualifier();
 
         try {
-            ClientMtTable1Subclass ee = context.newObject(ClientMtTable1Subclass.class);
+            ClientMtTable1Subclass1 ee = context.newObject(ClientMtTable1Subclass1.class);
             assertEquals(ee.getGlobalAttribute1(), "sub1");
 
             // check AND
             entity.setDeclaredQualifier(qualifier.andExp(Expression.fromString("serverAttribute1
= 'sa'")));
-            ee = context.newObject(ClientMtTable1Subclass.class);
+            ee = context.newObject(ClientMtTable1Subclass1.class);
             assertEquals(ee.getGlobalAttribute1(), "sub1");
             assertEquals(ee.getServerAttribute1(), "sa");
         } finally {

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass1.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass1.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass1.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,10 @@
+package org.apache.cayenne.testdo.mt;
+
+import org.apache.cayenne.testdo.mt.auto._ClientMtTable1Subclass1;
+
+/**
+ * A persistent class mapped as "MtTable1Subclass1" Cayenne entity.
+ */
+public class ClientMtTable1Subclass1 extends _ClientMtTable1Subclass1 {
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass2.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass2.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass2.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/ClientMtTable1Subclass2.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,10 @@
+package org.apache.cayenne.testdo.mt;
+
+import org.apache.cayenne.testdo.mt.auto._ClientMtTable1Subclass2;
+
+/**
+ * A persistent class mapped as "MtTable1Subclass2" Cayenne entity.
+ */
+public class ClientMtTable1Subclass2 extends _ClientMtTable1Subclass2 {
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass1.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass1.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass1.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,7 @@
+package org.apache.cayenne.testdo.mt;
+
+import org.apache.cayenne.testdo.mt.auto._MtTable1Subclass1;
+
+public class MtTable1Subclass1 extends _MtTable1Subclass1 {
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass2.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass2.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass2.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/MtTable1Subclass2.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,7 @@
+package org.apache.cayenne.testdo.mt;
+
+import org.apache.cayenne.testdo.mt.auto._MtTable1Subclass2;
+
+public class MtTable1Subclass2 extends _MtTable1Subclass2 {
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass1.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass1.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass1.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,41 @@
+package org.apache.cayenne.testdo.mt.auto;
+
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.testdo.mt.ClientMtTable1;
+
+/**
+ * A generated persistent class mapped as "MtTable1Subclass1" Cayenne entity. It is a good
idea to
+ * avoid changing this class manually, since it will be overwritten next time code is
+ * regenerated. If you need to make any customizations, put them in a subclass.
+ */
+public abstract class _ClientMtTable1Subclass1 extends ClientMtTable1 {
+
+    @Deprecated
+    public static final String SUBCLASS1ATTRIBUTE1_PROPERTY = "subclass1Attribute1";
+
+    public static final Property<String> SUBCLASS1ATTRIBUTE1 = new Property<String>("subclass1Attribute1");
+
+    protected String subclass1Attribute1;
+
+    public String getSubclass1Attribute1() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "subclass1Attribute1", false);
+        }
+
+        return subclass1Attribute1;
+    }
+    public void setSubclass1Attribute1(String subclass1Attribute1) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "subclass1Attribute1", false);
+        }
+
+        Object oldValue = this.subclass1Attribute1;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "subclass1Attribute1", oldValue, subclass1Attribute1);
+        }
+        
+        this.subclass1Attribute1 = subclass1Attribute1;
+    }
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass2.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass2.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass2.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMtTable1Subclass2.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,41 @@
+package org.apache.cayenne.testdo.mt.auto;
+
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.testdo.mt.ClientMtTable1;
+
+/**
+ * A generated persistent class mapped as "MtTable1Subclass2" Cayenne entity. It is a good
idea to
+ * avoid changing this class manually, since it will be overwritten next time code is
+ * regenerated. If you need to make any customizations, put them in a subclass.
+ */
+public abstract class _ClientMtTable1Subclass2 extends ClientMtTable1 {
+
+    @Deprecated
+    public static final String SUBCLASS2ATTRIBUTE1_PROPERTY = "subclass2Attribute1";
+
+    public static final Property<String> SUBCLASS2ATTRIBUTE1 = new Property<String>("subclass2Attribute1");
+
+    protected String subclass2Attribute1;
+
+    public String getSubclass2Attribute1() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "subclass2Attribute1", false);
+        }
+
+        return subclass2Attribute1;
+    }
+    public void setSubclass2Attribute1(String subclass2Attribute1) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "subclass2Attribute1", false);
+        }
+
+        Object oldValue = this.subclass2Attribute1;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "subclass2Attribute1", oldValue, subclass2Attribute1);
+        }
+        
+        this.subclass2Attribute1 = subclass2Attribute1;
+    }
+
+}

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMultiTier.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMultiTier.java?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMultiTier.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_ClientMultiTier.java
Sat Dec 28 12:04:37 2013
@@ -18,6 +18,8 @@ public class _ClientMultiTier {
 
     public static final String MT_QUERY_WITH_LOCAL_CACHE_QUERYNAME = "MtQueryWithLocalCache";
 
+    public static final String PARAMETERIZED_EJBQLMT_QUERY_QUERYNAME = "ParameterizedEJBQLMtQuery";
+
     public static final String PARAMETERIZED_MT_QUERY_WITH_LOCAL_CACHE_QUERYNAME = "ParameterizedMtQueryWithLocalCache";
 
     public List<ClientMtTable1> performAllMtTable1(ObjectContext context ) {

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass1.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass1.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass1.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass1.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,28 @@
+package org.apache.cayenne.testdo.mt.auto;
+
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.testdo.mt.MtTable1;
+
+/**
+ * Class _MtTable1Subclass1 was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public abstract class _MtTable1Subclass1 extends MtTable1 {
+
+    @Deprecated
+    public static final String SUBCLASS1ATTRIBUTE1_PROPERTY = "subclass1Attribute1";
+
+    public static final String TABLE1_ID_PK_COLUMN = "TABLE1_ID";
+
+    public static final Property<String> SUBCLASS1ATTRIBUTE1 = new Property<String>("subclass1Attribute1");
+
+    public void setSubclass1Attribute1(String subclass1Attribute1) {
+        writeProperty("subclass1Attribute1", subclass1Attribute1);
+    }
+    public String getSubclass1Attribute1() {
+        return (String)readProperty("subclass1Attribute1");
+    }
+
+}

Added: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass2.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass2.java?rev=1553810&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass2.java
(added)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MtTable1Subclass2.java
Sat Dec 28 12:04:37 2013
@@ -0,0 +1,28 @@
+package org.apache.cayenne.testdo.mt.auto;
+
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.testdo.mt.MtTable1;
+
+/**
+ * Class _MtTable1Subclass2 was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public abstract class _MtTable1Subclass2 extends MtTable1 {
+
+    @Deprecated
+    public static final String SUBCLASS2ATTRIBUTE1_PROPERTY = "subclass2Attribute1";
+
+    public static final String TABLE1_ID_PK_COLUMN = "TABLE1_ID";
+
+    public static final Property<String> SUBCLASS2ATTRIBUTE1 = new Property<String>("subclass2Attribute1");
+
+    public void setSubclass2Attribute1(String subclass2Attribute1) {
+        writeProperty("subclass2Attribute1", subclass2Attribute1);
+    }
+    public String getSubclass2Attribute1() {
+        return (String)readProperty("subclass2Attribute1");
+    }
+
+}

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MultiTier.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MultiTier.java?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MultiTier.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/testdo/mt/auto/_MultiTier.java
Sat Dec 28 12:04:37 2013
@@ -18,6 +18,8 @@ public class _MultiTier {
 
     public static final String MT_QUERY_WITH_LOCAL_CACHE_QUERYNAME = "MtQueryWithLocalCache";
 
+    public static final String PARAMETERIZED_EJBQLMT_QUERY_QUERYNAME = "ParameterizedEJBQLMtQuery";
+
     public static final String PARAMETERIZED_MT_QUERY_WITH_LOCAL_CACHE_QUERYNAME = "ParameterizedMtQueryWithLocalCache";
 
     public List<MtTable1> performAllMtTable1(ObjectContext context ) {

Modified: cayenne/main/trunk/cayenne-server/src/test/resources/multi-tier.map.xml
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/resources/multi-tier.map.xml?rev=1553810&r1=1553809&r2=1553810&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/resources/multi-tier.map.xml (original)
+++ cayenne/main/trunk/cayenne-server/src/test/resources/multi-tier.map.xml Sat Dec 28 12:04:37
2013
@@ -127,9 +127,13 @@
 		<obj-attribute name="globalAttribute1" type="java.lang.String" db-attribute-path="GLOBAL_ATTRIBUTE1"/>
 		<obj-attribute name="serverAttribute1" type="java.lang.String" db-attribute-path="SERVER_ATTRIBUTE1"/>
 	</obj-entity>
-	<obj-entity name="MtTable1Subclass" superEntityName="MtTable1" className="org.apache.cayenne.testdo.mt.MtTable1Subclass"
clientClassName="org.apache.cayenne.testdo.mt.ClientMtTable1Subclass">
+	<obj-entity name="MtTable1Subclass1" superEntityName="MtTable1" className="org.apache.cayenne.testdo.mt.MtTable1Subclass1"
clientClassName="org.apache.cayenne.testdo.mt.ClientMtTable1Subclass1">
 		<qualifier><![CDATA[globalAttribute1 = "sub1"]]></qualifier>
-		<obj-attribute name="subclassAttribute1" type="java.lang.String" db-attribute-path="SUBCLASS_ATTRIBUTE1"/>
+		<obj-attribute name="subclass1Attribute1" type="java.lang.String" db-attribute-path="SUBCLASS_ATTRIBUTE1"/>
+	</obj-entity>
+	<obj-entity name="MtTable1Subclass2" superEntityName="MtTable1" className="org.apache.cayenne.testdo.mt.MtTable1Subclass2"
clientClassName="org.apache.cayenne.testdo.mt.ClientMtTable1Subclass2">
+		<qualifier><![CDATA[globalAttribute1 = "sub2"]]></qualifier>
+		<obj-attribute name="subclass2Attribute1" type="java.lang.String" db-attribute-path="SUBCLASS_ATTRIBUTE1"/>
 	</obj-entity>
 	<obj-entity name="MtTable2" className="org.apache.cayenne.testdo.mt.MtTable2" clientClassName="org.apache.cayenne.testdo.mt.ClientMtTable2"
dbEntityName="MT_TABLE2">
 		<obj-attribute name="globalAttribute" type="java.lang.String" db-attribute-path="GLOBAL_ATTRIBUTE"/>



Mime
View raw message