cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1104646 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne: CDOOne2OneDepTest.java CDOOneDep2OneTest.java CDOReflexiveRelDeleteTest.java CDOReflexiveRelTest.java CayenneDOTestBase.java
Date Wed, 18 May 2011 00:57:54 GMT
Author: aadamchik
Date: Wed May 18 00:57:53 2011
New Revision: 1104646

URL: http://svn.apache.org/viewvc?rev=1104646&view=rev
Log:
CAY-1565 CayenneCase unit tests conversion(5)

patches by Dzmitry Kazimirchyk - CayenneDOTestBase + subclasses
removing some of the arbitrary inheritance hierarchies.. still some more remain

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOneDep2OneTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneDOTestBase.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java?rev=1104646&r1=1104645&r2=1104646&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOne2OneDepTest.java
Wed May 18 00:57:53 2011
@@ -19,14 +19,19 @@
 
 package org.apache.cayenne;
 
-import java.util.Map;
-
+import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.testdo.testmap.PaintingInfo;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
+@UseServerRuntime("cayenne-small-testmap.xml")
 public class CDOOne2OneDepTest extends CayenneDOTestBase {
-    
+
+    @Inject
+    private ObjectContext context1;
+
     public void testRollbackDependent() {
         Artist a1 = newArtist();
         Painting p1 = newPainting();
@@ -34,13 +39,13 @@ public class CDOOne2OneDepTest extends C
         // needed to save without errors
         p1.setToArtist(a1);
         context.commitChanges();
-        
+
         PaintingInfo info = context.newObject(PaintingInfo.class);
         info.setTextReview("XXX");
         p1.setToPaintingInfo(info);
-        
+
         assertSame(info, p1.getToPaintingInfo());
-        
+
         context.rollbackChanges();
         assertNull(p1.getToPaintingInfo());
     }
@@ -52,7 +57,7 @@ public class CDOOne2OneDepTest extends C
         // needed to save without errors
         p1.setToArtist(a1);
         context.commitChanges();
-        context = createDataContext();
+        context = context1;
 
         // test database data
         Painting p2 = fetchPainting();
@@ -68,7 +73,7 @@ public class CDOOne2OneDepTest extends C
         // needed to save without errors
         p1.setToArtist(a1);
         context.commitChanges();
-        context = createDataContext();
+        context = context1;
 
         // test database data
         Painting p2 = fetchPainting();
@@ -87,16 +92,16 @@ public class CDOOne2OneDepTest extends C
         // needed to save without errors
         p1.setToArtist(a1);
 
-        // *** TESTING THIS *** 
+        // *** TESTING THIS ***
         p1.setToPaintingInfo(pi1);
 
         // test before save
         assertSame(pi1, p1.getToPaintingInfo());
         assertSame(p1, pi1.getPainting());
 
-        // do save 
+        // do save
         context.commitChanges();
-        context = createDataContext();
+        context = context1;
 
         // test database data
         Painting p2 = fetchPainting();
@@ -110,18 +115,18 @@ public class CDOOne2OneDepTest extends C
         Artist a1 = newArtist();
         PaintingInfo pi1 = newPaintingInfo();
         Painting p1 = newPainting();
-        
+
         p1.setToArtist(a1);
         p1.setToPaintingInfo(pi1);
         context.commitChanges();
-        
-        context = createDataContext();
+
+        context = context1;
         Painting painting = fetchPainting();
 
         assertTrue(painting.readPropertyDirectly("toPaintingInfo") instanceof Fault);
 
-        // test that taking a snapshot does not trigger a fault, and generally works well

-        Map snapshot = context.currentSnapshot(painting);
+        // test that taking a snapshot does not trigger a fault, and generally works well
+        DataRow snapshot = ((DataContext) context).currentSnapshot(painting);
 
         assertEquals(paintingName, snapshot.get("PAINTING_TITLE"));
         assertTrue(painting.readPropertyDirectly("toPaintingInfo") instanceof Fault);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOneDep2OneTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOneDep2OneTest.java?rev=1104646&r1=1104645&r2=1104646&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOneDep2OneTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOOneDep2OneTest.java
Wed May 18 00:57:53 2011
@@ -19,16 +19,24 @@
 
 package org.apache.cayenne;
 
+import java.sql.Timestamp;
+
 import org.apache.cayenne.access.types.ByteArrayTypeTest;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.ArtistExhibit;
 import org.apache.cayenne.testdo.testmap.Exhibit;
 import org.apache.cayenne.testdo.testmap.Gallery;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.testdo.testmap.PaintingInfo;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
+@UseServerRuntime("cayenne-small-testmap.xml")
 public class CDOOneDep2OneTest extends CayenneDOTestBase {
 
+    @Inject
+    private ObjectContext context1;
+
     public void testNewAdd1() throws Exception {
         Artist a1 = newArtist();
         PaintingInfo pi1 = newPaintingInfo();
@@ -46,7 +54,7 @@ public class CDOOneDep2OneTest extends C
 
         // do save
         context.commitChanges();
-        context = createDataContext();
+        context = context1;
 
         // test database data
         PaintingInfo pi2 = fetchPaintingInfo();
@@ -58,15 +66,18 @@ public class CDOOneDep2OneTest extends C
     /** Tests how primary key is propagated from one new object to another. */
     public void testNewAdd2() throws Exception {
         Artist a1 = this.newArtist();
-        Gallery g1 = this.newGallery();
-        Exhibit e1 = this.newExhibit(g1);
+        Gallery g1 = context.newObject(Gallery.class);
+        g1.setGalleryName(galleryName);
+
+        Exhibit e1 = context.newObject(Exhibit.class);
+        e1.setOpeningDate(new Timestamp(System.currentTimeMillis()));
+        e1.setClosingDate(new Timestamp(System.currentTimeMillis()));
+        e1.setToGallery(g1);
 
-        ArtistExhibit ae1 = this.newArtistExhibit();
+        ArtistExhibit ae1 = context.newObject(ArtistExhibit.class);
         ae1.setToArtist(a1);
         ae1.setToExhibit(e1);
 
-        // do save
-
         // *** TESTING THIS ***
         context.commitChanges();
     }
@@ -89,7 +100,7 @@ public class CDOOneDep2OneTest extends C
 
         // do save
         context.commitChanges();
-        context = createDataContext();
+        context = context1;
 
         // test database data
         PaintingInfo pi2 = fetchPaintingInfo();
@@ -115,7 +126,7 @@ public class CDOOneDep2OneTest extends C
         // do save II
         context.commitChanges();
         ObjectId pi2oid = pi2.getObjectId();
-        context = createDataContext();
+        context = context1;
 
         PaintingInfo pi3 = fetchPaintingInfo();
         Painting p3 = pi3.getPainting();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteTest.java?rev=1104646&r1=1104645&r2=1104646&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelDeleteTest.java
Wed May 18 00:57:53 2011
@@ -19,32 +19,38 @@
 
 package org.apache.cayenne;
 
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.ArtGroup;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-public class CDOReflexiveRelDeleteTest extends CayenneDOTestBase {
+@UseServerRuntime("cayenne-small-testmap.xml")
+public class CDOReflexiveRelDeleteTest extends ServerCase {
 
+    @Inject
+    private ObjectContext context;
+    
     private ArtGroup parentGroup;
     private ArtGroup childGroup1;
     private ArtGroup childGroup2;
     private ArtGroup childGroup3;
 
     @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        context = createDataContext();
+    protected void setUpAfterInjection() throws Exception {
+        super.setUpAfterInjection();
 
-        parentGroup = (ArtGroup) context.newObject("ArtGroup");
+        parentGroup = context.newObject(ArtGroup.class);
         parentGroup.setName("parent");
 
-        childGroup1 = (ArtGroup) context.newObject("ArtGroup");
+        childGroup1 = context.newObject(ArtGroup.class);
         childGroup1.setName("child1");
         childGroup1.setToParentGroup(parentGroup);
 
-        childGroup2 = (ArtGroup) context.newObject("ArtGroup");
+        childGroup2 = context.newObject(ArtGroup.class);
         childGroup2.setName("child2");
         childGroup2.setToParentGroup(parentGroup);
 
-        childGroup3 = (ArtGroup) context.newObject("ArtGroup");
+        childGroup3 = context.newObject(ArtGroup.class);
         childGroup3.setName("subchild");
         childGroup3.setToParentGroup(childGroup1);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelTest.java?rev=1104646&r1=1104645&r2=1104646&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOReflexiveRelTest.java
Wed May 18 00:57:53 2011
@@ -19,117 +19,102 @@
 
 package org.apache.cayenne;
 
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.ArtGroup;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
 /**
  * Some more tests regarding reflexive relationships, especially related to delete rules
- * etc.  The implementation is hairy, and so needs a really good workout.
+ * etc. The implementation is hairy, and so needs a really good workout.
  */
-public class CDOReflexiveRelTest extends CayenneDOTestBase {
+@UseServerRuntime("cayenne-small-testmap.xml")
+public class CDOReflexiveRelTest extends ServerCase {
 
-	private void failWithException(Exception e) {
-			e.printStackTrace();
-			fail("Should not have thrown an exception :"+e.getMessage());
-	}
-
-	public void testAddDeleteNoCommit() {
-		ArtGroup parentGroup=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup.setName("parent");
-
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup);
-
-		try {
-			context.deleteObject(parentGroup);
-		} catch (Exception e) {
-			this.failWithException(e);
-		}
-	}
-	
-	public void testAddDeleteWithCommit() {
-		ArtGroup parentGroup=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup.setName("parent");
-
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup);
-		context.commitChanges();
-
-		try {
-			context.deleteObject(parentGroup);
-			context.commitChanges();
-		} catch (Exception e) {
-			this.failWithException(e);
-		}
-		
-	}
-	
-	public void testReplaceDeleteNoCommit() {
-		ArtGroup parentGroup1=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup1.setName("parent1");
-		ArtGroup parentGroup2=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup2.setName("parent2");
-
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup1);
-
-
-		childGroup1.setToParentGroup(parentGroup2);
-		try {
-			context.deleteObject(parentGroup1);
-			context.deleteObject(parentGroup2);
-		} catch (Exception e) {
-			this.failWithException(e);
-		}		
-	}
-	
-	public void testReplaceDeleteWithCommit() {
-		ArtGroup parentGroup1=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup1.setName("parent1");
-		ArtGroup parentGroup2=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup2.setName("parent2");
-
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup1);
-		childGroup1.setToParentGroup(parentGroup2);
-		context.commitChanges();
-
-		try {
-			context.deleteObject(parentGroup1);
-			context.deleteObject(parentGroup2);
-			context.commitChanges();
-		} catch (Exception e) {
-			this.failWithException(e);
-		}		
-	}
-	
-	public void testCommitReplaceCommit() {
-		ArtGroup parentGroup1=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup1.setName("parent1");
-		ArtGroup parentGroup2=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup2.setName("parent2");
-
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup1);
-		context.commitChanges();
-		childGroup1.setToParentGroup(parentGroup2);
-		context.commitChanges();
-	}
-
-	public void testComplexInsertUpdateOrdering() {
-		ArtGroup parentGroup=(ArtGroup)context.newObject("ArtGroup");
-		parentGroup.setName("parent");
-		context.commitChanges();
-		
-		//Check that the update and insert both work write
-		ArtGroup childGroup1=(ArtGroup)context.newObject("ArtGroup");
-		childGroup1.setName("child1");
-		childGroup1.setToParentGroup(parentGroup);
-		context.commitChanges();
-	}
+    @Inject
+    private ObjectContext context;
+
+    public void testAddDeleteNoCommit() {
+        ArtGroup parentGroup = context.newObject(ArtGroup.class);
+        parentGroup.setName("parent");
+
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup);
+
+        context.deleteObject(parentGroup);
+    }
+
+    public void testAddDeleteWithCommit() {
+        ArtGroup parentGroup = context.newObject(ArtGroup.class);
+        parentGroup.setName("parent");
+
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup);
+        context.commitChanges();
+
+        context.deleteObject(parentGroup);
+        context.commitChanges();
+    }
+
+    public void testReplaceDeleteNoCommit() {
+        ArtGroup parentGroup1 = context.newObject(ArtGroup.class);
+        parentGroup1.setName("parent1");
+        ArtGroup parentGroup2 = context.newObject(ArtGroup.class);
+        parentGroup2.setName("parent2");
+
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup1);
+
+        childGroup1.setToParentGroup(parentGroup2);
+
+        context.deleteObject(parentGroup1);
+        context.deleteObject(parentGroup2);
+    }
+
+    public void testReplaceDeleteWithCommit() {
+        ArtGroup parentGroup1 = context.newObject(ArtGroup.class);
+        parentGroup1.setName("parent1");
+        ArtGroup parentGroup2 = context.newObject(ArtGroup.class);
+        parentGroup2.setName("parent2");
+
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup1);
+        childGroup1.setToParentGroup(parentGroup2);
+        context.commitChanges();
+
+        context.deleteObject(parentGroup1);
+        context.deleteObject(parentGroup2);
+        context.commitChanges();
+    }
+
+    public void testCommitReplaceCommit() {
+        ArtGroup parentGroup1 = context.newObject(ArtGroup.class);
+        parentGroup1.setName("parent1");
+        ArtGroup parentGroup2 = context.newObject(ArtGroup.class);
+        parentGroup2.setName("parent2");
+
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup1);
+        context.commitChanges();
+        childGroup1.setToParentGroup(parentGroup2);
+        context.commitChanges();
+    }
+
+    public void testComplexInsertUpdateOrdering() {
+        ArtGroup parentGroup = context.newObject(ArtGroup.class);
+        parentGroup.setName("parent");
+        context.commitChanges();
+
+        // Check that the update and insert both work write
+        ArtGroup childGroup1 = context.newObject(ArtGroup.class);
+        childGroup1.setName("child1");
+        childGroup1.setToParentGroup(parentGroup);
+        context.commitChanges();
+    }
 
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneDOTestBase.java?rev=1104646&r1=1104645&r2=1104646&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CayenneDOTestBase.java
Wed May 18 00:57:53 2011
@@ -19,24 +19,17 @@ package org.apache.cayenne;
  *  under the License.
  ****************************************************************/
 
