db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r452272 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java
Date Tue, 03 Oct 2006 00:00:25 GMT
Author: arminw
Date: Mon Oct  2 17:00:25 2006
New Revision: 452272

URL: http://svn.apache.org/viewvc?view=rev&rev=452272
Log:
initial version, specific class for sub-select

Added:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java

Added: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java?view=auto&rev=452272
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java
(added)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSubSelectStatement.java
Mon Oct  2 17:00:25 2006
@@ -0,0 +1,54 @@
+package org.apache.ojb.broker.accesslayer.sql;
+
+/* Copyright 2002-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.
+ */
+
+import java.util.List;
+
+import org.apache.ojb.broker.platforms.Platform;
+import org.apache.ojb.broker.util.logging.Logger;
+import org.apache.ojb.broker.metadata.ClassDescriptor;
+import org.apache.ojb.broker.query.Query;
+
+/**
+ * Model a SUB-SELECT Statement
+ *
+ * @version $Id: SqlSelectStatement.java 422228 2006-07-15 16:17:29 +0200 (Sa, 15 Jul 2006)
arminw $
+ */
+public class SqlSubSelectStatement extends SqlSelectStatement
+{
+    public SqlSubSelectStatement(SqlQueryStatement parent, Platform pf, ClassDescriptor cld,
Query query, Logger logger)
+    {
+        super(parent, pf, cld, query, logger);
+    }
+
+    public SqlSubSelectStatement(Platform pf, ClassDescriptor cld, Query query, Logger logger)
+    {
+        super(pf, cld, query, logger);
+    }
+
+    protected void appendOrderByClause(List orderByFields, List selectedFields, StringBuffer
buf)
+    {
+        if(getPlatform().supportsOrderByInSubSelect())
+        {
+            super.appendOrderByClause(orderByFields, selectedFields, buf);
+        }
+        else
+        {
+            getLogger().warn("SubSelect: Use database doesn't support ORDER BY clause " +
+                    "in sub-select, execute sub-select without order by clause");
+        }
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message