You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/04/08 22:45:48 UTC
svn commit: r1465778 - in /jena/Experimental/jena-jdbc:
jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/
jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/
jena-jdbc-core/src/test/java/org/apache/jena/jdbc/conne...
Author: rvesse
Date: Mon Apr 8 20:45:48 2013
New Revision: 1465778
URL: http://svn.apache.org/r1465778
Log:
Dependency scope fix, other minor fixes
Added:
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/CommandPreProcessor.java
Modified:
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/ByteColumn.java
jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/pom.xml
Added: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/CommandPreProcessor.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/CommandPreProcessor.java?rev=1465778&view=auto
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/CommandPreProcessor.java (added)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/preprocessing/CommandPreProcessor.java Mon Apr 8 20:45:48 2013
@@ -0,0 +1,68 @@
+/**
+ * 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.jena.jdbc.preprocessing;
+
+import java.sql.Statement;
+
+import com.hp.hpl.jena.query.Query;
+import com.hp.hpl.jena.update.UpdateRequest;
+
+/**
+ * Interface for command pre-processors
+ * <p>
+ * Pre-processors provide an extension point within Jena JDBC which allows for
+ * arbitrary manipulation of the incoming command text and the parsed SPARQL
+ * queries and updates to be carried out. The intention of this is to provide a
+ * mechanism by which users can modify the behavior of the module to deal with
+ * any peculiarities in behavior that particular JDBC based tools may exhibit
+ * when attempting to use them with Jena JDBC drivers.
+ * </p>
+ *
+ */
+public interface CommandPreProcessor {
+
+ /**
+ * Pre-process incoming command text
+ * <p>
+ * This is invoked before Jena JDBC has attempted to determine whether the text is a query/update. This allows an application to do textual clean up/alteration of the incoming command if it so desires.
+ * </p>
+ * @param text Command Text
+ * @return Command Text which may have been altered
+ */
+ public String preProcessCommandText(String text);
+
+ /**
+ * Pre-process a query
+ * <p>
+ * This is invoked during query execution prior to Jena JDBC making any of its own manipulations on the query e.g. using {@link Statement#setMaxRows(int)} to add a {@code LIMIT} clause.
+ * </p>
+ * @param q Query
+ * @return Query which may have been altered
+ */
+ public Query preProcessQuery(Query q);
+
+ /**
+ * Pre-process an update
+ * <p>
+ * This is invoked during update execution prior to Jena JDBC making any of its own manipulations on the update.
+ * </p>
+ * @param u Update
+ * @return Update which may have been altered
+ */
+ public UpdateRequest preProcessUpdate(UpdateRequest u);
+}
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/ByteColumn.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/ByteColumn.java?rev=1465778&r1=1465777&r2=1465778&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/ByteColumn.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/results/metadata/columns/ByteColumn.java Mon Apr 8 20:45:48 2013
@@ -1,5 +1,19 @@
-/*
- * Copyright 2013 YarcData LLC All Rights Reserved.
+/**
+ * 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.jena.jdbc.results.metadata.columns;
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java?rev=1465778&r1=1465777&r2=1465778&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/test/java/org/apache/jena/jdbc/connections/AbstractJenaConnectionTests.java Mon Apr 8 20:45:48 2013
@@ -457,7 +457,7 @@ public abstract class AbstractJenaConnec
ResultSetMetaData metadata = results.getMetaData();
Assert.assertEquals(1, metadata.getColumnCount());
Assert.assertEquals(Boolean.class.getCanonicalName(), metadata.getColumnClassName(1));
- Assert.assertEquals(Boolean.class.getCanonicalName(), metadata.getColumnTypeName(1));
+ Assert.assertEquals(Node.class.getCanonicalName(), metadata.getColumnTypeName(1));
Assert.assertEquals(Types.BOOLEAN, metadata.getColumnType(1));
}
Modified: jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/pom.xml
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/pom.xml?rev=1465778&r1=1465777&r2=1465778&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/pom.xml (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-driver-remote/pom.xml Mon Apr 8 20:45:48 2013
@@ -26,6 +26,7 @@
<artifactId>jena-jdbc-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<classifier>tests</classifier>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>