-import java.sql.Timestamp;
 import java.util.List;
 
-import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
-import org.apache.cayenne.testdo.testmap.ArtistExhibit;
-import org.apache.cayenne.testdo.testmap.Exhibit;
-import org.apache.cayenne.testdo.testmap.Gallery;
 import org.apache.cayenne.testdo.testmap.Painting;
 import org.apache.cayenne.testdo.testmap.PaintingInfo;
 import org.apache.cayenne.unit.di.server.ServerCase;
-import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-@UseServerRuntime("cayenne-small-testmap.xml")
 public abstract class CayenneDOTestBase extends ServerCase {
 
     public static final String artistName = "artist with one painting";
@@ -49,80 +42,40 @@ public abstract class CayenneDOTestBase 
     };
 
     @Inject
-    protected DataContext context;
-    
+    protected ObjectContext context;
+
     @Inject
     private DBHelper dbHelper;
 
     @Override
     protected void setUpAfterInjection() throws Exception {
         dbHelper.deleteAll("ARTIST_EXHIBIT");
-        dbHelper.deleteAll("EXHIBIT");
-        dbHelper.deleteAll("GALLERY");
         dbHelper.deleteAll("PAINTING_INFO");
         dbHelper.deleteAll("PAINTING");
         dbHelper.deleteAll("ARTIST");
-    }
-
-    protected Exhibit newExhibit(Gallery gallery) {
-        Exhibit e1 = (Exhibit) context.newObject("Exhibit");
-        e1.setOpeningDate(new Timestamp(System.currentTimeMillis()));
-        e1.setClosingDate(new Timestamp(System.currentTimeMillis()));
-        e1.setToGallery(gallery);
-        return e1;
-    }
-
-    protected ArtistExhibit newArtistExhibit() {
-        return (ArtistExhibit) context.newObject("ArtistExhibit");
-    }
-
-    protected Gallery newGallery() {
-        Gallery g1 = (Gallery) context.newObject("Gallery");
-        g1.setGalleryName(galleryName);
-        return g1;
+        dbHelper.deleteAll("EXHIBIT");
+        dbHelper.deleteAll("GALLERY");
     }
 
     protected Artist newArtist() {
-        Artist a1 = (Artist) context.newObject("Artist");
+        Artist a1 = context.newObject(Artist.class);
         a1.setArtistName(artistName);
         return a1;
     }
 
