roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r440513 - /incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java
Date Tue, 05 Sep 2006 22:24:42 GMT
Author: clr
Date: Tue Sep  5 15:24:41 2006
New Revision: 440513

URL: http://svn.apache.org/viewvc?view=rev&rev=440513
Log:
Datamapper JDOQueryImpl

Added:
    incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java

Added: incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java?view=auto&rev=440513
==============================================================================
--- incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java
(added)
+++ incubator/roller/branches/roller_3.0/sandbox/jdobackend/src/org/apache/roller/business/jdo/JDOQueryImpl.java
Tue Sep  5 15:24:41 2006
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ * 
+ * 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.apache.roller.business.jdo;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.Query;
+
+import org.apache.roller.business.datamapper.DatamapperQuery;
+
+/**
+ *
+ */
+public class JDOQueryImpl implements DatamapperQuery {
+
+    /** */
+    protected PersistenceManager pm;
+
+    /** */
+    protected Query q;
+    
+    /** Creates a new instance of JDOQueryImpl */
+    public JDOQueryImpl(PersistenceManager pm,
+            Class clazz, String queryName) {
+        this.pm = pm;
+        q = pm.newQuery(clazz, queryName);
+    }
+
+    public Object execute() {
+        return q.execute();
+    }
+
+    public Object execute(Object param) {
+        return q.execute(param);
+    }
+
+    public Object execute(Object[] params) {
+        return q.execute(params);
+    }
+
+    public void removeAll() {
+        q.deletePersistentAll();
+    }
+
+    public void removeAll(Object param) {
+        q.deletePersistentAll(new Object[]{param});
+    }
+
+    public void removeAll(Object[] params) {
+        q.deletePersistentAll(params);
+    }
+
+    public DatamapperQuery setUnique() {
+        q.setUnique(true);
+        return this;
+    }
+
+    public DatamapperQuery setTypes(Object[] types) {
+        return this;
+    }
+
+    public DatamapperQuery setRange(long fromIncl, long toExcl) {
+        q.setRange(fromIncl, toExcl);
+        return this;
+    }
+    
+}



Mime
View raw message