cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r705994 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache: art/ art/auto/ cayenne/gen/ cayenne/testdo/generic/ cayenne/testdo/generic/auto/
Date Sun, 19 Oct 2008 12:04:30 GMT
Author: aadamchik
Date: Sun Oct 19 05:04:29 2008
New Revision: 705994

URL: http://svn.apache.org/viewvc?rev=705994&view=rev
Log:
CAY-1070 Generating Query and Procedure Access Code

fixing null packages

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Testmap.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_Testmap.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/gen/DataMapGeneratedQueryRunTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/Generic.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/_Generic.java

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Testmap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Testmap.java?rev=705994&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Testmap.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/Testmap.java
Sun Oct 19 05:04:29 2008
@@ -0,0 +1,18 @@
+package org.apache.art;
+
+import org.apache.art.auto._Testmap;
+
+public class Testmap extends _Testmap {
+
+    private static Testmap instance;
+
+    private Testmap() {}
+
+    public static Testmap getInstance() {
+        if(instance == null) {
+            instance = new Testmap();
+        }
+
+        return instance;
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_Testmap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_Testmap.java?rev=705994&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_Testmap.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_Testmap.java
Sun Oct 19 05:04:29 2008
@@ -0,0 +1,82 @@
+package org.apache.art.auto;
+
+import java.util.List;
+
+import org.apache.art.Artist;
+import org.apache.art.Gallery;
+import org.apache.art.Painting;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.query.NamedQuery;
+
+/**
+ * This class 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 class _Testmap {
+
+    public List<Painting> performObjectQuery(ObjectContext context , Artist artist)
{
+        String[] parameters = {
+            "artist",
+        };
+
+        Object[] values = {
+            artist,
+        };
+
+        return context.performQuery(new NamedQuery("ObjectQuery", parameters, values));
+    }
+
+    public List<Artist> performParameterizedQueryWithLocalCache(ObjectContext context
, String name) {
+        String[] parameters = {
+            "name",
+        };
+
+        Object[] values = {
+            name,
+        };
+
+        return context.performQuery(new NamedQuery("ParameterizedQueryWithLocalCache", parameters,
values));
+    }
+
+    public List<Artist> performParameterizedQueryWithSharedCache(ObjectContext context
, String name) {
+        String[] parameters = {
+            "name",
+        };
+
+        Object[] values = {
+            name,
+        };
+
+        return context.performQuery(new NamedQuery("ParameterizedQueryWithSharedCache", parameters,
values));
+    }
+
+    public List<Artist> performQueryWithLocalCache(ObjectContext context ) {
+        return context.performQuery(new NamedQuery("QueryWithLocalCache"));
+    }
+
+    public List<Artist> performQueryWithOrdering(ObjectContext context ) {
+        return context.performQuery(new NamedQuery("QueryWithOrdering"));
+    }
+
+    public List<Gallery> performQueryWithPrefetch(ObjectContext context ) {
+        return context.performQuery(new NamedQuery("QueryWithPrefetch"));
+    }
+
+    public List<Artist> performQueryWithQualifier(ObjectContext context , String param1)
{
+        String[] parameters = {
+            "param1",
+        };
+
+        Object[] values = {
+            param1,
+        };
+
+        return context.performQuery(new NamedQuery("QueryWithQualifier", parameters, values));
+    }
+
+    public List<Artist> performQueryWithSharedCache(ObjectContext context ) {
+        return context.performQuery(new NamedQuery("QueryWithSharedCache"));
+    }
+}
\ No newline at end of file

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/gen/DataMapGeneratedQueryRunTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/gen/DataMapGeneratedQueryRunTest.java?rev=705994&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/gen/DataMapGeneratedQueryRunTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/gen/DataMapGeneratedQueryRunTest.java
Sun Oct 19 05:04:29 2008
@@ -0,0 +1,52 @@
+/*****************************************************************
+ *   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.gen;
+
+import java.util.List;
+
+import org.apache.art.Artist;
+import org.apache.art.Testmap;
+import org.apache.cayenne.query.QueryChain;
+import org.apache.cayenne.query.SQLTemplate;
+import org.apache.cayenne.unit.CayenneCase;
+
+public class DataMapGeneratedQueryRunTest extends CayenneCase {
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        deleteTestData();
+    }
+
+    public void testPerformGeneratedQuery() {
+        QueryChain chain = new QueryChain();
+        chain.addQuery(new SQLTemplate(
+                Artist.class,
+                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (1, 'A2')"));
+        chain.addQuery(new SQLTemplate(
+                Artist.class,
+                "INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (2, 'A1')"));
+        createDataContext().performGenericQuery(chain);
+        List<Artist> result = Testmap.getInstance().performQueryWithQualifier(
+                createDataContext(),
+                "A1");
+
+        assertEquals(1, result.size());
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/Generic.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/Generic.java?rev=705994&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/Generic.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/Generic.java
Sun Oct 19 05:04:29 2008
@@ -0,0 +1,18 @@
+package org.apache.cayenne.testdo.generic;
+
+import org.apache.cayenne.testdo.generic.auto._Generic;
+
+public class Generic extends _Generic {
+
+    private static Generic instance;
+
+    private Generic() {}
+
+    public static Generic getInstance() {
+        if(instance == null) {
+            instance = new Generic();
+        }
+
+        return instance;
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/_Generic.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/_Generic.java?rev=705994&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/_Generic.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/testdo/generic/auto/_Generic.java
Sun Oct 19 05:04:29 2008
@@ -0,0 +1,12 @@
+package org.apache.cayenne.testdo.generic.auto;
+
+
+
+/**
+ * This class 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 class _Generic {
+}
\ No newline at end of file



Mime
View raw message