-    protected Painting newROPainting() {
-        Painting p1 = (Painting) context.newObject("ROPainting");
-        p1.setPaintingTitle(paintingName);
-        return p1;
-    }
-
     protected Painting newPainting() {
-        Painting p1 = (Painting) context.newObject("Painting");
+        Painting p1 = context.newObject(Painting.class);
         p1.setPaintingTitle(paintingName);
         return p1;
     }
 
     protected PaintingInfo newPaintingInfo() {
-        PaintingInfo p1 = (PaintingInfo) context.newObject("PaintingInfo");
+        PaintingInfo p1 = context.newObject(PaintingInfo.class);
         p1.setTextReview(textReview);
         p1.setImageBlob(paintingImage);
         return p1;
     }
 
-    protected Gallery fetchGallery() {
-        SelectQuery q = new SelectQuery("Gallery", ExpressionFactory.matchExp(
-                "galleryName",
-                galleryName));
-        List<?> gls = context.performQuery(q);
-        return (gls.size() > 0) ? (Gallery) gls.get(0) : null;
-    }
-
-    protected Artist fetchArtist() {
-        SelectQuery q = new SelectQuery("Artist", ExpressionFactory.matchExp(
-                "artistName",
-                artistName));
-        List<?> ats = context.performQuery(q);
-        return (ats.size() > 0) ? (Artist) ats.get(0) : null;
-    }
-
     protected Painting fetchPainting() {
         SelectQuery q = new SelectQuery("Painting", ExpressionFactory.matchExp(
                 "paintingTitle",



Mime
View raw message