teiid SVN: r912 - in trunk/engine/src: main/java/com/metamatrix/query/processor/proc and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 23:17:43 -0400 (Mon, 11 May 2009)
New Revision: 912
Modified:
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java
trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
trunk/engine/src/main/java/com/metamatrix/query/rewriter/VariableSubstitutionVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Command.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
Log:
TEIID-574 removing the use of variable values on commands
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -307,28 +307,6 @@
if (patternElements == null) {
return false;
}
- Command command = (Command)node.getProperty(NodeConstants.Info.NESTED_COMMAND);
-
- // check for input values that have been set by the resolver
- if (command != null) {
- Map values = command.getVariableValues();
-
- if (values != null) {
- List ids = new LinkedList();
- for (Iterator i = values.keySet().iterator(); i.hasNext();) {
- String elementName = (String)i.next();
- Object id = metadata.getElementID(elementName);
- ids.add(id);
- }
-
- List elements = ResolverUtil.resolveElements(command.getVirtualGroup(), metadata, ids);
-
- if (RulePushSelectCriteria.satisfyAccessPatterns(patternElements, elements)) {
- return false;
- }
- }
- }
-
Collections.sort(patternElements);
node.setProperty(NodeConstants.Info.ACCESS_PATTERNS, patternElements);
return true;
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -162,7 +162,6 @@
Command command = QueryParser.getQueryParser().parseCommand(value.toString());
command.setExternalGroupContexts(dynamicCommand.getExternalGroupContexts());
command.setTemporaryMetadata(dynamicCommand.getTemporaryMetadata());
- command.setVariableValues(new HashMap(dynamicCommand.getVariableValues()));
updateContextWithUsingValues(procEnv, localContext);
Map tempMetadata = command.getTemporaryMetadata();
@@ -188,11 +187,10 @@
// create a new set of variables including vars
Map nameValueMap = createVariableValuesMap(localContext);
- command.getVariableValues().putAll(nameValueMap);
-
+ nameValueMap.putAll(QueryResolver.getVariableValues(parentProcCommand.getUserCommand(), metadata));
// validation visitor?
- VariableSubstitutionVisitor.substituteVariables(command, command.getVariableValues(), command.getType());
+ VariableSubstitutionVisitor.substituteVariables(command, nameValueMap, command.getType());
QueryRewriter.rewrite(command, parentProcCommand, metadata,
procEnv.getContext());
@@ -352,7 +350,6 @@
.getCanonicalName(), new Constant(entry.getValue()));
}
- nameValueMap.putAll(dynamicCommand.getVariableValues());
return nameValueMap;
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/rewriter/VariableSubstitutionVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/rewriter/VariableSubstitutionVisitor.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/main/java/com/metamatrix/query/rewriter/VariableSubstitutionVisitor.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -84,21 +84,6 @@
this.commandType = commandType;
}
- // ############### Visitor methods for language objects ##################
-
- public void visit(Insert obj) {
- super.visit(obj);
- obj.getVariableValues().putAll(getVariableValues());
- }
-
- /**
- * @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.lang.DynamicCommand)
- */
- public void visit(DynamicCommand obj) {
- super.visit(obj);
- obj.getVariableValues().putAll(getVariableValues());
- }
-
public void visit(XQuery obj) {
obj.getCompiledXQuery().setParameters(getVariableValues());
}
@@ -117,21 +102,8 @@
}
}
obj.setChangeList(newChangeList);
- obj.getVariableValues().putAll(getVariableValues());
}
- public void visit(SetQuery obj) {
- obj.getVariableValues().putAll(getVariableValues());
- }
-
- public void visit(Query obj) {
- obj.getVariableValues().putAll(getVariableValues());
- }
-
- public void visit(Delete obj) {
- obj.getVariableValues().putAll(getVariableValues());
- }
-
/**
* Checks variables in an expression, if the variables are INPUT variables and if
* none of them are changing, then this method returns a false, if all of them
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Command.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Command.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Command.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -107,10 +107,8 @@
public static final int TYPE_DROP = 12;
- private static List updateCommandSymbol = null;
+ private static List updateCommandSymbol;
- private static List updatesCommandSymbol = null;
-
/**
* All temporary group IDs discovered while resolving this
* command. The key is a TempMetadataID and the value is an
@@ -118,18 +116,12 @@
*/
protected Map tempGroupIDs;
- private transient GroupContext externalGroups = null;
+ private transient GroupContext externalGroups;
- private boolean isResolved = false;
+ private boolean isResolved;
private GroupSymbol virtualGroup;
- /**
- * holds variable values found during resolution until they can be used during processing
- */
- private Map variableValues = new HashMap();
-
-
/** The option clause */
private Option option;
@@ -238,10 +230,6 @@
}
copy.setVirtualGroup(getVirtualGroup());
- if (variableValues != null) {
- copy.setVariableValues(new HashMap(variableValues));
- }
-
copy.setIsResolved(this.isResolved());
copy.plan = this.plan;
if (this.correlatedReferences != null) {
@@ -326,15 +314,6 @@
return updateCommandSymbol;
}
- public static List getUpdatesCommandSymbol() {
- if (updatesCommandSymbol == null ) {
- ElementSymbol symbol = new ElementSymbol("Counts"); //$NON-NLS-1$
- symbol.setType(int[].class);
- updatesCommandSymbol = Arrays.asList(new ElementSymbol[] {symbol});
- }
- return updatesCommandSymbol;
- }
-
/**
* Return the number of updates on physical sources by this command.
* @param metadata QueryMetadataInterface
@@ -370,14 +349,6 @@
this.virtualGroup = virtualGroup;
}
- public Map getVariableValues() {
- return variableValues;
- }
-
- public void setVariableValues(Map parameters) {
- this.variableValues = parameters;
- }
-
public ProcessorPlan getProcessorPlan() {
return this.plan;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -311,13 +310,9 @@
}
//ensure that the user command is distinct from the processing command
//rewrite and planning may alter options, symbols, etc.
-
- //TODO clone after the resolve - but that doesn't currently work for exec resolving
- this.userCommand = (Command)command.clone();
-
- QueryResolver.resolveCommand(this.userCommand, Collections.emptyMap(), false, metadata, analysisRecord);
-
QueryResolver.resolveCommand(command, metadata, analysisRecord);
+
+ this.userCommand = (Command)command.clone();
}
private void validateQuery(Command command, boolean validateVisibility)
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-05-11 22:00:47 UTC (rev 911)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java 2009-05-12 03:17:43 UTC (rev 912)
@@ -1321,15 +1321,15 @@
helpTestProcess(plan, expected, dataMgr);
}
- //procedure with Has Criteria and Translate Criteria
+ //procedure with Has Criteria and Translate Criteria and changing
public void testDynamicCommandWithTranslate() throws Exception {
String procedure = "CREATE PROCEDURE "; //$NON-NLS-1$
procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
procedure = procedure + "DECLARE integer var1;\n"; //$NON-NLS-1$
procedure = procedure + "IF(HAS CRITERIA ON (vm1.g4.e2))\n"; //$NON-NLS-1$
procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
- procedure = procedure + "execute string 'Select pm1.g1.e2 from pm1.g1 where TRANSLATE = CRITERIA ON (vm1.g4.e2)' as x integer into #temp;\n"; //$NON-NLS-1$
- procedure = procedure + "var1 = select * from #temp;\n"; //$NON-NLS-1$
+ procedure = procedure + "execute string 'Select pm1.g1.e2 x, changing.e1 y from pm1.g1 where TRANSLATE = CRITERIA ON (vm1.g4.e2)' as x integer, y boolean into #temp;\n"; //$NON-NLS-1$
+ procedure = procedure + "var1 = select x from #temp;\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
procedure = procedure + "if(var1 = 5)\n"; //$NON-NLS-1$
procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
14 years, 10 months
teiid SVN: r911 - in trunk: connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 18:00:47 -0400 (Mon, 11 May 2009)
New Revision: 911
Added:
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Capabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Translator.java
Modified:
trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLTranslator.java
trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java
Log:
TEIID-105 adding mysql support for bit operations and creating a mysql 5 specific translator/capabilities.
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java 2009-05-11 21:39:16 UTC (rev 910)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -22,8 +22,11 @@
package org.teiid.connector.visitor.util;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.language.IAggregate;
@@ -81,6 +84,9 @@
*/
public class SQLStringVisitor extends AbstractLanguageVisitor implements SQLReservedWords {
+ private Set<String> infixFunctions = new HashSet<String>(Arrays.asList("%", "+", "-", "*", "+", "/", "||", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "&", "~", "|", "^")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
private static final String ESCAPED_QUOTE = "''"; //$NON-NLS-1$
protected static final String UNDEFINED = "<undefined>"; //$NON-NLS-1$
@@ -388,6 +394,10 @@
.append(SPACE);
append(obj.getItems());
}
+
+ protected boolean isInfixFunction(String function) {
+ return infixFunctions.contains(function);
+ }
/**
* @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.connector.language.IFunction)
@@ -415,7 +425,7 @@
}
buffer.append(typeValue);
buffer.append(RPAREN);
- } else if(name.equals("%") || name.equals("+") || name.equals("-") || name.equals("*") || name.equals("/") || name.equals("||")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ } else if(isInfixFunction(name)) {
buffer.append(LPAREN);
if(args != null) {
Added: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Capabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Capabilities.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Capabilities.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.jdbc.mysql;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.connector.api.SourceSystemFunctions;
+
+
+
+/**
+ * @since 4.3
+ */
+public class MySQL5Capabilities extends MySQLCapabilities {
+
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+}
Property changes on: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Capabilities.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Translator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Translator.java (rev 0)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Translator.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.jdbc.mysql;
+
+import org.teiid.connector.api.ConnectorCapabilities;
+
+public class MySQL5Translator extends MySQLTranslator {
+
+ @Override
+ public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
+ return MySQL5Capabilities.class;
+ }
+
+}
Property changes on: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQL5Translator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLCapabilities.java 2009-05-11 21:39:16 UTC (rev 910)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLCapabilities.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -22,9 +22,10 @@
package org.teiid.connector.jdbc.mysql;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.List;
+import org.teiid.connector.api.SourceSystemFunctions;
import org.teiid.connector.jdbc.JDBCCapabilities;
@@ -34,246 +35,236 @@
*/
public class MySQLCapabilities extends JDBCCapabilities {
- public List getSupportedFunctions() {
- List supportedFunctions = new ArrayList();
- supportedFunctions.addAll(super.getSupportedFunctions());
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ supportedFunctions.add(SourceSystemFunctions.CEILING);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LOG10);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.POWER);
+ supportedFunctions.add(SourceSystemFunctions.RADIANS);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.SIGN);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+
+ supportedFunctions.add(SourceSystemFunctions.ASCII);
+ supportedFunctions.add(SourceSystemFunctions.CHAR);
+ supportedFunctions.add(SourceSystemFunctions.CONCAT);
+ supportedFunctions.add(SourceSystemFunctions.INSERT);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LEFT);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.REPEAT);
+ supportedFunctions.add(SourceSystemFunctions.REPLACE);
+ supportedFunctions.add(SourceSystemFunctions.RIGHT);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+
+ // These are executed within the server and never pushed down
+// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+// supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.DAYNAME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.QUARTER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ supportedFunctions.add(SourceSystemFunctions.WEEK);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.IFNULL);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+
+// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
+// supportedFunctions.add("ISNULL"); //$NON-NLS-1$
+// supportedFunctions.add("LEAST"); //$NON-NLS-1$
+// supportedFunctions.add("STRCMP"); // String-specific //$NON-NLS-1$
+//
+// // String
+// supportedFunctions.add("BIN"); //$NON-NLS-1$
+// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("COMPRESS"); //$NON-NLS-1$
+// supportedFunctions.add("CONCAT_WS"); //$NON-NLS-1$
+// supportedFunctions.add("CONV"); //$NON-NLS-1$
+// supportedFunctions.add("ELT"); //$NON-NLS-1$
+// supportedFunctions.add("EXPORT_SET"); //$NON-NLS-1$
+// supportedFunctions.add("FIELD"); //$NON-NLS-1$
+// supportedFunctions.add("FIND_IN_SET"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("HEX"); //$NON-NLS-1$
+// supportedFunctions.add("INSTR"); //$NON-NLS-1$
+// supportedFunctions.add("LOAD_FILE"); //$NON-NLS-1$
+// supportedFunctions.add("MAKE_SET"); //$NON-NLS-1$
+// supportedFunctions.add("MID"); //$NON-NLS-1$
+// supportedFunctions.add("OCT"); //$NON-NLS-1$
+// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("ORD"); //$NON-NLS-1$
+// supportedFunctions.add("QUOTE"); //$NON-NLS-1$
+// supportedFunctions.add("REVERSE"); //$NON-NLS-1$
+// supportedFunctions.add("SOUNDEX"); //$NON-NLS-1$
+// supportedFunctions.add("SPACE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
+// supportedFunctions.add("SUBSTRING_INDEX"); //$NON-NLS-1$
+// supportedFunctions.add("TRIM"); //$NON-NLS-1$
+// supportedFunctions.add("UNCOMPRESS"); //$NON-NLS-1$
+// supportedFunctions.add("UNHEX"); //$NON-NLS-1$
+//
+// // Math
+// supportedFunctions.add("CEIL"); //$NON-NLS-1$
+// supportedFunctions.add("CRC32"); //$NON-NLS-1$
+// // DIV is an operator equivalent to '/'
+// supportedFunctions.add("DIV"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("LN"); //$NON-NLS-1$
+// supportedFunctions.add("LOG2"); //$NON-NLS-1$
+// supportedFunctions.add("POW"); //$NON-NLS-1$
+// supportedFunctions.add("RAND"); //$NON-NLS-1$
+// supportedFunctions.add("TRUNCATE"); //$NON-NLS-1$
+//
+// // Date / Time
+// supportedFunctions.add("ADDDATE"); //$NON-NLS-1$
+// supportedFunctions.add("ADDTIME"); //$NON-NLS-1$
+// supportedFunctions.add("CONVERT_TZ"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("DATE"); //$NON-NLS-1$
+// supportedFunctions.add("DATEDIFF"); //$NON-NLS-1$
+//// supportedFunctions.add("DATE_ADD");
+//// supportedFunctions.add("DATE_SUB");
+// supportedFunctions.add("DATE_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("DAY"); //$NON-NLS-1$
+//// supportedFunctions.add("EXTRACT");
+// supportedFunctions.add("FROM_DAYS"); //$NON-NLS-1$
+// supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
+// supportedFunctions.add("GET_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("LAST_DAY"); //$NON-NLS-1$
+// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$
+// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("MAKEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("MAKETIME"); //$NON-NLS-1$
+// supportedFunctions.add("MICROSECOND"); //$NON-NLS-1$
+// supportedFunctions.add("PERIOD_ADD"); //$NON-NLS-1$
+// supportedFunctions.add("PERIOD_DIFF"); //$NON-NLS-1$
+// supportedFunctions.add("SEC_TO_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("STR_TO_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBDATE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBTIME"); //$NON-NLS-1$
+// supportedFunctions.add("SYSDATE"); //$NON-NLS-1$
+// supportedFunctions.add("TIME"); //$NON-NLS-1$
+// supportedFunctions.add("TIMEDIFF"); //$NON-NLS-1$
+// supportedFunctions.add("TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("TIME_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("TIME_TO_SEC"); //$NON-NLS-1$
+// supportedFunctions.add("TO_DAYS"); //$NON-NLS-1$
+// supportedFunctions.add("UNIX_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("WEEKDAY"); //$NON-NLS-1$
+// supportedFunctions.add("WEEKOFYEAR"); //$NON-NLS-1$
+// supportedFunctions.add("YEARWEEK"); //$NON-NLS-1$
+//
+// // Bit
+// supportedFunctions.add("|"); //$NON-NLS-1$
+// supportedFunctions.add("&"); //$NON-NLS-1$
+// supportedFunctions.add("^"); //$NON-NLS-1$
+// supportedFunctions.add("<<"); //$NON-NLS-1$
+// supportedFunctions.add(">>"); //$NON-NLS-1$
+// supportedFunctions.add("~"); //$NON-NLS-1$
+// supportedFunctions.add("BIT_COUNT"); //$NON-NLS-1$
+//
+// // Encryption
+// supportedFunctions.add("AES_ENCRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("AES_DECRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("DECODE"); //$NON-NLS-1$
+// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
+// supportedFunctions.add("DES_ENCRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("DES_DECRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("MD5"); //$NON-NLS-1$
+// supportedFunctions.add("OLD_PASSWORD"); //$NON-NLS-1$
+// supportedFunctions.add("PASSWORD"); //$NON-NLS-1$
+// supportedFunctions.add("SHA"); //$NON-NLS-1$
+// supportedFunctions.add("SHA1"); //$NON-NLS-1$
+//
+// // Information
+// supportedFunctions.add("BENCHMARK"); //$NON-NLS-1$
+// supportedFunctions.add("CHARSET"); //$NON-NLS-1$
+// supportedFunctions.add("COERCIBILITY"); //$NON-NLS-1$
+// supportedFunctions.add("COLLATION"); //$NON-NLS-1$
+// supportedFunctions.add("CONNECTION_ID"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$
+// supportedFunctions.add("DATABASE"); //$NON-NLS-1$
+// supportedFunctions.add("FOUND_ROWS"); //$NON-NLS-1$
+// supportedFunctions.add("LAST_INSERT_ID"); //$NON-NLS-1$
+// supportedFunctions.add("ROW_COUNT"); //$NON-NLS-1$
+// supportedFunctions.add("SCHEMA"); //$NON-NLS-1$
+// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$
+// supportedFunctions.add("SYSTEM_USER"); //$NON-NLS-1$
+// supportedFunctions.add("USER"); //$NON-NLS-1$
+// supportedFunctions.add("VERSION"); //$NON-NLS-1$
+//
+// // Misc.
+// supportedFunctions.add("DEFAULT"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+//// supportedFunctions.add("GET_LOCK"); //$NON-NLS-1$
+// supportedFunctions.add("INET_ATON"); //$NON-NLS-1$
+// supportedFunctions.add("INET_NTOA"); //$NON-NLS-1$
+//// supportedFunctions.add("IS_FREE_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("IS_USED_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("MASTER_POS_WAIT"); //$NON-NLS-1$
+//// supportedFunctions.add("NAME_CONST"); //$NON-NLS-1$
+//// supportedFunctions.add("RELEASE_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("SLEEP"); //$NON-NLS-1$
+// supportedFunctions.add("UUID"); //$NON-NLS-1$
+// supportedFunctions.add("VALUES"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- // These are executed within the server and never pushed down
-// supportedFunctions.add("BITAND"); //$NON-NLS-1$
-// supportedFunctions.add("BITNOT"); //$NON-NLS-1$
-// supportedFunctions.add("BITOR"); //$NON-NLS-1$
-// supportedFunctions.add("BITXOR"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("ROUND"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
-
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("INSERT"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
-
- // These are executed within the server and never pushed down
-// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
-// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
-// supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
-// supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
-
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
-
- // ADDITIONAL functions supported by MySQL
-
-// // Comparison
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
-// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
-// supportedFunctions.add("ISNULL"); //$NON-NLS-1$
-// supportedFunctions.add("LEAST"); //$NON-NLS-1$
-// supportedFunctions.add("STRCMP"); // String-specific //$NON-NLS-1$
-//
-// // String
-// supportedFunctions.add("BIN"); //$NON-NLS-1$
-// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("COMPRESS"); //$NON-NLS-1$
-// supportedFunctions.add("CONCAT_WS"); //$NON-NLS-1$
-// supportedFunctions.add("CONV"); //$NON-NLS-1$
-// supportedFunctions.add("ELT"); //$NON-NLS-1$
-// supportedFunctions.add("EXPORT_SET"); //$NON-NLS-1$
-// supportedFunctions.add("FIELD"); //$NON-NLS-1$
-// supportedFunctions.add("FIND_IN_SET"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("HEX"); //$NON-NLS-1$
-// supportedFunctions.add("INSTR"); //$NON-NLS-1$
-// supportedFunctions.add("LOAD_FILE"); //$NON-NLS-1$
-// supportedFunctions.add("MAKE_SET"); //$NON-NLS-1$
-// supportedFunctions.add("MID"); //$NON-NLS-1$
-// supportedFunctions.add("OCT"); //$NON-NLS-1$
-// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("ORD"); //$NON-NLS-1$
-// supportedFunctions.add("QUOTE"); //$NON-NLS-1$
-// supportedFunctions.add("REVERSE"); //$NON-NLS-1$
-// supportedFunctions.add("SOUNDEX"); //$NON-NLS-1$
-// supportedFunctions.add("SPACE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
-// supportedFunctions.add("SUBSTRING_INDEX"); //$NON-NLS-1$
-// supportedFunctions.add("TRIM"); //$NON-NLS-1$
-// supportedFunctions.add("UNCOMPRESS"); //$NON-NLS-1$
-// supportedFunctions.add("UNHEX"); //$NON-NLS-1$
-//
-// // Math
-// supportedFunctions.add("CEIL"); //$NON-NLS-1$
-// supportedFunctions.add("CRC32"); //$NON-NLS-1$
-// // DIV is an operator equivalent to '/'
-// supportedFunctions.add("DIV"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("LN"); //$NON-NLS-1$
-// supportedFunctions.add("LOG2"); //$NON-NLS-1$
-// supportedFunctions.add("POW"); //$NON-NLS-1$
-// supportedFunctions.add("RAND"); //$NON-NLS-1$
-// supportedFunctions.add("TRUNCATE"); //$NON-NLS-1$
-//
-// // Date / Time
-// supportedFunctions.add("ADDDATE"); //$NON-NLS-1$
-// supportedFunctions.add("ADDTIME"); //$NON-NLS-1$
-// supportedFunctions.add("CONVERT_TZ"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("DATE"); //$NON-NLS-1$
-// supportedFunctions.add("DATEDIFF"); //$NON-NLS-1$
-//// supportedFunctions.add("DATE_ADD");
-//// supportedFunctions.add("DATE_SUB");
-// supportedFunctions.add("DATE_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("DAY"); //$NON-NLS-1$
-//// supportedFunctions.add("EXTRACT");
-// supportedFunctions.add("FROM_DAYS"); //$NON-NLS-1$
-// supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
-// supportedFunctions.add("GET_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("LAST_DAY"); //$NON-NLS-1$
-// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$
-// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("MAKEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("MAKETIME"); //$NON-NLS-1$
-// supportedFunctions.add("MICROSECOND"); //$NON-NLS-1$
-// supportedFunctions.add("PERIOD_ADD"); //$NON-NLS-1$
-// supportedFunctions.add("PERIOD_DIFF"); //$NON-NLS-1$
-// supportedFunctions.add("SEC_TO_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("STR_TO_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBDATE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBTIME"); //$NON-NLS-1$
-// supportedFunctions.add("SYSDATE"); //$NON-NLS-1$
-// supportedFunctions.add("TIME"); //$NON-NLS-1$
-// supportedFunctions.add("TIMEDIFF"); //$NON-NLS-1$
-// supportedFunctions.add("TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("TIME_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("TIME_TO_SEC"); //$NON-NLS-1$
-// supportedFunctions.add("TO_DAYS"); //$NON-NLS-1$
-// supportedFunctions.add("UNIX_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("WEEKDAY"); //$NON-NLS-1$
-// supportedFunctions.add("WEEKOFYEAR"); //$NON-NLS-1$
-// supportedFunctions.add("YEARWEEK"); //$NON-NLS-1$
-//
-// // Bit
-// supportedFunctions.add("|"); //$NON-NLS-1$
-// supportedFunctions.add("&"); //$NON-NLS-1$
-// supportedFunctions.add("^"); //$NON-NLS-1$
-// supportedFunctions.add("<<"); //$NON-NLS-1$
-// supportedFunctions.add(">>"); //$NON-NLS-1$
-// supportedFunctions.add("~"); //$NON-NLS-1$
-// supportedFunctions.add("BIT_COUNT"); //$NON-NLS-1$
-//
-// // Encryption
-// supportedFunctions.add("AES_ENCRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("AES_DECRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("DECODE"); //$NON-NLS-1$
-// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
-// supportedFunctions.add("DES_ENCRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("DES_DECRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("MD5"); //$NON-NLS-1$
-// supportedFunctions.add("OLD_PASSWORD"); //$NON-NLS-1$
-// supportedFunctions.add("PASSWORD"); //$NON-NLS-1$
-// supportedFunctions.add("SHA"); //$NON-NLS-1$
-// supportedFunctions.add("SHA1"); //$NON-NLS-1$
-//
-// // Information
-// supportedFunctions.add("BENCHMARK"); //$NON-NLS-1$
-// supportedFunctions.add("CHARSET"); //$NON-NLS-1$
-// supportedFunctions.add("COERCIBILITY"); //$NON-NLS-1$
-// supportedFunctions.add("COLLATION"); //$NON-NLS-1$
-// supportedFunctions.add("CONNECTION_ID"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$
-// supportedFunctions.add("DATABASE"); //$NON-NLS-1$
-// supportedFunctions.add("FOUND_ROWS"); //$NON-NLS-1$
-// supportedFunctions.add("LAST_INSERT_ID"); //$NON-NLS-1$
-// supportedFunctions.add("ROW_COUNT"); //$NON-NLS-1$
-// supportedFunctions.add("SCHEMA"); //$NON-NLS-1$
-// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$
-// supportedFunctions.add("SYSTEM_USER"); //$NON-NLS-1$
-// supportedFunctions.add("USER"); //$NON-NLS-1$
-// supportedFunctions.add("VERSION"); //$NON-NLS-1$
-//
-// // Misc.
-// supportedFunctions.add("DEFAULT"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-//// supportedFunctions.add("GET_LOCK"); //$NON-NLS-1$
-// supportedFunctions.add("INET_ATON"); //$NON-NLS-1$
-// supportedFunctions.add("INET_NTOA"); //$NON-NLS-1$
-//// supportedFunctions.add("IS_FREE_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("IS_USED_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("MASTER_POS_WAIT"); //$NON-NLS-1$
-//// supportedFunctions.add("NAME_CONST"); //$NON-NLS-1$
-//// supportedFunctions.add("RELEASE_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("SLEEP"); //$NON-NLS-1$
-// supportedFunctions.add("UUID"); //$NON-NLS-1$
-// supportedFunctions.add("VALUES"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
public boolean supportsFullOuterJoins() {
return false;
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLTranslator.java 2009-05-11 21:39:16 UTC (rev 910)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mysql/MySQLTranslator.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -33,7 +33,7 @@
import org.teiid.connector.api.ConnectorEnvironment;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.SourceSystemFunctions;
-import org.teiid.connector.jdbc.derby.DerbyCapabilities;
+import org.teiid.connector.jdbc.translator.AliasModifier;
import org.teiid.connector.jdbc.translator.Translator;
@@ -46,7 +46,11 @@
@Override
public void initialize(ConnectorEnvironment env) throws ConnectorException {
super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, new MySQLConvertModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, new MySQLConvertModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("&")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("~")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("|")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("^")); //$NON-NLS-1$
}
@Override
@@ -97,7 +101,7 @@
@Override
public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return DerbyCapabilities.class;
+ return MySQLCapabilities.class;
}
}
Modified: trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-11 21:39:16 UTC (rev 910)
+++ trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-11 22:00:47 UTC (rev 911)
@@ -74,6 +74,12 @@
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
+ <ComponentType Name="MySQL 5 JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mysql://<host>:3306/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQL5Translator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
<ComponentType Name="MySQL JDBC XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="3306" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
@@ -83,6 +89,15 @@
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
+ <ComponentType Name="MySQL 5 JDBC XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="3306" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQL5Translator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
+ </ComponentType>
<ComponentType Name="PostgreSQL JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
@@ -110,7 +125,7 @@
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
- <ComponentType Name="Teiid JDBC 6 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <ComponentType Name="Teiid 6 JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbc.MMDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:metamatrix:<vdbName>@mm://<host>:<port>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
Modified: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java 2009-05-11 21:39:16 UTC (rev 910)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/mysql/TestMySQLTranslator.java 2009-05-11 22:00:47 UTC (rev 911)
@@ -22,40 +22,31 @@
package org.teiid.connector.jdbc.mysql;
-import java.util.Map;
+import static org.junit.Assert.*;
+
import java.util.Properties;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.jdbc.MetadataFactory;
-import org.teiid.connector.jdbc.mysql.MySQLTranslator;
import org.teiid.connector.jdbc.translator.TranslatedCommand;
+import org.teiid.connector.jdbc.translator.Translator;
import org.teiid.connector.language.ICommand;
-import junit.framework.TestCase;
-
import com.metamatrix.cdk.api.EnvironmentUtility;
/**
*/
-public class TestMySQLTranslator extends TestCase {
+public class TestMySQLTranslator {
- private static Map MODIFIERS;
private static MySQLTranslator TRANSLATOR;
-
- static {
- try {
- TRANSLATOR = new MySQLTranslator();
- TRANSLATOR.initialize(EnvironmentUtility.createEnvironment(new Properties(), false));
- MODIFIERS = TRANSLATOR.getFunctionModifiers();
- } catch(ConnectorException e) {
- e.printStackTrace();
- }
+
+ @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ TRANSLATOR = new MySQLTranslator();
+ TRANSLATOR.initialize(EnvironmentUtility.createEnvironment(new Properties(), false));
}
- public TestMySQLTranslator(String name) {
- super(name);
- }
-
private String getTestVDB() {
return MetadataFactory.PARTS_VDB;
}
@@ -64,11 +55,11 @@
return MetadataFactory.BQT_VDB;
}
- public void helpTestVisitor(String vdb, String input, Map modifiers, String expectedOutput) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
// Convert from sql to objects
ICommand obj = MetadataFactory.helpTranslate(vdb, input);
- TranslatedCommand tc = new TranslatedCommand(EnvironmentUtility.createSecurityContext("user"), TRANSLATOR);
+ TranslatedCommand tc = new TranslatedCommand(EnvironmentUtility.createSecurityContext("user"), translator); //$NON-NLS-1$
tc.translateCommand(obj);
@@ -76,144 +67,139 @@
assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
}
- public void testRewriteConversion1() throws Exception {
+ @Test public void testRewriteConversion1() throws Exception {
String input = "SELECT char(convert(PART_WEIGHT, integer) + 100) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT char((convert(PARTS.PART_WEIGHT, SIGNED INTEGER) + 100)) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion2() throws Exception {
+ @Test public void testRewriteConversion2() throws Exception {
String input = "SELECT convert(PART_WEIGHT, long) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(PARTS.PART_WEIGHT, SIGNED) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion3() throws Exception {
+ @Test public void testRewriteConversion3() throws Exception {
String input = "SELECT convert(convert(PART_WEIGHT, long), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(convert(PARTS.PART_WEIGHT, SIGNED), CHAR) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion4() throws Exception {
+ @Test public void testRewriteConversion4() throws Exception {
String input = "SELECT convert(convert(PART_WEIGHT, date), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(DATE(PARTS.PART_WEIGHT), '%Y-%m-%d') FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion5() throws Exception {
+ @Test public void testRewriteConversion5() throws Exception {
String input = "SELECT convert(convert(PART_WEIGHT, time), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(TIME(PARTS.PART_WEIGHT), '%H:%i:%S') FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion6() throws Exception {
+ @Test public void testRewriteConversion6() throws Exception {
String input = "SELECT convert(convert(PART_WEIGHT, timestamp), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT date_format(TIMESTAMP(PARTS.PART_WEIGHT), '%Y-%m-%d %H:%i:%S.%f') FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion8() throws Exception {
+ @Test public void testRewriteConversion8() throws Exception {
String input = "SELECT ifnull(PART_WEIGHT, 'otherString') FROM PARTS"; //$NON-NLS-1$
String output = "SELECT ifnull(PARTS.PART_WEIGHT, 'otherString') FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteConversion7() throws Exception {
+ @Test public void testRewriteConversion7() throws Exception {
String input = "SELECT convert(convert(PART_WEIGHT, integer), string) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT convert(convert(PARTS.PART_WEIGHT, SIGNED INTEGER), CHAR) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteInsert() throws Exception {
+ @Test public void testRewriteInsert() throws Exception {
String input = "SELECT insert(PART_WEIGHT, 1, 5, 'chimp') FROM PARTS"; //$NON-NLS-1$
String output = "SELECT insert(PARTS.PART_WEIGHT, 1, 5, 'chimp') FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteLocate() throws Exception {
+ @Test public void testRewriteLocate() throws Exception {
String input = "SELECT locate(PART_WEIGHT, 'chimp', 1) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT locate(PARTS.PART_WEIGHT, 'chimp', 1) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteSubstring1() throws Exception {
+ @Test public void testRewriteSubstring1() throws Exception {
String input = "SELECT substring(PART_WEIGHT, 1) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT substring(PARTS.PART_WEIGHT, 1) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteSubstring2() throws Exception {
+ @Test public void testRewriteSubstring2() throws Exception {
String input = "SELECT substring(PART_WEIGHT, 1, 5) FROM PARTS"; //$NON-NLS-1$
String output = "SELECT substring(PARTS.PART_WEIGHT, 1, 5) FROM PARTS"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRewriteUnionWithOrderBy() throws Exception {
+ @Test public void testRewriteUnionWithOrderBy() throws Exception {
String input = "SELECT PART_ID FROM PARTS UNION SELECT PART_ID FROM PARTS ORDER BY PART_ID"; //$NON-NLS-1$
String output = "(SELECT PARTS.PART_ID FROM PARTS) UNION (SELECT PARTS.PART_ID FROM PARTS) ORDER BY PART_ID"; //$NON-NLS-1$
helpTestVisitor(getTestVDB(),
input,
- MODIFIERS,
- output);
+ output, TRANSLATOR);
}
- public void testRowLimit2() throws Exception {
+ @Test public void testRowLimit2() throws Exception {
String input = "select intkey from bqt1.smalla limit 100"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 100"; //$NON-NLS-1$
helpTestVisitor(getTestBQTVDB(),
input,
- MODIFIERS,
- output);
- }
- public void testRowLimit3() throws Exception {
+ output, TRANSLATOR);
+ }
+
+ @Test public void testRowLimit3() throws Exception {
String input = "select intkey from bqt1.smalla limit 50, 100"; //$NON-NLS-1$
String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 50, 100"; //$NON-NLS-1$
helpTestVisitor(getTestBQTVDB(),
input,
- MODIFIERS,
- output);
- }
+ output, TRANSLATOR);
+ }
+
+ @Test public void testBitAnd() throws Exception {
+ String input = "select bitand(intkey, intnum) from bqt1.smalla"; //$NON-NLS-1$
+ String output = "SELECT (SmallA.IntKey & SmallA.IntNum) FROM SmallA"; //$NON-NLS-1$
+
+ TestMySQLTranslator.helpTestVisitor(MetadataFactory.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
}
14 years, 10 months
teiid SVN: r910 - in trunk/build: kit-embedded/deploy and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-11 17:39:16 -0400 (Mon, 11 May 2009)
New Revision: 910
Added:
trunk/build/kit-embedded/deploy/Admin.vdb
Modified:
trunk/build/
Log:
TEIID-573: Adding admin.vdb to embedded's deployment
Property changes on: trunk/build
___________________________________________________________________
Name: svn:ignore
+ target
Added: trunk/build/kit-embedded/deploy/Admin.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/build/kit-embedded/deploy/Admin.vdb
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 10 months
teiid SVN: r909 - in trunk/build: assembly/embedded and 1 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-11 17:25:37 -0400 (Mon, 11 May 2009)
New Revision: 909
Added:
trunk/build/assembly/embedded/build-configuration.xml
trunk/build/pom.xml
Modified:
trunk/build/assembly/embedded/embedded-dist.xml
trunk/build/kit-embedded/deploy/configuration.xml
Log:
TEIID-561: moved the base "connector" fragment from the Configuration.xml to connector-api project, and also made the "embedded" configuration build-up as part of the building the kit.
Added: trunk/build/assembly/embedded/build-configuration.xml
===================================================================
--- trunk/build/assembly/embedded/build-configuration.xml (rev 0)
+++ trunk/build/assembly/embedded/build-configuration.xml 2009-05-11 21:25:37 UTC (rev 909)
@@ -0,0 +1,35 @@
+<project default="main" name="teiid-configuration-build" basedir=".">
+
+ <property name="kit.dir" value="${basedir}/target/kit-embedded"/>
+ <property name="extensions.dir" value="${basedir}/target/dependency"/>
+
+
+ <target name="main" >
+
+ <copy todir="${kit.dir}">
+ <fileset dir="${basedir}/kit-embedded"/>
+ </copy>
+
+ <!-- unzip the connector zip files in to directory and move the jar files into extensions directory -->
+ <unzip dest="${extensions.dir}/unzipped">
+ <fileset dir="${extensions.dir}">
+ <include name="*.zip"/>
+ </fileset>
+ </unzip>
+ <move todir="${kit.dir}/extensions">
+ <fileset dir="${extensions.dir}/unzipped">
+ <include name="**/*.jar"/>
+ </fileset>
+ </move>
+
+ <!-- add all the cdk files, and then add the combined fragment to the config.xml -->
+ <concat destfile="${extensions.dir}/unzipped/all-cdks.xml">
+ <fileset dir="${extensions.dir}/unzipped" includes="connector-*.xml"/>
+ </concat>
+
+ <loadfile property="connector-types-fragment" srcFile="${extensions.dir}/unzipped/all-cdks.xml"/>
+ <replace file="${kit.dir}/deploy/configuration.xml" token="${connector-types-fragment-fill-in}" value="${connector-types-fragment}"/>
+
+ </target>
+
+</project>
\ No newline at end of file
Property changes on: trunk/build/assembly/embedded/build-configuration.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/assembly/embedded/embedded-dist.xml
===================================================================
--- trunk/build/assembly/embedded/embedded-dist.xml 2009-05-11 21:19:03 UTC (rev 908)
+++ trunk/build/assembly/embedded/embedded-dist.xml 2009-05-11 21:25:37 UTC (rev 909)
@@ -45,8 +45,8 @@
</fileSet>
<fileSet>
- <directory>build/kit-embedded</directory>
- <outputDirectory>/</outputDirectory>
+ <directory>build/target/kit-embedded</directory>
+ <outputDirectory>/</outputDirectory>
<excludes>
<exclude>**/*.foo</exclude>
</excludes>
Modified: trunk/build/kit-embedded/deploy/configuration.xml
===================================================================
--- trunk/build/kit-embedded/deploy/configuration.xml 2009-05-11 21:19:03 UTC (rev 908)
+++ trunk/build/kit-embedded/deploy/configuration.xml 2009-05-11 21:25:37 UTC (rev 909)
@@ -31,10 +31,6 @@
</Properties>
</Service>
</Services>
- <ProductTypes>
- <ProductType Name="Connectors" ComponentTypeCode="3" Deployable="false" Deprecated="false" Monitorable="false" SuperComponentType="Product" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- </ProductType>
- </ProductTypes>
<ComponentTypes>
<ComponentType Name="Service" ComponentTypeCode="1" Deployable="false" Deprecated="false" Monitorable="false" ParentComponentType="VM" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
<PropertyDefinition Name="ServiceClassName" DisplayName="Service Class Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="true" IsMasked="false" IsModifiable="true" IsPreferred="false" />
@@ -44,376 +40,11 @@
</ComponentType>
<ComponentType Name="Configuration" ComponentTypeCode="0" Deployable="true" Deprecated="false" Monitorable="false" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
</ComponentType>
- <ComponentType Name="Connector" ComponentTypeCode="2" Deployable="false" Deprecated="false" Monitorable="true" SuperComponentType="Service" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.916-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.916-06:00">
- <PropertyDefinition Name="SourceConnectionTestInterval" DisplayName="Data Source Test Connect Interval (seconds)" ShortDescription="How often (in seconds) to create test connections to the underlying datasource to see if it is available." DefaultValue="600" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system)" Multiplicity="0..1" IsExpert="true" IsHidden="true" />
- <PropertyDefinition Name="ExceptionOnMaxRows" DisplayName="Exception on Exceeding Max Rows" ShortDescription="Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="metamatrix.service.essentialservice" DisplayName="Essential Service" ShortDescription="Indicates if the service is essential to operation of the Integration Server" DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" IsHidden="true" />
- <PropertyDefinition Name="ServiceMonitoringEnabled" DisplayName="Data Source Monitoring Enabled" ShortDescription="Whether to monitor the underlying data source to see if it is available." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="Immutable" DisplayName="Is Immutable" ShortDescription="True if the source never changes." DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="ConnectorMaxThreads" DisplayName="Connector Maximum Thread Count" ShortDescription="" DefaultValue="20" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" Multiplicity="1" IsExpert="true" IsHidden="true" />
- <PropertyDefinition Name="ServiceClassName" DisplayName="Service Class Name" ShortDescription="" DefaultValue="com.metamatrix.server.connector.service.ConnectorService" Multiplicity="1" IsHidden="true" />
- <PropertyDefinition Name="MaxResultRows" DisplayName="Maximum Result Rows" ShortDescription="" DefaultValue="10000" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="ConnectorThreadTTL" DisplayName="Thread Time to live (milliseconds)" ShortDescription="" DefaultValue="120000" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="ResultSetCacheMaxAge" DisplayName="ResultSet Cache Maximum Age (milliseconds)" ShortDescription="" DefaultValue="0" PropertyType="Long" IsExpert="true" />
- <PropertyDefinition Name="ResultSetCacheScope" DisplayName="ResultSet Cache Scope" ShortDescription="" DefaultValue="vdb" IsExpert="true">
- <AllowedValue>vdb</AllowedValue>
- <AllowedValue>session</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="supportsAndCriteria" DisplayName="supportsAndCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteria" DisplayName="supportsCompareCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaEquals" DisplayName="supportsCompareCriteriaEquals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThan" DisplayName="supportsCompareCriteriaGreaterThan" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThanOrEqual" DisplayName="supportsCompareCriteriaGreaterThanOrEqual" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThan" DisplayName="supportsCompareCriteriaLessThan" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThanOrEqual" DisplayName="supportsCompareCriteriaLessThanOrEqual" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaNotEquals" DisplayName="supportsCompareCriteriaNotEquals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCriteria" DisplayName="supportsCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteria" DisplayName="supportsInCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsIsNullCriteria" DisplayName="supportsIsNullCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsJoins" DisplayName="supportsJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteria" DisplayName="supportsLikeCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsNotCriteria" DisplayName="supportsNotCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrCriteria" DisplayName="supportsOrCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectDistinct" DisplayName="supportsSelectDistinct" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectLiterals" DisplayName="supportsSelectLiterals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAliasedGroup" DisplayName="supportsAliasedGroup" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelfJoins" DisplayName="supportsSelfJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOuterJoins" DisplayName="supportsOuterJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsFullOuterJoins" DisplayName="supportsFullOuterJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsBetweenCriteria" DisplayName="supportsBetweenCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteriaEscapeCharacter" DisplayName="supportsLikeCriteriaEscapeCharacter" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteriaSubquery" DisplayName="supportsInCriteriaSubquery" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsExistsCriteria" DisplayName="supportsExistsCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteria" DisplayName="supportsQuantifiedCompareCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaSome" DisplayName="supportsQuantifiedCompareCriteriaSome" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaAll" DisplayName="supportsQuantifiedCompareCriteriaAll" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderBy" DisplayName="supportsOrderBy" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregates" DisplayName="supportsAggregates" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesSum" DisplayName="supportsAggregatesSum" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesAvg" DisplayName="supportsAggregatesAvg" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMin" DisplayName="supportsAggregatesMin" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMax" DisplayName="supportsAggregatesMax" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCount" DisplayName="supportsAggregatesCount" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCountStar" DisplayName="supportsAggregatesCountStar" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesDistinct" DisplayName="supportsAggregatesDistinct" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarSubqueries" DisplayName="supportsScalarSubqueries" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCorrelatedSubqueries" DisplayName="supportsCorrelatedSubqueries" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCaseExpressions" DisplayName="supportsCaseExpressions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSearchedCaseExpressions" DisplayName="supportsSearchedCaseExpressions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarFunctions" DisplayName="supportsScalarFunctions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="getSupportedFunctions" DisplayName="getSupportedFunctions" ShortDescription="" Multiplicity="0..1" PropertyType="string" IsExpert="true" />
- <PropertyDefinition Name="supportsInlineViews" DisplayName="supportsInlineViews" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderByInInlineViews" DisplayName="supportsOrderByInInlineViews" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnionOrderBy" DisplayName="supportsUnionOrderBy" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnions" DisplayName="supportsUnions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="LDAP Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.946-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.946-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-ldap-6.1.0-SNAPSHOT.jar;" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- <PropertyDefinition Name="SearchDefaultBaseDN" DisplayName="Default Search Base DN" ShortDescription="Default Base DN for LDAP Searches" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.cleaning_interval" DisplayName="Pool cleaning Interval (seconds)" ShortDescription="Set the interval to cleaning the pool" DefaultValue="300" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="LdapAdminUserDN" DisplayName="Ldap Admin User DN" ShortDescription="User DN for the LDAP admin account." DefaultValue="cn=<>,ou=<>,dc=<>" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.ldap.LDAPConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="LdapMaxCriteria" DisplayName="Ldap Max Criteria" ShortDescription="Maximum number of criteria supported in an LDAP search filter." DefaultValue="1000" Multiplicity="1" />
- <PropertyDefinition Name="LdapAdminUserPassword" DisplayName="Ldap Admin Password" ShortDescription="Password of the LDAP admin user account." Multiplicity="1" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="SearchDefaultScope" DisplayName="Default Search Scope" ShortDescription="Default Scope for LDAP Searches" DefaultValue="SUBTREE_SCOPE" Multiplicity="1">
- <AllowedValue>OBJECT_SCOPE</AllowedValue>
- <AllowedValue>ONELEVEL_SCOPE</AllowedValue>
- <AllowedValue>SUBTREE_SCOPE</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="RestrictToObjectClass" DisplayName="Restrict Searches To Named Object Class" ShortDescription="Restrict Searches to objectClass named in the Name field for a table" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.max_connections" DisplayName="Pool Maximum Connections" ShortDescription="Set the maximum number of connections for the connection pool" DefaultValue="100" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="LdapTxnTimeoutInMillis" DisplayName="Ldap Transaction Timeout (ms)" ShortDescription="Timeout value for LDAP searches. Defaults to TCP timeout value." />
- <PropertyDefinition Name="com.metamatrix.data.pool.wait_for_source_time" DisplayName="Pool Connection Waiting Time (milliseconds)" ShortDescription="Set the time to wait if the connection is not available" DefaultValue="60000" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="LdapUrl" DisplayName="Ldap URL" ShortDescription="Ldap URL of the server, including port number." DefaultValue="ldap://<ldapServer>:<389>" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.live_and_unused_time" DisplayName="Pool Connection Idle Time (seconds)" ShortDescription="Set the idle time of the connection before it should be closed if pool shrinking is enabled" DefaultValue="300" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.enable_shrinking" DisplayName="Pool Shrinking Enabled" ShortDescription="Set whether to enable the pool shrinking" DefaultValue="true" PropertyType="Boolean" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="Loopback Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.945-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.945-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-loopback-6.1.0-SNAPSHOT.jar;" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- <PropertyDefinition Name="CapabilitiesClass" DisplayName="Capabilities Class" ShortDescription="" DefaultValue="com.metamatrix.connector.loopback.LoopbackCapabilities" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="WaitTime" DisplayName="Max Random Wait Time" ShortDescription="" DefaultValue="0" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.loopback.LoopbackConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="RowCount" DisplayName="Rows Per Query" ShortDescription="" DefaultValue="1" Multiplicity="1" IsExpert="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="Salesforce Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.916-06:00" CreationDate="2008-10-31T10:26:19.916-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)"
- DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-salesforce-6.1.0-SNAPSHOT.jar;extensionjar:commons-codec-1.2.jar;extensionjar:commons-discovery-0.2.jar;extensionjar:commons-httpclient-3.0.1.jar;extensionjar:xmlsec-1.3.0.jar;extensionjar:axis-1.3.jar;extensionjar:axis-jaxrpc-1.3.jar;extensionjar:axis-saaj-1.2.jar;extensionjar:axis-schema-1.3.jar;extensionjar:commons-discovery-0.2.jar;extensionjar:commons-logging-1.1.jar;extensionjar:jms-1.1.jar;extensionjar:servlet-api-2.5.jar;extensionjar:jaxen-1.1.1.jar;extensionjar:jdom-1.0.jar;extensionjar:log4j-1.2.8.jar;extensionjar:opensaml-1.1b.jar;extensionjar:salesforce-api-6.1.0-SNAPSHOT.jar;extensionjar:wsdl4j-1.5.1.jar;extensionjar:wss4j-1.5.0.jar;extensionjar:xalan-2.7.0.jar;extensionjar:xml-apis-1.0.b2.jar"
- Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- <PropertyDefinition Name="username" DisplayName="User Name" ShortDescription="Name value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.ConnectorState" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.Connector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="InLimit" DisplayName="IN Criteria Limit" ShortDescription="The maximum number of values that can be supplied in an IN criteria" DefaultValue="-1" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="password" DisplayName="Password" ShortDescription="Password value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="Salesforce URL" ShortDescription="URL for connecting to Salesforce" DefaultValue="" IsExpert="true" />
- <PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.salesforce.SalesforceCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="Text File Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.945-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.945-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-text-6.1.0-SNAPSHOT.jar;" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- <PropertyDefinition Name="PartialStartupAllowed" DisplayName="Partial Startup Allowed" ShortDescription="" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="DescriptorFile" DisplayName="Text File Descriptor" ShortDescription="" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.text.TextConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="EnforceColumnCount" DisplayName="Enforce Column Count" ShortDescription="This forces the number of columns in text file to match what was modeled" DefaultValue="false" PropertyType="Boolean" IsConstrainedToAllowedValues="false" />
- <PropertyDefinition Name="DateResultFormatsDelimiter" DisplayName="Date Result Formats Delimiter" ShortDescription="" IsExpert="true" />
- <PropertyDefinition Name="DateResultFormats" DisplayName="Date Result Formats" ShortDescription="" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="XML Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.917-06:00" CreationDate="2008-10-31T10:26:19.917-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)"
- DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-xml-6.1.0-SNAPSHOT.jar;extensionjar:commons-codec-1.2.jar;extensionjar:commons-discovery-0.2.jar;extensionjar:commons-httpclient-3.0.1.jar;extensionjar:xmlsec-1.3.0.jar;extensionjar:axis-1.3.jar;extensionjar:axis-jaxrpc-1.3.jar;extensionjar:axis-saaj-1.2.jar;extensionjar:axis-schema-1.3.jar;extensionjar:commons-discovery-0.2.jar;extensionjar:commons-logging-1.1.jar;extensionjar:jms-1.1.jar;extensionjar:servlet-api-2.5.jar;extensionjar:jaxen-1.1.1.jar;extensionjar:jdom-1.0.jar;extensionjar:log4j-1.2.8.jar;extensionjar:opensaml-1.1b.jar;extensionjar:wsdl4j-1.5.1.jar;extensionjar:wss4j-1.5.0.jar;extensionjar:xalan-2.7.0.jar;"
- Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- </ComponentType>
- <ComponentType Name="XML File Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.917-06:00" CreationDate="2008-10-31T10:26:19.917-06:00">
- <PropertyDefinition Name="CharacterEncodingScheme" DisplayName="File Encoding Used" ShortDescription="A character-encoding scheme is a mapping between a coded character set and a set of octet (eight-bit byte) sequences. Some samples are UTF-8,ISO-8859-1,UTF-16)" DefaultValue="ISO-8859-1" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xmlsource.XMLSourceConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="ConnectionType" DisplayName="Type Of XML Connection" ShortDescription="Connection type used to get the XML data" DefaultValue="com.metamatrix.connector.xmlsource.file.FileConnection" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="DirectoryLocation" DisplayName="XML File(s) Directory Location" ShortDescription="" DefaultValue="" Multiplicity="1" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="XML SOAP Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.917-06:00" CreationDate="2008-10-31T10:26:19.917-06:00">
- <PropertyDefinition Name="AuthPassword" DisplayName="Authentication User Password" ShortDescription="Password value for authentication" DefaultValue="" IsExpert="true" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="SAMLPropertyFile" DisplayName="SAML Property File (only required when SAML profile used)" ShortDescription="SAML Security property file (saml.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="wsdl" DisplayName="WSDL File (URL)" ShortDescription="URL to Web Service Definition File" DefaultValue="" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="AuthUserName" DisplayName="Authentication User Name" ShortDescription="Name value for authentication" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="WSSecurityType" DisplayName="WS-Security Type(UsernameToken, SAML..)" ShortDescription="Type of WS-Security to be used; Combinations of multiple security types can be used with a space in-between. Allowed types are: (UsernameToken, UsernameToken-Digest, SAMLTokenUnsigned, SAMLTokenSigned, Signature, Timestamp, Encrypt)" DefaultValue="" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xmlsource.XMLSourceConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="EncryptUserName" DisplayName="Encrypt UserName (only if Encrypt profile used)" ShortDescription="The username to be used in the encryption; if blank uses auth username" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="EndPoint" DisplayName="Alternate End Point" ShortDescription="An alternate service endpoint other than one specified in WSDL, to execute the service" DefaultValue="" IsPreferred="true" />
- <PropertyDefinition Name="SecurityType" DisplayName="WebService Security Used(None, HTTPBasic, WS-Security)" ShortDescription="Type of Authentication to used with the web service; If WS-Secuirty is being used, then WS-Secuirty type must be defined" DefaultValue="None" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="CryptoPropertyFile" DisplayName="User Crypto Property File (If SAML or Signature profile used)" ShortDescription="The file defines properties of cryptography;defines the certificates;(crypto.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectionType" DisplayName="Type Of XML Connection" ShortDescription="Connection type used to get the XML data" DefaultValue="com.metamatrix.connector.xmlsource.soap.SoapConnection" Multiplicity="1" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="EncryptPropertyFile" DisplayName="Encrypt crypto property file (only if Encrypt profile used)" ShortDescription="The file defines properties of cryptography for encryption of the message;(crypto.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="TrustType" DisplayName="Trust Type:(DirectReference or IssuerSerial)" ShortDescription="Only required for Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA." DefaultValue="DirectReference"
- IsExpert="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="XML-Relational File Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.918-06:00" CreationDate="2008-10-31T10:26:19.918-06:00">
- <PropertyDefinition Name="TextExtractionThreshold" DisplayName="Text Extraction Threshold (in kb)" ShortDescription="extract text sections larger than this size to a file where more efficient access as a CLOB can be effected." DefaultValue="128" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="FilePath" DisplayName="File Path" ShortDescription="" Multiplicity="1" />
- <PropertyDefinition Name="FileCacheLocation" DisplayName="Location of the File Cache" ShortDescription="" DefaultValue="" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache Timeout (in seconds)" ShortDescription="" DefaultValue="60" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="SaxFilterProviderClass" DisplayName="XML Filter Provider" ShortDescription="The class the provides extended XML Filters" DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.base.XMLConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="MaxFileCacheSize" DisplayName="Max Size of file cache (in kb)" ShortDescription="" DefaultValue="-1" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.file.FileConnectorState" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="LogRequestResponseDocs" DisplayName="Log XML Request and Response Documents" ShortDescription="Write the request and response documents to the log at Info level" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="InputStreamFilterClass" DisplayName="Input Stream Filter Class" ShortDescription="The class to use to preprocess raw XML input stream" DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="MaxMemoryCacheSize" DisplayName="Max Size of in-memory cache (in kb)" ShortDescription="" DefaultValue="16384" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="FileName" DisplayName="File Name" ShortDescription="" DefaultValue="" />
- <PropertyDefinition Name="QueryPreprocessorClass" DisplayName="Query Preprocessor Class" ShortDescription="The class to use to preprocess the IQuery" DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="XML-Relational HTTP Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.920-06:00" CreationDate="2008-10-31T10:26:19.921-06:00">
- <PropertyDefinition Name="TextExtractionThreshold" DisplayName="Text Extraction Threshold (in kb)" ShortDescription="Extract text sections larger than this size to a file where more efficient access as a CLOB can be effected." DefaultValue="128" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="FileCacheLocation" DisplayName="Location of the File Cache" ShortDescription="" DefaultValue="" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache Timeout (in seconds)" ShortDescription="" DefaultValue="60" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="SaxFilterProviderClass" DisplayName="XML Filter Provider" ShortDescription="The class the provides extended XML Filters" DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="XMLParmName" DisplayName="XML Parameter Name" ShortDescription="" />
- <PropertyDefinition Name="RequestTimeout" DisplayName="Request Timeout (in Milliseconds)" ShortDescription="" DefaultValue="10000" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="MaxFileCacheSize" DisplayName="Max Size of file cache (in kb)" ShortDescription="" DefaultValue="-1" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="Authenticate" DisplayName="Authentication Required" ShortDescription="" DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsHidden="true" />
- <PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.http.HTTPConnectorState" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="HttpBasicAuthPassword" DisplayName="HTTP Basic Authentication Password" ShortDescription="Password value for HTTP basic authentication" DefaultValue="" IsExpert="true" IsMasked="true" />
- <PropertyDefinition Name="AccessMethod" DisplayName="Access Method" ShortDescription="" DefaultValue="get" Multiplicity="1">
- <AllowedValue>get</AllowedValue>
- <AllowedValue>post</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="ProxyUri" DisplayName="Proxy Server URI" ShortDescription="The URI of the proxy server" DefaultValue="" />
- <PropertyDefinition Name="ExceptionOnIntraQueryCacheExpiration" DisplayName="Exception On Intra-Query Cache Expiration" ShortDescription="Throw an exception when a document expires from the cache between executing different parts of a single query (instead of requesting the document again)" DefaultValue="true" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="HttpBasicAuthUserName" DisplayName="HTTP Basic Authentication Name" ShortDescription="Name value for HTTP basic authentication" DefaultValue="" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.base.XMLConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="Uri" DisplayName="Server URI" ShortDescription="The URI of the HTTP source" Multiplicity="1" />
- <PropertyDefinition Name="UseHttpBasic" DisplayName="Use HTTP Basic authentication" ShortDescription="Use basic HTTP Authentication" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="LogRequestResponseDocs" DisplayName="Log XML Request and Response Documents" ShortDescription="Write the request and response documents to the log at Info level" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="TrustDeserializerClass" DisplayName="Trust Deserializer Class" ShortDescription="The class to use to process trusted payloads and execution payloads" DefaultValue="com.metamatrix.connector.xml.http.DefaultTrustDeserializer" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="ParameterMethod" DisplayName="Parameter Method" ShortDescription="" DefaultValue="None" Multiplicity="1">
- <AllowedValue>None</AllowedValue>
- <AllowedValue>Name/Value</AllowedValue>
- <AllowedValue>XMLRequest</AllowedValue>
- <AllowedValue>XMLInQueryString</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="MaxMemoryCacheSize" DisplayName="Max Size of in-memory cache (in kb)" ShortDescription="" DefaultValue="16384" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="InputStreamFilterClass" DisplayName="Input Stream Filter Class" ShortDescription="The class to use to preprocess raw XML input stream" DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="HostnameVerifier" DisplayName="Hostname Verifier" ShortDescription="Class implementing javax.net.ssl.HostnameVerifier. Used to implement a hostname mismatch workaround." IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="QueryPreprocessorClass" DisplayName="Query Preprocessor Class" ShortDescription="The class to use to preprocess the IQuery" DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="XML-Relational SOAP Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.919-06:00" CreationDate="2008-10-31T10:26:19.919-06:00">
- <PropertyDefinition Name="TextExtractionThreshold" DisplayName="Text Extraction Threshold (in kb)" ShortDescription="Extract text sections larger than this size to a file where more efficient access as a CLOB can be effected." DefaultValue="128" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="AuthPassword" DisplayName="Authentication User Password" ShortDescription="Password value for authentication" DefaultValue="" IsExpert="true" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="FileCacheLocation" DisplayName="Location of the File Cache" ShortDescription="" DefaultValue="" />
- <PropertyDefinition Name="SaxFilterProviderClass" DisplayName="XML Filter Provider" ShortDescription="The class the provides extended XML Filters" DefaultValue="com.metamatrix.connector.xml.base.NoExtendedFilters" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="AuthUserName" DisplayName="Authentication User Name" ShortDescription="Name value for authentication" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="CacheTimeout" DisplayName="Cache Timeout (in seconds)" ShortDescription="" DefaultValue="60" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="WSSecurityType" DisplayName="WS-Security Type(UsernameToken, SAML..)" ShortDescription="Type of WS-Security to be used; Combinations of multiple security types can be used with a space in-between. Allowed types are: (UsernameToken, UsernameToken-Digest, SAMLTokenUnsigned, SAMLTokenSigned, Signature, Timestamp, Encrypt)" DefaultValue="" IsPreferred="true" />
- <PropertyDefinition Name="XMLParmName" DisplayName="XML Parameter Name" ShortDescription="" DefaultValue="" IsHidden="true" IsModifiable="false" />
- <PropertyDefinition Name="EncryptUserName" DisplayName="Encrypt UserName (only if Encrypt profile used)" ShortDescription="The username to be used in the encryption; if blank uses auth username" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="ExceptionOnSOAPFault" DisplayName="Exception on SOAP Fault" ShortDescription="Throw connector exception when SOAP fault is returned from source." DefaultValue="true" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="MaxFileCacheSize" DisplayName="Max Size of file cache (in kb)" ShortDescription="" DefaultValue="-1" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="RequestTimeout" DisplayName="Request Timeout (in Milliseconds)" ShortDescription="" DefaultValue="10000" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="CryptoPropertyFile" DisplayName="User Crypto Property File (If SAML or Signature profile used)" ShortDescription="The file defines properties of cryptography;defines the certificates;(crypto.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.soap.SOAPConnectorState" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="SOAPAction" DisplayName="SOAP-Action" ShortDescription="Value for SOAP-Action header" DefaultValue="" IsExpert="true" />
- <PropertyDefinition Name="AccessMethod" DisplayName="Access Method (Get, Post)" ShortDescription="" DefaultValue="post" Multiplicity="1" IsHidden="true" IsModifiable="false">
- <AllowedValue>get</AllowedValue>
- <AllowedValue>post</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="ProxyUri" DisplayName="Proxy Server URI" ShortDescription="The URI of the proxy server" DefaultValue="" />
- <PropertyDefinition Name="EncryptPropertyFile" DisplayName="Encrypt crypto property file (only if Encrypt profile used)" ShortDescription="The file defines properties of cryptography for encryption of the message;(crypto.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="ExceptionOnIntraQueryCacheExpiration" DisplayName="Exception On Intra-Query Cache Expiration" ShortDescription="Throw an exception when a document expires from the cache between executing different parts of a single query (instead of requesting the document again)" DefaultValue="true" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.xml.base.XMLCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="SAMLPropertyFile" DisplayName="SAML Property File (only required when SAML profile used)" ShortDescription="SAML Security property file (saml.properties)" DefaultValue="" IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="EncodingStyle" DisplayName="Encoding Style (RPC - Encoded, RPC - Literal, Document - Literal, Document - Encoded)" ShortDescription="Encoding Style" DefaultValue="Document - Literal" Multiplicity="1">
- <AllowedValue>RPC - Encoded</AllowedValue>
- <AllowedValue>RPC - Literal</AllowedValue>
- <AllowedValue>Document - Literal</AllowedValue>
- <AllowedValue>Document - Encoded</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.xml.base.XMLConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="Uri" DisplayName="Server URI" ShortDescription="The URI of the HTTP source" Multiplicity="1" />
- <PropertyDefinition Name="SecurityType" DisplayName="WebService Security Used(None, HTTPBasic, WS-Security)" ShortDescription="Type of Authentication to used with the web service; If WS-Secuirty is being used, then WS-Secuirty type must be defined" DefaultValue="None" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="LogRequestResponseDocs" DisplayName="Log XML Request and Response Documents" ShortDescription="Write the request and response documents to the log at Info level" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="TrustDeserializerClass" DisplayName="Trust Deserializer Class" ShortDescription="The class to use to process trusted payloads and execution payloads" DefaultValue="com.metamatrix.connector.xml.soap.DefaultSoapTrustDeserializer" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="ParameterMethod" DisplayName="Parameter Method (None, Name/Value, XMLRequest, XMLInQueryString)" ShortDescription="" DefaultValue="XMLRequest" Multiplicity="1" IsHidden="true" IsModifiable="false">
- <AllowedValue>None</AllowedValue>
- <AllowedValue>Name/Value</AllowedValue>
- <AllowedValue>XMLRequest</AllowedValue>
- <AllowedValue>XMLInQueryString</AllowedValue>
- </PropertyDefinition>
- <PropertyDefinition Name="InputStreamFilterClass" DisplayName="Input Stream Filter Class" ShortDescription="The class to use to preprocess raw XML input stream" DefaultValue="com.metamatrix.connector.xml.base.PluggableInputStreamFilterImpl" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="MaxMemoryCacheSize" DisplayName="Max Size of in-memory cache (in kb)" ShortDescription="" DefaultValue="16384" Multiplicity="1" PropertyType="Integer" />
- <PropertyDefinition Name="HostnameVerifier" DisplayName="Hostname Verifier" ShortDescription="a class implmenting javax.net.ssl.HostnameVerifier. Used to implement a hostname mismatch workaround." IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="TrustType" DisplayName="Trust Type:(DirectReference or IssuerSerial)" ShortDescription="Only required for Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA." DefaultValue="DirectReference"
- IsExpert="true" IsPreferred="true" />
- <PropertyDefinition Name="QueryPreprocessorClass" DisplayName="Query Preprocessor Class" ShortDescription="The class to use to preprocess the IQuery" DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.952-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.952-06:00">
- <PropertyDefinition Name="MaxSQLLength" DisplayName="Max SQL String Length" ShortDescription="" DefaultValue="16384" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-jdbc-6.1.0-SNAPSHOT.jar;" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
- <PropertyDefinition Name="UseBindVariables" DisplayName="Use prepared statements and bind variables" ShortDescription="" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="ExtensionCapabilityClass" DisplayName="Extension Capability Class" ShortDescription="" IsExpert="true" />
- <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.JDBCConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="DatabaseTimeZone" DisplayName="Database time zone" ShortDescription="Time zone of the database, if different than Integration Server" IsExpert="true" />
- <PropertyDefinition Name="TransactionIsolationLevel" DisplayName="Transaction Isolation Level" ShortDescription="Set the data source transaction isolation level" DefaultValue="" IsExpert="true" />
- <PropertyDefinition Name="Password" DisplayName="Password" ShortDescription="" Multiplicity="0" IsConstrainedToAllowedValues="false" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.translator.Translator" IsExpert="true" />
- <PropertyDefinition Name="SetCriteriaBatchSize" DisplayName="Max Values in IN Predicate" ShortDescription="Max number of values in an IN Predicate. Must be >= 0." DefaultValue="1000" PropertyType="Integer" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="User" DisplayName="User Name" ShortDescription="" Multiplicity="0" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="TrimStrings" DisplayName="Trim string flag" ShortDescription="Right Trim fixed character types returned as Strings" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- <PropertyDefinition Name="UseCommentsInSourceQuery" DisplayName="Use informational comments in Source Queries" ShortDescription="This will embed /*comment*/ style comment with session/request id in source SQL query for informational purposes" DefaultValue="false" PropertyType="Boolean" IsPreferred="true" IsExpert="true" />
- <PropertyDefinition Name="ResultSetCacheEnabled" DisplayName="ResultSet Cache Enabled" ShortDescription="" DefaultValue="false" Multiplicity="0..1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ResultSetCacheMaxSize" DisplayName="ResultSet Cache Maximum Size (megabytes)" ShortDescription="" DefaultValue="0" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Oracle Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="oracle.jdbc.driver.OracleDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:oracle:thin:@<host>:1521:<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.oracle.OracleSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Oracle XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="oracle.jdbc.xa.client.OracleXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:oracle:thin:@<host>:1521:<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.oracle.OracleSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="DB2 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.ibm.db2.jcc.DB2Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:db2://<server>:50000/<db-name>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.db2.DB2SQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="DB2 XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.ibm.db2.jcc.DB2XADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="50000" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="DriverType" DisplayName="Driver Type" ShortDescription="" DefaultValue="4" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.db2.DB2SQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="SQL Server Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.microsoft.sqlserver.jdbc.SQLServerDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:sqlserver://<host>:1433;databaseName=<db-name>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sqlserver.SqlServerSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="SQL Server XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.microsoft.sqlserver.jdbc.SQLServerXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="1433" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sqlserver.SqlServerSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="MySQL JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mysql://<host>:3306/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="MySQL JDBC XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="3306" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="PostgreSQL JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="PostgreSQL XA JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.xa.PGXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="5432" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="Apache Derby Embedded Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.EmbeddedDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby:<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Apache Derby Network Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.ClientDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby://localhost:1527/<path/to/db>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Teiid JDBC 6 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbc.MMDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:metamatrix:<vdbName>@mm://<host>:<port>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="JDBC ODBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:<data-source-name>[;UID=<xxx> ;PWD=<xxx>]" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- </ComponentType>
- <ComponentType Name="MS Access Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=<data-source-name>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.access.AccessSQLTranslator" IsExpert="true" />
- </ComponentType>
- <ComponentType Name="MS Excel Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2006-02-08T11:02:36.029-06:00" CreatedBy="ConfigurationStartup" CreationDate="2006-02-08T11:02:36.029-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Excel Driver (*.xls)};DBQ=<filePathToExcelFile>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- </ComponentType>
+ <!--
+ *************************************************************************************
+ Connector Type (This section gets filled by build process at kit building time)
+ *************************************************************************************
+ -->
+${connector-types-fragment-fill-in}
</ComponentTypes>
</ConfigurationDocument>
\ No newline at end of file
Added: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml (rev 0)
+++ trunk/build/pom.xml 2009-05-11 21:25:37 UTC (rev 909)
@@ -0,0 +1,122 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>6.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>build</artifactId>
+ <packaging>pom</packaging>
+ <name>Build</name>
+ <description>Teiid Build</description>
+ <properties>
+ <org.jboss.teiid.version>6.1.0-SNAPSHOT</org.jboss.teiid.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <!-- addition of a new connector goes here as an bundle -->
+ <artifactItem>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-connector-api</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-xml</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-xml-common</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-jdbc</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-text</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-ldap</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-loopback</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.teiid.connectors</groupId>
+ <artifactId>connector-salesforce</artifactId>
+ <version>${org.jboss.teiid.version}</version>
+ <classifier>bundle</classifier>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>assemble-artifacts</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="assembly/embedded/build-configuration.xml" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Property changes on: trunk/build/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 10 months
teiid SVN: r908 - in trunk: connector-api and 16 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-11 17:19:03 -0400 (Mon, 11 May 2009)
New Revision: 908
Added:
trunk/connector-api/src/assembly/
trunk/connector-api/src/assembly/bundle.xml
trunk/connector-api/src/main/resources/connector-base.xml
Modified:
trunk/connector-api/pom.xml
trunk/connectors/connector-jdbc/pom.xml
trunk/connectors/connector-jdbc/src/assembly/bundle.xml
trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
trunk/connectors/connector-ldap/src/assembly/bundle.xml
trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml
trunk/connectors/connector-loopback/src/assembly/bundle.xml
trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml
trunk/connectors/connector-salesforce/src/assembly/bundle.xml
trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml
trunk/connectors/connector-text/src/assembly/bundle.xml
trunk/connectors/connector-text/src/main/resources/connector-text.xml
trunk/connectors/connector-xml/src/assembly/bundle.xml
trunk/connectors/connector-xml/src/main/resources/connector-xml.xml
trunk/pom.xml
Log:
TEIID-561: moved the base "connector" fragment from the Configuration.xml to connector-api project, and also made the "embedded" configuration build-up as part of the building the kit.
Modified: trunk/connector-api/pom.xml
===================================================================
--- trunk/connector-api/pom.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connector-api/pom.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -38,4 +38,29 @@
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/bundle.xml</descriptor>
+ </descriptors>
+ <outputDirectory>target/distribution</outputDirectory>
+ <workDirectory>target/assembly/work</workDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Added: trunk/connector-api/src/assembly/bundle.xml
===================================================================
--- trunk/connector-api/src/assembly/bundle.xml (rev 0)
+++ trunk/connector-api/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -0,0 +1,23 @@
+<!--This script builds a Zip file for the connector and its non-teiid dependencies -->
+<assembly>
+
+ <id>bundle</id>
+
+ <formats>
+ <format>zip</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>target/classes</directory>
+ <includes><include>connector-base.xml</include></includes>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/dependency</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
Property changes on: trunk/connector-api/src/assembly/bundle.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/connector-api/src/main/resources/connector-base.xml
===================================================================
--- trunk/connector-api/src/main/resources/connector-base.xml (rev 0)
+++ trunk/connector-api/src/main/resources/connector-base.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -0,0 +1,75 @@
+ <ComponentType Name="Connector" ComponentTypeCode="2" Deployable="false" Deprecated="false" Monitorable="true" SuperComponentType="Service" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.916-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.916-06:00">
+ <PropertyDefinition Name="SourceConnectionTestInterval" DisplayName="Data Source Test Connect Interval (seconds)" ShortDescription="How often (in seconds) to create test connections to the underlying datasource to see if it is available." DefaultValue="600" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system)" Multiplicity="0..1" IsExpert="true" IsHidden="true" />
+ <PropertyDefinition Name="ExceptionOnMaxRows" DisplayName="Exception on Exceeding Max Rows" ShortDescription="Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="metamatrix.service.essentialservice" DisplayName="Essential Service" ShortDescription="Indicates if the service is essential to operation of the Integration Server" DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" IsHidden="true" />
+ <PropertyDefinition Name="ServiceMonitoringEnabled" DisplayName="Data Source Monitoring Enabled" ShortDescription="Whether to monitor the underlying data source to see if it is available." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" ISExpert="true" />
+ <PropertyDefinition Name="Immutable" DisplayName="Is Immutable" ShortDescription="True if the source never changes." DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="ConnectorMaxThreads" DisplayName="Connector Maximum Thread Count" ShortDescription="" DefaultValue="20" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
+ <PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" Multiplicity="1" IsExpert="true" IsHidden="true" />
+ <PropertyDefinition Name="ServiceClassName" DisplayName="Service Class Name" ShortDescription="" DefaultValue="com.metamatrix.server.connector.service.ConnectorService" Multiplicity="1" IsHidden="true" />
+ <PropertyDefinition Name="MaxResultRows" DisplayName="Maximum Result Rows" ShortDescription="" DefaultValue="10000" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
+ <PropertyDefinition Name="ConnectorThreadTTL" DisplayName="Thread Time to live (milliseconds)" ShortDescription="" DefaultValue="120000" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
+ <PropertyDefinition Name="ResultSetCacheEnabled" DisplayName="ResultSet Cache Enabled" ShortDescription="" DefaultValue="false" Multiplicity="0..1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ResultSetCacheMaxSize" DisplayName="ResultSet Cache Maximum Size (megabytes)" ShortDescription="" DefaultValue="20" PropertyType="Integer" />
+ <PropertyDefinition Name="ResultSetCacheMaxAge" DisplayName="ResultSet Cache Maximum Age (milliseconds)" ShortDescription="" DefaultValue="3600000" PropertyType="Long" IsExpert="true" />
+ <PropertyDefinition Name="ResultSetCacheScope" DisplayName="ResultSet Cache Scope" ShortDescription="" DefaultValue="vdb" IsExpert="true">
+ <AllowedValue>vdb</AllowedValue>
+ <AllowedValue>session</AllowedValue>
+ </PropertyDefinition>
+ <PropertyDefinition Name="com.metamatrix.data.pool.max_connections" DisplayName="Pool Maximum Connections" ShortDescription="Set the maximum number of connections for the connection pool" DefaultValue="20" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="com.metamatrix.data.pool.max_connections_for_each_id" DisplayName="Pool Maximum Connections for Each ID" ShortDescription="Set the maximum number of connections for each connector ID for the connection pool" DefaultValue="20" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="com.metamatrix.data.pool.live_and_unused_time" DisplayName="Pool Connection Idle Time (seconds)" ShortDescription="Set the idle time of the connection before it should be closed if pool shrinking is enabled" DefaultValue="60" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="com.metamatrix.data.pool.wait_for_source_time" DisplayName="Pool Connection Waiting Time (milliseconds)" ShortDescription="Set the time to wait if the connection is not available" DefaultValue="120000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="com.metamatrix.data.pool.cleaning_interval" DisplayName="Pool cleaning Interval (seconds)" ShortDescription="Set the interval to cleaning the pool" DefaultValue="60" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="com.metamatrix.data.pool.enable_shrinking" DisplayName="Enable Pool Shrinking" ShortDescription="Set whether to enable the pool shrinking" DefaultValue="false" Multiplicity="0..1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
+ <PropertyDefinition Name="supportsAndCriteria" DisplayName="supportsAndCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteria" DisplayName="supportsCompareCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaEquals" DisplayName="supportsCompareCriteriaEquals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaGreaterThan" DisplayName="supportsCompareCriteriaGreaterThan" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaGreaterThanOrEqual" DisplayName="supportsCompareCriteriaGreaterThanOrEqual" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaLessThan" DisplayName="supportsCompareCriteriaLessThan" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaLessThanOrEqual" DisplayName="supportsCompareCriteriaLessThanOrEqual" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCompareCriteriaNotEquals" DisplayName="supportsCompareCriteriaNotEquals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCriteria" DisplayName="supportsCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsInCriteria" DisplayName="supportsInCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsIsNullCriteria" DisplayName="supportsIsNullCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsJoins" DisplayName="supportsJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsLikeCriteria" DisplayName="supportsLikeCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsNotCriteria" DisplayName="supportsNotCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsOrCriteria" DisplayName="supportsOrCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsSelectDistinct" DisplayName="supportsSelectDistinct" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsSelectLiterals" DisplayName="supportsSelectLiterals" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAliasedGroup" DisplayName="supportsAliasedGroup" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsSelfJoins" DisplayName="supportsSelfJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsOuterJoins" DisplayName="supportsOuterJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsFullOuterJoins" DisplayName="supportsFullOuterJoins" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsBetweenCriteria" DisplayName="supportsBetweenCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsLikeCriteriaEscapeCharacter" DisplayName="supportsLikeCriteriaEscapeCharacter" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsInCriteriaSubquery" DisplayName="supportsInCriteriaSubquery" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsExistsCriteria" DisplayName="supportsExistsCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsQuantifiedCompareCriteria" DisplayName="supportsQuantifiedCompareCriteria" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsQuantifiedCompareCriteriaSome" DisplayName="supportsQuantifiedCompareCriteriaSome" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsQuantifiedCompareCriteriaAll" DisplayName="supportsQuantifiedCompareCriteriaAll" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsOrderBy" DisplayName="supportsOrderBy" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregates" DisplayName="supportsAggregates" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesSum" DisplayName="supportsAggregatesSum" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesAvg" DisplayName="supportsAggregatesAvg" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesMin" DisplayName="supportsAggregatesMin" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesMax" DisplayName="supportsAggregatesMax" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesCount" DisplayName="supportsAggregatesCount" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesCountStar" DisplayName="supportsAggregatesCountStar" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsAggregatesDistinct" DisplayName="supportsAggregatesDistinct" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsScalarSubqueries" DisplayName="supportsScalarSubqueries" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCorrelatedSubqueries" DisplayName="supportsCorrelatedSubqueries" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsCaseExpressions" DisplayName="supportsCaseExpressions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsSearchedCaseExpressions" DisplayName="supportsSearchedCaseExpressions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsScalarFunctions" DisplayName="supportsScalarFunctions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="getSupportedFunctions" DisplayName="getSupportedFunctions" ShortDescription="" Multiplicity="0..1" PropertyType="string" IsExpert="true" />
+ <PropertyDefinition Name="supportsInlineViews" DisplayName="supportsInlineViews" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsOrderByInInlineViews" DisplayName="supportsOrderByInInlineViews" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsUnionOrderBy" DisplayName="supportsUnionOrderBy" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ <PropertyDefinition Name="supportsUnions" DisplayName="supportsUnions" ShortDescription="" Multiplicity="0..1" PropertyType="Boolean" IsExpert="true" />
+ </ComponentType>
+
\ No newline at end of file
Property changes on: trunk/connector-api/src/main/resources/connector-base.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-jdbc/pom.xml
===================================================================
--- trunk/connectors/connector-jdbc/pom.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-jdbc/pom.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -72,6 +72,7 @@
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
+ <includeArtifactIds>${project.artifactId}</includeArtifactIds>
<outputDirectory>target/dependency</outputDirectory>
</configuration>
</execution>
Modified: trunk/connectors/connector-jdbc/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-jdbc/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -21,4 +21,18 @@
</fileSet>
</fileSets>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml
===================================================================
--- trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-jdbc/src/main/resources/connector-jdbc.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,6 +1,7 @@
<ComponentType Name="JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.952-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.952-06:00">
+ <PropertyDefinition Name="MaxSQLLength" DisplayName="Max SQL String Length" ShortDescription="" DefaultValue="16384" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
<PropertyDefinition Name="UseBindVariables" DisplayName="Use prepared statements and bind variables" ShortDescription="" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
<PropertyDefinition Name="ExtensionCapabilityClass" DisplayName="Extension Capability Class" ShortDescription="" IsExpert="true" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.JDBCConnector" Multiplicity="1" IsExpert="true" />
@@ -13,7 +14,6 @@
<AllowedValue></AllowedValue>
</PropertyDefinition>
<PropertyDefinition Name="Password" DisplayName="Password" ShortDescription="" Multiplicity="0" IsConstrainedToAllowedValues="false" IsMasked="true" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:<protocol>:<url>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.translator.Translator" IsExpert="true" />
<PropertyDefinition Name="SetCriteriaBatchSize" DisplayName="Max Values in IN Predicate" ShortDescription="Max number of values in an IN Predicate. Must be >= 0." DefaultValue="1000" PropertyType="Integer" IsConstrainedToAllowedValues="false" IsExpert="true" />
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
@@ -23,71 +23,139 @@
<PropertyDefinition Name="UseCommentsInSourceQuery" DisplayName="Use informational comments in Source Queries" ShortDescription="This will embed /*comment*/ style comment with session/request id in source SQL query for informational purposes" DefaultValue="false" PropertyType="Boolean" IsPreferred="true" IsExpert="true"/>
<PropertyDefinition Name="ResultSetCacheEnabled" DisplayName="ResultSet Cache Enabled" ShortDescription="" DefaultValue="false" Multiplicity="0..1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
<PropertyDefinition Name="ResultSetCacheMaxSize" DisplayName="ResultSet Cache Maximum Size (megabytes)" ShortDescription="" DefaultValue="0" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
-
</ComponentType>
-
- <ComponentType Name="Apache Derby Embedded Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.941-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.941-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.EmbeddedDataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby:<databaseName>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" IsExpert="true" />
+ <ComponentType Name="Oracle Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="oracle.jdbc.driver.OracleDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:oracle:thin:@<host>:1521:<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.oracle.OracleSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
- <ComponentType Name="Apache Derby Network Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.942-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.942-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.ClientDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby:<databaseName>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" IsExpert="true" />
+ <ComponentType Name="Oracle XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="oracle.jdbc.xa.client.OracleXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:oracle:thin:@<host>:1521:<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.oracle.OracleSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
- <ComponentType Name="MS Access Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.954-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.954-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=<data-source-name>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.access.AccessSQLTranslator" IsExpert="true" />
+ <ComponentType Name="DB2 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.ibm.db2.jcc.DB2Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:db2://<server>:50000/<db-name>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.db2.DB2SQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
- <ComponentType Name="MS Excel Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2006-02-08T11:02:36.029-06:00" CreatedBy="ConfigurationStartup" CreationDate="2006-02-08T11:02:36.029-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Excel Driver (*.xls)};DBQ=<filePathToExcelFile>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <ComponentType Name="DB2 XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.ibm.db2.jcc.DB2XADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="50000" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DriverType" DisplayName="Driver Type" ShortDescription="" DefaultValue="4" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.db2.DB2SQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
- <ComponentType Name="MySQL 4 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.938-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.938-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mysql://<host>:3306/<databaseName>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" IsExpert="true" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
+ <ComponentType Name="SQL Server Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.microsoft.sqlserver.jdbc.SQLServerDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:sqlserver://<host>:1433;databaseName=<db-name>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sqlserver.SqlServerSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
- <ComponentType Name="PostgreSQL 8 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.940-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.940-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.xa.PGXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432;DatabaseName=/<databaseName>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator" IsExpert="true" />
- <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
+ <ComponentType Name="SQL Server XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.microsoft.sqlserver.jdbc.SQLServerXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="1433" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sqlserver.SqlServerSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
- <ComponentType Name="Teiid JDBC 6 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="metamatrixadmin" LastChangedDate="2005-07-26T14:34:20.960-06:00" CreatedBy="metamatrixadmin" CreationDate="2005-07-26T14:34:20.960-06:00">
- <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbc.MMDataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:metamatrix:<vdbName>@mm://<host>:<port>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <ComponentType Name="MySQL JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mysql://<host>:3306/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
+ <ComponentType Name="MySQL JDBC XA Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="3306" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.mysql.MySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
- <ComponentType Name="JDBC ODBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.953-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.953-06:00">
+ <ComponentType Name="PostgreSQL JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.Driver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
+ <ComponentType Name="PostgreSQL XA JDBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.postgresql.xa.PGXADataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="PortNumber" DisplayName="Port Number" DefaultValue="5432" ShortDescription="" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ServerName" DisplayName="Server Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="DatabaseName" DisplayName="Database Name" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.postgresql.PostgreSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
+ </ComponentType>
+ <ComponentType Name="Apache Derby Embedded Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.EmbeddedDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby:<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
+ <ComponentType Name="Apache Derby Network Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="org.apache.derby.jdbc.ClientDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:derby://localhost:1527/<path/to/db>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.derby.DerbySQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
+ <ComponentType Name="Teiid JDBC 6 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbc.MMDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:metamatrix:<vdbName>@mm://<host>:<port>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ </ComponentType>
+ <ComponentType Name="JDBC ODBC Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:<data-source-name>[;UID=<xxx> ;PWD=<xxx>]" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
</ComponentType>
+ <ComponentType Name="MS Access Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" CreatedBy="ConfigurationStartup">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=<data-source-name>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.access.AccessSQLTranslator" IsExpert="true" />
+ </ComponentType>
+ <ComponentType Name="MS Excel Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2006-02-08T11:02:36.029-06:00" CreatedBy="ConfigurationStartup" CreationDate="2006-02-08T11:02:36.029-06:00">
+ <PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="sun.jdbc.odbc.JdbcOdbcDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:odbc:Driver={MicroSoft Excel Driver (*.xls)};DBQ=<filePathToExcelFile>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ </ComponentType>
+ <!--
<ComponentType Name="Datadirect DB2 8 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.928-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.928-06:00">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbcx.db2.DB2DataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:db2://<host>:50000;DatabaseName=<databasename>;CollectionID=<collectionid>;PackageName=<packagename>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.db2.DB2SQLTranslator" IsExpert="true" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
<ComponentType Name="Datadirect Oracle 9 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.923-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.923-06:00">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbcx.oracle.OracleDataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:oracle://<host>:1521;SID=<sid>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.oracle.OracleSQLTranslator" IsExpert="true" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
<ComponentType Name="Datadirect SQL Server 2003 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.935-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.935-06:00">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbcx.sqlserver.SQLServerDataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sqlserver://<host>:1433;DatabaseName=<databasename>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sqlserver.SqlServerSQLTranslator" IsExpert="true" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
</ComponentType>
<ComponentType Name="Datadirect Sybase 12 Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="JDBC Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.930-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.930-06:00">
<PropertyDefinition Name="ConnectionSource" DisplayName="Connection Source Class" ShortDescription="Driver, DataSource, or XADataSource class name" DefaultValue="com.metamatrix.jdbcx.sybase.SybaseDataSource" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sybase://<host>:5000;DatabaseName=<databasename>" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
+ <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
<PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.sybase.SybaseSQLTranslator" IsExpert="true" />
<PropertyDefinition Name="IsXA" DisplayName="Is XA" ShortDescription="Is XA" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsConstrainedToAllowedValues="true" IsPreferred="true" />
<PropertyDefinition Name="SetCriteriaBatchSize" DisplayName="Max Values in IN Predicate" ShortDescription="Max number of values in an IN Predicate. Must be >= 0." DefaultValue="250" PropertyType="Integer" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
\ No newline at end of file
+ </ComponentType>
+ -->
\ No newline at end of file
Modified: trunk/connectors/connector-ldap/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-ldap/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-ldap/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -21,4 +21,18 @@
</fileSet>
</fileSets>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml
===================================================================
--- trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,6 +1,6 @@
<ComponentType Name="LDAP Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.946-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.946-06:00">
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
<PropertyDefinition Name="SearchDefaultBaseDN" DisplayName="Default Search Base DN" ShortDescription="Default Base DN for LDAP Searches" IsExpert="true" />
<PropertyDefinition Name="LdapAdminUserDN" DisplayName="Ldap Admin User DN" ShortDescription="User DN for the LDAP admin account." DefaultValue="cn=<>,ou=<>,dc=<>" Multiplicity="1" IsPreferred="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard Type" ShortDescription="Standard Built-in Connector Type" DefaultValue="true" PropertyType="Boolean" IsExpert="true" IsModifiable="false" />
@@ -14,4 +14,5 @@
<PropertyDefinition Name="RestrictToObjectClass" DisplayName="Restrict Searches To Named Object Class" ShortDescription="Restrict Searches to objectClass named in the Name field for a table" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
<PropertyDefinition Name="LdapTxnTimeoutInMillis" DisplayName="Ldap Transaction Timeout (ms)" ShortDescription="Timeout value for LDAP searches. Defaults to TCP timeout value." />
<PropertyDefinition Name="LdapUrl" DisplayName="Ldap URL" ShortDescription="Ldap URL of the server, including port number." DefaultValue="ldap://<ldapServer>:<389>" Multiplicity="1" IsPreferred="true" />
- </ComponentType>
\ No newline at end of file
+ </ComponentType>
+
\ No newline at end of file
Modified: trunk/connectors/connector-loopback/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-loopback/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-loopback/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -21,4 +21,18 @@
</fileSet>
</fileSets>
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml
===================================================================
--- trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,9 +1,10 @@
<ComponentType Name="Loopback Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.945-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.945-06:00">
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
<PropertyDefinition Name="CapabilitiesClass" DisplayName="Capabilities Class" ShortDescription="" DefaultValue="com.metamatrix.connector.loopback.LoopbackCapabilities" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="WaitTime" DisplayName="Max Random Wait Time" ShortDescription="" DefaultValue="0" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.loopback.LoopbackConnector" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="RowCount" DisplayName="Rows Per Query" ShortDescription="" DefaultValue="1" Multiplicity="1" IsExpert="true" IsPreferred="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard Type" ShortDescription="Standard Built-in Connector Type" DefaultValue="true" PropertyType="Boolean" IsExpert="true" IsModifiable="false" />
- </ComponentType>
\ No newline at end of file
+ </ComponentType>
+
\ No newline at end of file
Modified: trunk/connectors/connector-salesforce/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-salesforce/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-salesforce/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -19,5 +19,20 @@
<directory>target/dependency</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
- </fileSets>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml
===================================================================
--- trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,10 +1,11 @@
<ComponentType Name="Salesforce Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.916-06:00" CreationDate="2008-10-31T10:26:19.916-06:00">
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
<PropertyDefinition Name="username" DisplayName="User Name" ShortDescription="Name value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsPreferred="true" />
<PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.ConnectorState" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.Connector" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="password" DisplayName="Password" ShortDescription="Password value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsMasked="true" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="Salesforce URL" ShortDescription="URL for connecting to Salesforce" DefaultValue="" IsExpert="true" />
<PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.salesforce.SalesforceCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- </ComponentType>
\ No newline at end of file
+ </ComponentType>
+
\ No newline at end of file
Modified: trunk/connectors/connector-text/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-text/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-text/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -20,4 +20,19 @@
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-text/src/main/resources/connector-text.xml
===================================================================
--- trunk/connectors/connector-text/src/main/resources/connector-text.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-text/src/main/resources/connector-text.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,6 +1,6 @@
<ComponentType Name="Text File Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.945-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.945-06:00">
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true"/>
<PropertyDefinition Name="PartialStartupAllowed" DisplayName="Partial Startup Allowed" ShortDescription="" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" IsPreferred="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard Type" ShortDescription="Standard Built-in Connector Type" DefaultValue="true" PropertyType="Boolean" IsExpert="true" IsModifiable="false" />
<PropertyDefinition Name="DescriptorFile" DisplayName="Text File Descriptor" ShortDescription="" Multiplicity="1" IsPreferred="true" />
@@ -8,4 +8,5 @@
<PropertyDefinition Name="EnforceColumnCount" DisplayName="Enforce Column Count" ShortDescription="This forces the number of columns in text file to match what was modeled" DefaultValue="false" PropertyType="Boolean" IsConstrainedToAllowedValues="false" />
<PropertyDefinition Name="DateResultFormatsDelimiter" DisplayName="Date Result Formats Delimiter" ShortDescription="" IsExpert="true" />
<PropertyDefinition Name="DateResultFormats" DisplayName="Date Result Formats" ShortDescription="" IsExpert="true" />
- </ComponentType>
\ No newline at end of file
+ </ComponentType>
+
\ No newline at end of file
Modified: trunk/connectors/connector-xml/src/assembly/bundle.xml
===================================================================
--- trunk/connectors/connector-xml/src/assembly/bundle.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-xml/src/assembly/bundle.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -20,4 +20,19 @@
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>true</useProjectArtifact>
+ <useTransitiveDependencies>false</useTransitiveDependencies>
+ <useTransitiveFiltering>false</useTransitiveFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <unpack>false</unpack>
+
+ <excludes>
+ <exclude>teiid:*</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
</assembly>
\ No newline at end of file
Modified: trunk/connectors/connector-xml/src/main/resources/connector-xml.xml
===================================================================
--- trunk/connectors/connector-xml/src/main/resources/connector-xml.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/connectors/connector-xml/src/main/resources/connector-xml.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -1,6 +1,6 @@
<ComponentType Name="XML Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.917-06:00" CreationDate="2008-10-31T10:26:19.917-06:00">
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
- <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
+ <PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true"/>
</ComponentType>
<ComponentType Name="XML File Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="XML Connector" ParentComponentType="Connectors" LastChangedDate="2008-10-31T10:26:19.917-06:00" CreationDate="2008-10-31T10:26:19.917-06:00">
@@ -128,4 +128,4 @@
<PropertyDefinition Name="TrustType" DisplayName="Trust Type:(DirectReference or IssuerSerial)" ShortDescription="Only required for Signature and Signed SAML; The issuer-serial method presumes that all trusted users of the service are known to the service and have pre-registered their certificate chains before using the service. The direct-reference method presumes that the service operator trusts all users with certificates issued by a trusted CA." DefaultValue="DirectReference" IsExpert="true" IsPreferred="true" />
<PropertyDefinition Name="QueryPreprocessorClass" DisplayName="Query Preprocessor Class" ShortDescription="The class to use to preprocess the IQuery" DefaultValue="com.metamatrix.connector.xml.base.NoQueryPreprocessing" IsConstrainedToAllowedValues="false" IsExpert="true" />
</ComponentType>
-
\ No newline at end of file
+
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-05-11 20:34:38 UTC (rev 907)
+++ trunk/pom.xml 2009-05-11 21:19:03 UTC (rev 908)
@@ -83,7 +83,6 @@
<!-- <descriptor>build/assembly/bin.xml</descriptor>-->
<descriptor>build/assembly/embedded/embedded-client-jar.xml</descriptor>
<descriptor>build/assembly/embedded/embedded-dependencies.xml</descriptor>
- <descriptor>build/assembly/embedded/embedded-connector-dependencies.xml</descriptor>
<descriptor>build/assembly/embedded/embedded-jar.xml</descriptor>
<descriptor>build/assembly/embedded/embedded-dist.xml</descriptor>
<descriptor>build/assembly/cdk/cdk-dependencies.xml</descriptor>
@@ -97,6 +96,7 @@
</plugins>
</build>
<modules>
+ <module>build</module>
<module>documentation</module>
</modules>
</profile>
14 years, 10 months
teiid SVN: r907 - in trunk: engine/src/main/java/com/metamatrix/server/serverapi and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 16:34:38 -0400 (Mon, 11 May 2009)
New Revision: 907
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java
trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java
trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java
trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServiceInterface.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
trunk/server/src/test/java/com/metamatrix/admin/server/IdentifierConstants.java
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java
Log:
TEIID-491 added execution id as the fourth parameter to an atomic cancel identifier.
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -403,7 +403,7 @@
MMRequest request = null;
if (src.getConnectorBindingUUID() != null) {
- request = new MMRequest(new String[] {connId, String.valueOf(src.getRequestID().getExecutionID()), String.valueOf(src.getNodeID())});
+ request = new MMRequest(new String[] {connId, String.valueOf(src.getRequestID().getExecutionID()), String.valueOf(src.getNodeID()), String.valueOf(src.getExecutionID())});
}
else {
request = new MMRequest(new String[] {connId, String.valueOf(src.getRequestID().getExecutionID())});
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPRuntimeStateAdminImpl.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -45,6 +45,7 @@
import com.metamatrix.common.comm.api.ServerConnection;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.jdbc.EmbeddedConnectionFactoryImpl;
@@ -272,7 +273,7 @@
public void cancelSourceRequest(String identifier)
throws AdminException {
- if (identifier == null || !identifier.matches("\\d+\\" + Request.DELIMITER + "\\d+\\" + Request.DELIMITER + "\\d+")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (identifier == null || !identifier.matches("\\d+\\" + Request.DELIMITER + "\\d+\\" + Request.DELIMITER + "\\d+" + Request.DELIMITER + "\\d+")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.Invalid_identifier")); //$NON-NLS-1$
}
@@ -281,10 +282,11 @@
String connId = identifierParts[0];
long requestId = Long.parseLong(identifierParts[1]);
int nodeId = Integer.parseInt(identifierParts[2]);
- RequestID id = new RequestID(connId, requestId);
+ int executionId = Integer.parseInt(identifierParts[3]);
+ AtomicRequestID id = new AtomicRequestID(new RequestID(connId, requestId), nodeId, executionId);
try {
- this.manager.getDQP().cancelAtomicRequest(id, nodeId);
+ this.manager.getDQP().cancelAtomicRequest(id);
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
}
Modified: trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/engine/src/main/java/com/metamatrix/server/serverapi/RequestInfo.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -44,6 +44,7 @@
private int nodeID = Integer.MIN_VALUE;
private String connectorBindingUUID;
private String transactionId;
+ private int executionID;
public RequestInfo(RequestID requestId, String originalCommand, Date submittedTime, Date processingTime) {
this.requestID = requestId;
@@ -113,6 +114,14 @@
public void setNodeID(int nodeID) {
this.nodeID = nodeID;
}
+
+ public int getExecutionID() {
+ return executionID;
+ }
+
+ public void setExecutionID(int executionID) {
+ this.executionID = executionID;
+ }
/**
* Get the actual command to perform.
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -68,6 +68,7 @@
import com.metamatrix.dqp.client.MetadataResult;
import com.metamatrix.dqp.client.ResultsFuture;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.dqp.message.RequestMessage;
@@ -220,6 +221,7 @@
info.setSessionToken(holder.dqpWorkContext.getSessionToken());
info.setConnectorBindingUUID(arm.getConnectorBindingID());
info.setNodeID(arm.getAtomicRequestID().getNodeID());
+ info.setExecutionID(arm.getAtomicRequestID().getExecutionId());
results.add(info);
}
results.add(req);
@@ -349,12 +351,13 @@
* partial results then remove the original request.
* @throws MetaMatrixComponentException
*/
- public void cancelAtomicRequest(RequestID requestID, int nodeID) throws MetaMatrixComponentException {
- RequestWorkItem workItem = safeGetWorkItem(requestID);
+ public void cancelAtomicRequest(AtomicRequestID requestID) throws MetaMatrixComponentException {
+ RequestWorkItem workItem = safeGetWorkItem(requestID.getRequestID());
if (workItem == null) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Could not cancel", requestID, "parent request does not exist"); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
- workItem.requestAtomicRequestCancel(nodeID);
+ workItem.requestAtomicRequestCancel(requestID);
}
RequestWorkItem getRequestWorkItem(RequestID reqID) throws MetaMatrixProcessingException {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -64,7 +64,6 @@
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.exception.SourceWarning;
import com.metamatrix.dqp.message.AtomicRequestID;
-import com.metamatrix.dqp.message.AtomicRequestMessage;
import com.metamatrix.dqp.message.ParameterInfo;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.dqp.message.RequestMessage;
@@ -604,24 +603,20 @@
return true;
}
- public boolean requestAtomicRequestCancel(int accessNodeID) throws MetaMatrixComponentException {
+ public boolean requestAtomicRequestCancel(AtomicRequestID ari) throws MetaMatrixComponentException {
// in the case that this does not support partial results; cancel
// the original processor request.
if(!requestMsg.supportsPartialResults()) {
return requestCancel();
}
- // Walk through all connector infos and attempt to cancel each one
- for (DataTierTupleSource connectorRequest : this.connectorInfo.values()) {
- AtomicRequestMessage aqr = connectorRequest.getAtomicRequestMessage();
- if (aqr.getAtomicRequestID().getNodeID() == accessNodeID) {
- connectorRequest.cancelRequest();
- return true;
- }
+
+ DataTierTupleSource connectorRequest = this.connectorInfo.get(ari);
+ if (connectorRequest != null) {
+ connectorRequest.cancelRequest();
+ return true;
}
- if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_DQP, "Connector request not queued yet. RequestID=" + requestID+ " Node id="+ accessNodeID); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ LogManager.logDetail(LogConstants.CTX_DQP, "Connector request not found. AtomicRequestID=", ari); //$NON-NLS-1$
return false;
}
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -928,8 +928,9 @@
MMRequest request;
if (info.isAtomicQuery()) {
- identifierParts = new String[3];
+ identifierParts = new String[4];
identifierParts[2] = String.valueOf(info.getNodeID());
+ identifierParts[3] = String.valueOf(info.getExecutionID());
} else {
identifierParts = new String[2];
}
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -55,6 +55,7 @@
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.config.model.BasicDeployedComponent;
import com.metamatrix.core.vdb.VDBStatus;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.metadata.runtime.RuntimeMetadataCatalog;
import com.metamatrix.metadata.runtime.RuntimeVDBDeleteUtility;
@@ -131,12 +132,13 @@
String sessionID = null;
long requestIDLong = -1;
int nodeID = -1;
-
+ int executionId = -1;
try {
String[] identifierParts = MMRequest.buildIdentifierArray(identifier);
sessionID = identifierParts[0];
requestIDLong = Long.parseLong(identifierParts[1]);
nodeID = Integer.parseInt(identifierParts[2]);
+ executionId = Integer.parseInt(identifierParts[3]);
} catch (NumberFormatException e) {
throwProcessingException("ServerRuntimeStateAdminImpl.Invalid_Source_Request_Identifier", new Object[] {identifier, Request.DELIMITER}); //$NON-NLS-1$
} catch (ArrayIndexOutOfBoundsException e) {
@@ -145,8 +147,7 @@
try {
- RequestID requestID = new RequestID(sessionID, requestIDLong);
- getQueryServiceProxy().cancelQuery(requestID, nodeID);
+ getQueryServiceProxy().cancelQuery(new AtomicRequestID(new RequestID(sessionID, requestIDLong), nodeID, executionId));
} catch(InvalidRequestIDException e) {
throw new AdminProcessingException(e);
} catch (MetaMatrixComponentException e) {
Modified: trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -53,6 +53,7 @@
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.client.ClientSideDQP;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.platform.security.api.SessionToken;
@@ -190,9 +191,9 @@
/*
* @see com.metamatrix.server.query.service.QueryServiceInterface#cancelQuery(com.metamatrix.dqp.message.RequestID, int)
*/
- public void cancelQuery(RequestID requestID, int nodeID)
+ public void cancelQuery(AtomicRequestID ari)
throws InvalidRequestIDException, MetaMatrixComponentException {
- this.dqp.cancelAtomicRequest(requestID, nodeID);
+ this.dqp.cancelAtomicRequest(ari);
}
/**
Modified: trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServiceInterface.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/main/java/com/metamatrix/server/query/service/QueryServiceInterface.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -31,6 +31,7 @@
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.server.InvalidRequestIDException;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.platform.security.api.SessionToken;
import com.metamatrix.platform.service.api.CacheAdmin;
@@ -60,7 +61,7 @@
public void cancelQuery(RequestID requestID, boolean shouldRollback)
throws InvalidRequestIDException, MetaMatrixComponentException;
- public void cancelQuery(RequestID requestID, int nodeID)
+ public void cancelQuery(AtomicRequestID ari)
throws InvalidRequestIDException, MetaMatrixComponentException;
Collection<Transaction> getTransactions();
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -37,12 +37,14 @@
import com.metamatrix.admin.api.exception.AdminException;
import com.metamatrix.admin.api.objects.Request;
import com.metamatrix.admin.api.objects.Transaction;
+import com.metamatrix.admin.objects.MMAdminObject;
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.server.InvalidRequestIDException;
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.SessionToken;
@@ -131,16 +133,14 @@
public void cancelQuery(RequestID requestID,
boolean shouldRollback) throws InvalidRequestIDException,
MetaMatrixComponentException {
- cancelledQueries.add(buildIdentifierFromRequestId(requestID, null));
+ cancelledQueries.add(requestID.getConnectionID() + MMAdminObject.DELIMITER_CHAR + requestID.getExecutionID());
}
-
- /**
- * @see com.metamatrix.server.query.service.BaseQueryServiceInterface#cancelQuery(com.metamatrix.dqp.message.RequestID, int)
- */
- public void cancelQuery(RequestID requestID,
- int nodeID) throws InvalidRequestIDException,
- MetaMatrixComponentException{
- cancelledQueries.add(buildIdentifierFromRequestId(requestID, "" +nodeID)); //$NON-NLS-1$
+
+ @Override
+ public void cancelQuery(AtomicRequestID ari)
+ throws InvalidRequestIDException, MetaMatrixComponentException {
+ cancelledQueries.add(ari.getRequestID().getConnectionID() + MMAdminObject.DELIMITER_CHAR + ari.getRequestID().getExecutionID()
+ +MMAdminObject.DELIMITER_CHAR + ari.getNodeID() + MMAdminObject.DELIMITER_CHAR + ari.getExecutionId());
}
/**
@@ -258,29 +258,6 @@
public void clearCache(String name,
Properties props) throws MetaMatrixComponentException{
}
-
- /**
- * Build the Identifer, as an array of its parts
- * @param requestId
- *
- * @return the Identifer, as an array of its parts
- * @since 4.3
- */
- private static String buildIdentifierFromRequestId(RequestID requestId, String nodeId) {
- String connectionId = requestId.getConnectionID();
- String executionId = Long.toString(requestId.getExecutionID());
-
- StringBuffer buff = new StringBuffer();
- buff.append(connectionId);
- buff.append(Request.DELIMITER_CHAR);
- buff.append(executionId);
- if ( nodeId != null ) {
- buff.append(Request.DELIMITER_CHAR);
- buff.append(nodeId);
- }
-
- return buff.toString();
- }
public void init(ServiceID id, DeployedComponentID deployedComponentID,
Properties props, ClientServiceRegistry listenerRegistry){
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/IdentifierConstants.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/IdentifierConstants.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/IdentifierConstants.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -61,7 +61,7 @@
/**
* @since 4.3
*/
- final String REQUEST_1_1_1 = "1" + Request.DELIMITER + "1" + Request.DELIMITER + "1"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ final String REQUEST_1_1_1_0 = "1" + Request.DELIMITER + "1" + Request.DELIMITER + "1" + Request.DELIMITER + "0"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
/**
* @since 4.3
*/
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -483,7 +483,7 @@
assertEquals(2, results.size());
Request request = (Request) results.iterator().next();
- assertEquals(REQUEST_1_1_1, request.getIdentifier());
+ assertEquals(REQUEST_1_1_1_0, request.getIdentifier());
assertEquals("1", request.getSessionID()); //$NON-NLS-1$
assertEquals("1", request.getRequestID()); //$NON-NLS-1$
assertEquals("1", request.getNodeID()); //$NON-NLS-1$
@@ -497,7 +497,7 @@
results = admin.getSourceRequests(_1_1_WILDCARD);
assertEquals(1, results.size());
- results = admin.getSourceRequests(REQUEST_1_1_1);
+ results = admin.getSourceRequests(REQUEST_1_1_1_0);
assertEquals(1, results.size());
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java 2009-05-11 19:40:52 UTC (rev 906)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java 2009-05-11 20:34:38 UTC (rev 907)
@@ -105,9 +105,9 @@
//positive case
assertTrue(FakeQueryService.cancelledQueries.isEmpty());
- admin.cancelSourceRequest(REQUEST_1_1_1);
+ admin.cancelSourceRequest(REQUEST_1_1_1_0);
- assertTrue(FakeQueryService.cancelledQueries.contains(REQUEST_1_1_1));
+ assertTrue(FakeQueryService.cancelledQueries.contains(REQUEST_1_1_1_0));
14 years, 10 months
teiid SVN: r906 - in trunk/engine/src: main/java/com/metamatrix/query/sql/symbol and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 15:40:52 -0400 (Mon, 11 May 2009)
New Revision: 906
Modified:
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/FrameUtil.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleMergeVirtual.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestFrameUtil.java
Log:
TEIID-568 join groups were not appropriately reestablished after a merge. also converted optional joins to use the common frame logic.
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/FrameUtil.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/FrameUtil.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/FrameUtil.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -69,17 +69,17 @@
public class FrameUtil {
- static void convertFrame(PlanNode startNode, GroupSymbol oldGroup, GroupSymbol newGroup, Map symbolMap, QueryMetadataInterface metadata)
+ static void convertFrame(PlanNode startNode, GroupSymbol oldGroup, Set<GroupSymbol> newGroups, Map symbolMap, QueryMetadataInterface metadata)
throws QueryPlannerException {
PlanNode current = startNode;
- PlanNode endNode = NodeEditor.findParent(startNode.getParent(), NodeConstants.Types.SOURCE);
+ PlanNode endNode = NodeEditor.findParent(startNode.getType()==NodeConstants.Types.SOURCE?startNode.getParent():startNode, NodeConstants.Types.SOURCE);
while(current != endNode) {
- // Make translations as defined in vnode in each current node
- convertNode(current, oldGroup, newGroup, symbolMap);
+ // Make translations as defined in node in each current node
+ convertNode(current, oldGroup, newGroups, symbolMap);
PlanNode parent = current.getParent();
@@ -160,7 +160,7 @@
// symbols. In that case, some additional work can be done because we can assume
// that an oldElement isn't being replaced by an expression using elements from
// multiple new groups.
- static void convertNode(PlanNode node, GroupSymbol oldGroup, GroupSymbol newGroup, Map symbolMap)
+ static void convertNode(PlanNode node, GroupSymbol oldGroup, Set<GroupSymbol> newGroups, Map symbolMap)
throws QueryPlannerException {
// Update groups for current node
@@ -182,12 +182,18 @@
}
}
- if(newGroup != null) {
+ boolean singleMapping = newGroups != null && newGroups.size() == 1;
+
+ if(singleMapping) {
if (!hasOld) {
return;
}
- groups.add(newGroup);
- } else if (type != NodeConstants.Types.SOURCE && type != NodeConstants.Types.ACCESS) {
+ groups.addAll(newGroups);
+ } else if ((type & (NodeConstants.Types.ACCESS | NodeConstants.Types.JOIN | NodeConstants.Types.SOURCE)) == type) {
+ if (newGroups != null) {
+ groups.addAll(newGroups);
+ }
+ } else {
groups.clear();
}
@@ -200,7 +206,7 @@
crit = convertCriteria(crit, symbolMap);
node.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit);
- if (newGroup == null) {
+ if (!singleMapping) {
GroupsUsedByElementsVisitor.getGroups(crit, groups);
}
@@ -209,7 +215,7 @@
Select select = new Select(projectedSymbols);
ExpressionMappingVisitor.mapExpressions(select, symbolMap);
node.setProperty(NodeConstants.Info.PROJECT_COLS, select.getSymbols());
- if (newGroup == null) {
+ if (!singleMapping) {
GroupsUsedByElementsVisitor.getGroups(select, groups);
}
} else if(type == NodeConstants.Types.JOIN) {
@@ -225,9 +231,6 @@
joinCrits.add(crit);
node.setProperty(NodeConstants.Info.JOIN_CRITERIA, joinCrits);
}
- if (newGroup == null) {
- GroupsUsedByElementsVisitor.getGroups(crit, groups);
- }
}
convertAccessPatterns(symbolMap, node);
@@ -237,7 +240,7 @@
OrderBy orderBy = new OrderBy(sortCols);
ExpressionMappingVisitor.mapExpressions(orderBy, symbolMap);
node.setProperty(NodeConstants.Info.SORT_ORDER, orderBy.getVariables());
- if (newGroup == null) {
+ if (!singleMapping) {
GroupsUsedByElementsVisitor.getGroups(orderBy, groups);
}
} else if(type == NodeConstants.Types.GROUP) {
@@ -246,7 +249,7 @@
GroupBy groupBy= new GroupBy(groupCols);
ExpressionMappingVisitor.mapExpressions(groupBy, symbolMap);
node.setProperty(NodeConstants.Info.GROUP_COLS, groupBy.getSymbols());
- if (newGroup == null) {
+ if (!singleMapping) {
GroupsUsedByElementsVisitor.getGroups(groupCols, groups);
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleMergeVirtual.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleMergeVirtual.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleMergeVirtual.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -130,10 +130,10 @@
// Convert parent frame before merge
SymbolMap symbolMap = (SymbolMap)frame.getProperty(NodeConstants.Info.SYMBOL_MAP);
- FrameUtil.convertFrame(frame, virtualGroup, null, symbolMap.asMap(), metadata);
+ FrameUtil.convertFrame(frame, virtualGroup, FrameUtil.findJoinSourceNode(projectNode).getGroups(), symbolMap.asMap(), metadata);
PlanNode parentBottom = frame.getParent();
- prepareFrame(frame, parentJoin);
+ prepareFrame(frame);
// Remove top 2 nodes (SOURCE, PROJECT) of virtual group - they're no longer needed
NodeEditor.removeChildNode(parentBottom, frame);
@@ -142,8 +142,7 @@
return root;
}
- private static void prepareFrame(PlanNode frame,
- PlanNode parentJoin) {
+ private static void prepareFrame(PlanNode frame) {
// find the new root of the frame so that access patterns can be propagated
PlanNode newRoot = FrameUtil.findJoinSourceNode(frame.getFirstChild());
if (newRoot != null) {
@@ -157,18 +156,6 @@
}
}
RulePlaceAccess.copyDependentHints(frame, newRoot);
-
- // correct the upper join with the groups introduced in the lower join
- if (parentJoin != null) {
- PlanNode upperJoin = newRoot.getParent();
- while (upperJoin != parentJoin) {
- if (upperJoin.getType() == NodeConstants.Types.JOIN) {
- upperJoin.addGroups(newRoot.getGroups());
- }
- upperJoin = upperJoin.getParent();
- }
- upperJoin.addGroups(newRoot.getGroups());
- }
}
}
@@ -257,7 +244,7 @@
sort.addGroups(GroupsUsedByElementsVisitor.getGroups(newElements));
}
- prepareFrame(frame, null);
+ prepareFrame(frame);
//remove the parent project and the source node
NodeEditor.removeChildNode(parentProject, frame);
@@ -300,7 +287,7 @@
checkForNullDependent = true;
break;
}
- joinToTest = NodeEditor.findParent(joinToTest.getParent(), NodeConstants.Types.JOIN);
+ joinToTest = NodeEditor.findParent(joinToTest.getParent(), NodeConstants.Types.JOIN, NodeConstants.Types.SOURCE);
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlaceAccess.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -22,7 +22,9 @@
package com.metamatrix.query.optimizer.relational.rules;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -199,7 +201,7 @@
//the expressions in the map will all be element symbols
Map<ElementSymbol, Expression> replacementSymbols = FrameUtil.buildSymbolMap(group, newGroup, metadata);
- FrameUtil.convertFrame(sourceNode, group, newGroup, replacementSymbols, metadata);
+ FrameUtil.convertFrame(sourceNode, group, new HashSet<GroupSymbol>(Arrays.asList(newGroup)), replacementSymbols, metadata);
// correct the lower symbol map
if (childProjects != null) {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRemoveOptionalJoins.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -22,11 +22,11 @@
package com.metamatrix.query.optimizer.relational.rules;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -48,12 +48,12 @@
import com.metamatrix.query.sql.lang.Criteria;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.symbol.AggregateSymbol;
+import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
import com.metamatrix.query.sql.util.SymbolMap;
import com.metamatrix.query.sql.visitor.ElementCollectorVisitor;
-import com.metamatrix.query.sql.visitor.GroupsUsedByElementsVisitor;
import com.metamatrix.query.util.CommandContext;
/**
@@ -201,9 +201,10 @@
/**
* remove the optional node if possible
+ * @throws QueryPlannerException
*/
private boolean removedJoin(PlanNode joinNode, PlanNode optionalNode,
- Set elements, QueryMetadataInterface metadata) throws QueryMetadataException, MetaMatrixComponentException {
+ Set elements, QueryMetadataInterface metadata) throws QueryMetadataException, MetaMatrixComponentException, QueryPlannerException {
Set groups = optionalNode.getGroups();
Assertion.isNotNull(elements);
@@ -227,13 +228,15 @@
NodeEditor.removeChildNode(parentNode, joinNode);
// correct the parent nodes that may be using optional elements
- HashSet optionElements = new HashSet();
- for (Iterator i = optionalNode.getGroups().iterator(); i.hasNext();) {
- optionElements.addAll(ResolverUtil.resolveElementsInGroup((GroupSymbol) i.next(), metadata));
+ for (GroupSymbol optionalGroup : optionalNode.getGroups()) {
+ List<ElementSymbol> optionalElements = ResolverUtil.resolveElementsInGroup(optionalGroup, metadata);
+ List<Constant> replacements = new ArrayList<Constant>(optionalElements.size());
+ for (ElementSymbol elementSymbol : optionalElements) {
+ replacements.add(new Constant(null, elementSymbol.getType()));
+ }
+ FrameUtil.convertFrame(parentNode, optionalGroup, null, SymbolMap.createSymbolMap(optionalElements, replacements).asMap(), metadata);
}
- correctParents(optionalNode.getGroups(), parentNode, optionElements);
-
return true;
}
@@ -269,88 +272,6 @@
return false;
}
- private void correctParents(Set groups,
- PlanNode parentNode,
- HashSet optionElements) {
- boolean done = false;
- boolean correctJoinGroups = true; //true until the first source node is reached
-
- while (!done && parentNode != null) {
-
- switch (parentNode.getType()) {
-
- case NodeConstants.Types.SET_OP:
- {
- done = true;
- break;
- }
- case NodeConstants.Types.SOURCE:
- {
- HashSet parentOptionalElements = new HashSet();
- SymbolMap symbolMap = (SymbolMap)parentNode.getProperty(NodeConstants.Info.SYMBOL_MAP);
- for (Map.Entry<ElementSymbol, Expression> entry : symbolMap.asMap().entrySet()) {
- Expression parentExpression = entry.getValue();
- Collection parentElements = ElementCollectorVisitor.getElements(parentExpression, true);
- parentElements.retainAll(optionElements);
- if (!parentElements.isEmpty()) {
- parentOptionalElements.add(entry.getKey());
- }
- }
- correctJoinGroups = false;
- optionElements = parentOptionalElements;
- if (optionElements.isEmpty()) {
- done = true;
- }
- break;
- }
- case NodeConstants.Types.JOIN:
- {
- List joinCriteria = (List)parentNode.getProperty(NodeConstants.Info.JOIN_CRITERIA);
- removeOptionalEntries(optionElements, joinCriteria, null);
- if (correctJoinGroups) {
- parentNode.getGroups().removeAll(groups);
- }
- break;
- }
- case NodeConstants.Types.PROJECT:
- {
- if (parentNode.getParent() == null || parentNode.getProperty(NodeConstants.Info.INTO_GROUP) != null) {
- done = true;
- }
- break;
- }
- }
-
- parentNode = parentNode.getParent();
- }
- }
-
- /**
- * Will remove the optional entries from the list of languageObjects. This will
- * also correct the groups on the parentNode if it is non-null.
- *
- * @param optionElements
- * @param languageObjects
- */
- private void removeOptionalEntries(HashSet optionElements,
- List languageObjects, PlanNode parentNode) {
- if (languageObjects != null && !languageObjects.isEmpty()) {
- if (parentNode != null) {
- parentNode.getGroups().clear();
- }
- for (Iterator i = languageObjects.iterator(); i.hasNext();) {
- LanguageObject object = (LanguageObject)i.next();
- if (isOptional(optionElements, object)) {
- i.remove();
- continue;
- }
- if (parentNode != null) {
- parentNode.addGroups(GroupsUsedByElementsVisitor.getGroups(object));
- }
- }
- }
- }
-
private boolean isOptional(HashSet optionElements,
LanguageObject languageObject) {
Collection elementsUsed = ElementCollectorVisitor.getElements(languageObject, true);
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -148,7 +148,8 @@
if(other.isNull() || this.isNull()) {
return false;
}
- return other.getValue().equals(this.getValue());
+
+ return multiValued == other.multiValued && other.getValue().equals(this.getValue());
}
/**
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestFrameUtil.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestFrameUtil.java 2009-05-11 14:50:00 UTC (rev 905)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestFrameUtil.java 2009-05-11 19:40:52 UTC (rev 906)
@@ -22,24 +22,33 @@
package com.metamatrix.query.optimizer.relational.rules;
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
+import org.junit.Test;
+
import com.metamatrix.query.optimizer.relational.plantree.NodeConstants;
+import com.metamatrix.query.optimizer.relational.plantree.NodeEditor;
import com.metamatrix.query.optimizer.relational.plantree.NodeFactory;
import com.metamatrix.query.optimizer.relational.plantree.PlanNode;
+import com.metamatrix.query.optimizer.relational.plantree.NodeConstants.Info;
+import com.metamatrix.query.sql.lang.IsNullCriteria;
import com.metamatrix.query.sql.lang.JoinType;
+import com.metamatrix.query.sql.symbol.Constant;
+import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.sql.util.SymbolMap;
-import junit.framework.TestCase;
-
-public class TestFrameUtil extends TestCase {
+public class TestFrameUtil {
static GroupSymbol getGroup(int id) {
return new GroupSymbol(String.valueOf(id));
}
- public void testFindJoinSourceNode() {
+ @Test public void testFindJoinSourceNode() {
PlanNode root = getExamplePlan();
PlanNode joinSource = FrameUtil.findJoinSourceNode(root);
@@ -47,7 +56,7 @@
assertSame(root, joinSource);
}
- public void testFindJoinSourceNode1() {
+ @Test public void testFindJoinSourceNode1() {
PlanNode root = getExamplePlan();
PlanNode joinSource = FrameUtil.findJoinSourceNode(root.getLastChild());
@@ -55,10 +64,10 @@
assertEquals(NodeConstants.Types.JOIN, joinSource.getType());
}
- public void testFindSourceNode() {
+ @Test public void testFindSourceNode() {
PlanNode root = getExamplePlan();
- Set groups = new HashSet();
+ Set<GroupSymbol> groups = new HashSet<GroupSymbol>();
groups.add(getGroup(1));
@@ -70,10 +79,10 @@
/**
* Access nodes are not eligible originating nodes
*/
- public void testFindSourceNodeWithAccessSource() {
+ @Test public void testFindSourceNodeWithAccessSource() {
PlanNode root = getExamplePlan();
- Set groups = new HashSet();
+ Set<GroupSymbol> groups = new HashSet<GroupSymbol>();
groups.add(getGroup(2));
@@ -82,10 +91,10 @@
assertEquals(NodeConstants.Types.JOIN, originatingNode.getType());
}
- public void testFindSourceNode2() {
+ @Test public void testFindSourceNode2() {
PlanNode root = getExamplePlan();
- Set groups = new HashSet();
+ Set<GroupSymbol> groups = new HashSet<GroupSymbol>();
groups.add(getGroup(3));
@@ -94,10 +103,10 @@
assertEquals(NodeConstants.Types.SOURCE, originatingNode.getType());
}
- public void testNonExistentSource() {
+ @Test public void testNonExistentSource() {
PlanNode root = getExamplePlan();
- Set groups = new HashSet();
+ Set<GroupSymbol> groups = new HashSet<GroupSymbol>();
groups.add(getGroup(4));
@@ -105,6 +114,66 @@
assertNull(originatingNode);
}
+
+ @Test public void testJoinGroups() throws Exception {
+ PlanNode joinNode = getExamplePlan();
+ PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+ ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
+ e1.setGroupSymbol(getGroup(3));
+ projectNode.setProperty(Info.PROJECT_COLS, Arrays.asList(e1));
+ projectNode.addFirstChild(joinNode);
+ projectNode.addGroup(getGroup(3));
+ PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ sourceNode.addFirstChild(projectNode);
+ GroupSymbol four = getGroup(4);
+ sourceNode.addGroup(four);
+ ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
+ e2.setGroupSymbol(four);
+ SymbolMap sm = SymbolMap.createSymbolMap(Arrays.asList(e2), Arrays.asList(e1));
+ sourceNode.setProperty(Info.SYMBOL_MAP, sm);
+ PlanNode projectNode1 = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+ projectNode1.addFirstChild(sourceNode);
+ projectNode1.addGroup(four);
+ projectNode1.setProperty(Info.PROJECT_COLS, Arrays.asList(e2));
+
+ //removing source node 3 completely
+ SymbolMap replacement = SymbolMap.createSymbolMap(Arrays.asList(e1), Arrays.asList(new Constant(null)));
+ FrameUtil.convertFrame(NodeEditor.findNodePreOrder(joinNode, NodeConstants.Types.SOURCE), getGroup(3), null, replacement.asMap(), null);
+ assertEquals(2, joinNode.getGroups().size()); //even though this is a cross join it should still retain its groups
+ assertEquals(0, NodeEditor.findNodePreOrder(joinNode, NodeConstants.Types.SELECT).getGroups().size());
+ assertEquals(1, projectNode1.getGroups().size());
+ assertEquals(0, projectNode.getGroups().size());
+ }
+
+ @Test public void testJoinGroups1() throws Exception {
+ PlanNode joinNode = getExamplePlan();
+ PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+ ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
+ e1.setGroupSymbol(getGroup(3));
+ projectNode.setProperty(Info.PROJECT_COLS, Arrays.asList(e1));
+ projectNode.addFirstChild(joinNode);
+ projectNode.addGroup(getGroup(3));
+ PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
+ sourceNode.addFirstChild(projectNode);
+ GroupSymbol four = getGroup(4);
+ sourceNode.addGroup(four);
+ ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
+ e2.setGroupSymbol(four);
+ SymbolMap sm = SymbolMap.createSymbolMap(Arrays.asList(e2), Arrays.asList(e1));
+ sourceNode.setProperty(Info.SYMBOL_MAP, sm);
+ PlanNode projectNode1 = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
+ projectNode1.addFirstChild(sourceNode);
+ projectNode1.addGroup(four);
+ projectNode1.setProperty(Info.PROJECT_COLS, Arrays.asList(e2));
+
+ //replace source 3 with groups 5, 6
+ SymbolMap replacement = SymbolMap.createSymbolMap(Arrays.asList(e1), Arrays.asList(new Constant(null)));
+ FrameUtil.convertFrame(NodeEditor.findNodePreOrder(joinNode, NodeConstants.Types.SOURCE), getGroup(3), new HashSet<GroupSymbol>(Arrays.asList(getGroup(5), getGroup(6))), replacement.asMap(), null);
+ assertEquals(4, joinNode.getGroups().size()); //even though this is a cross join it should still retain its groups
+ assertEquals(0, NodeEditor.findNodePreOrder(joinNode, NodeConstants.Types.SELECT).getGroups().size());
+ assertEquals(1, projectNode1.getGroups().size());
+ assertEquals(0, projectNode.getGroups().size());
+ }
/**
* <pre>
@@ -129,7 +198,7 @@
joinNode.addFirstChild(nullNode);
PlanNode childCriteria = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
-
+ childCriteria.setProperty(Info.SELECT_CRITERIA, new IsNullCriteria(new Constant(1)));
childCriteria.addGroup(getGroup(2));
joinNode.addLastChild(childCriteria);
14 years, 10 months
teiid SVN: r905 - in trunk: test-integration/src/test/java/org/teiid/connector/visitor/util and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 10:50:00 -0400 (Mon, 11 May 2009)
New Revision: 905
Modified:
trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java
trunk/test-integration/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
Log:
TEIID-124 support for insert with query at the connector level
Modified: trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java
===================================================================
--- trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java 2009-05-11 14:34:39 UTC (rev 904)
+++ trunk/connector-sdk/src/test/java/com/metamatrix/cdk/unittest/FakeTranslationFactory.java 2009-05-11 14:50:00 UTC (rev 905)
@@ -50,4 +50,8 @@
return new TranslationUtility(TestValidator.exampleMetadata3());
}
+ public TranslationUtility getExampleTranslationUtility() {
+ return new TranslationUtility(FakeMetadataFactory.example1Cached());
+ }
+
}
Modified: trunk/test-integration/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java
===================================================================
--- trunk/test-integration/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2009-05-11 14:34:39 UTC (rev 904)
+++ trunk/test-integration/src/test/java/org/teiid/connector/visitor/util/TestSQLStringVisitor.java 2009-05-11 14:50:00 UTC (rev 905)
@@ -22,21 +22,24 @@
package org.teiid.connector.visitor.util;
+import static org.junit.Assert.*;
+
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
+import org.junit.Test;
import org.teiid.connector.language.ICommand;
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IFunction;
import org.teiid.connector.language.IGroup;
+import org.teiid.connector.language.IInsert;
import org.teiid.connector.language.ILanguageObject;
+import org.teiid.connector.language.IQuery;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
-import org.teiid.connector.visitor.util.SQLReservedWords;
-import org.teiid.connector.visitor.util.SQLStringVisitor;
import org.teiid.dqp.internal.datamgr.language.AggregateImpl;
import org.teiid.dqp.internal.datamgr.language.ElementImpl;
import org.teiid.dqp.internal.datamgr.language.FunctionImpl;
@@ -72,8 +75,6 @@
import org.teiid.dqp.internal.datamgr.language.TstLanguageBridgeFactory;
import org.teiid.dqp.internal.datamgr.metadata.RuntimeMetadataImpl;
-import junit.framework.TestCase;
-
import com.metamatrix.cdk.unittest.FakeTranslationFactory;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.query.metadata.QueryMetadataInterface;
@@ -85,19 +86,10 @@
import com.metamatrix.query.unittest.FakeMetadataObject;
import com.metamatrix.query.unittest.FakeMetadataStore;
-public class TestSQLStringVisitor extends TestCase {
+public class TestSQLStringVisitor {
public static final RuntimeMetadata metadata = TstLanguageBridgeFactory.metadataFactory;
-
- /**
- * Constructor for TestSQLStringVisitor.
- * @param name
- */
- public TestSQLStringVisitor(String name) {
- super(name);
- }
-
private String getString(ILanguageObject obj) {
return SQLStringVisitor.getSQLString(obj);
}
@@ -130,12 +122,12 @@
/*
* Test for void visit(IAggregate)
*/
- public void testVisitIAggregate() throws Exception {
+ @Test public void testVisitIAggregate() throws Exception {
String expected = "COUNT(42)"; //$NON-NLS-1$
assertEquals(expected, getString(TestAggregateImpl.example("COUNT", ReservedWords.COUNT, false, 42))); //$NON-NLS-1$
}
- public void testVisitIAggregateDistinct() throws Exception {
+ @Test public void testVisitIAggregateDistinct() throws Exception {
String expected = "COUNT(DISTINCT *)"; //$NON-NLS-1$
AggregateImpl impl = new AggregateImpl("COUNT", true, null, Integer.class); //$NON-NLS-1$
assertEquals(expected, getString(impl));
@@ -144,7 +136,7 @@
/*
* Test for void visit(ICompareCriteria)
*/
- public void testVisitICompareCriteria() throws Exception {
+ @Test public void testVisitICompareCriteria() throws Exception {
String expected = "200 = 100"; //$NON-NLS-1$
assertEquals(expected, getString(TestCompareCriteriaImpl.example(CompareCriteria.EQ, 200, 100)));
}
@@ -152,7 +144,7 @@
/*
* Test for void visit(ICompoundCriteria)
*/
- public void testVisitICompoundCriteria() throws Exception {
+ @Test public void testVisitICompoundCriteria() throws Exception {
String expected = "200 = 100"; //$NON-NLS-1$
assertEquals(expected, getString(TestCompareCriteriaImpl.example(CompareCriteria.EQ, 200, 100)));
expected = "200 >= 100"; //$NON-NLS-1$
@@ -170,7 +162,7 @@
/*
* Test for void visit(IDelete)
*/
- public void testVisitIDelete() throws Exception {
+ @Test public void testVisitIDelete() throws Exception {
String expected = "DELETE FROM g1 WHERE (100 >= 200) AND (500 < 600)"; //$NON-NLS-1$
assertEquals(expected, getString(TestDeleteImpl.example()));
}
@@ -178,7 +170,7 @@
/*
* Test for void visit(IElement)
*/
- public void testVisitIElement() throws Exception {
+ @Test public void testVisitIElement() throws Exception {
String expected = "g1.e1"; //$NON-NLS-1$
assertEquals(expected, getString(TestElementImpl.example("vm1.g1", "e1"))); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -186,7 +178,7 @@
/*
* Test for void visit(IExecute)
*/
-// public void testVisitIExecute() throws Exception {
+// @Test public void testVisitIExecute() throws Exception {
// String expected = "EXEC pm1.sq3('x', 1)"; //$NON-NLS-1$
// assertEquals(expected, getString(TestProcedureImpl.example()));
// }
@@ -194,7 +186,7 @@
/*
* Test for void visit(IExistsCriteria)
*/
- public void testVisitIExistsCriteria() throws Exception {
+ @Test public void testVisitIExistsCriteria() throws Exception {
String expected = "EXISTS (SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC)"; //$NON-NLS-1$
assertEquals(expected, getString(TestExistsCriteriaImpl.example()));
}
@@ -202,7 +194,7 @@
/*
* Test for void visit(IFrom)
*/
- public void testVisitIFrom() throws Exception {
+ @Test public void testVisitIFrom() throws Exception {
String expected = "FROM g1, g2 AS myAlias, g3, g4"; //$NON-NLS-1$
assertEquals(expected, getString(TestFromImpl.example()));
}
@@ -210,13 +202,13 @@
/*
* Test for void visit(IFunction)
*/
- public void testVisitIFunction() throws Exception {
+ @Test public void testVisitIFunction() throws Exception {
// TODO more thorough testing needed for built-in operators
String expected = "testName(100, 200)"; //$NON-NLS-1$
assertEquals(expected, getString(TestFunctionImpl.example("testName"))); //$NON-NLS-1$
}
- public void testVisitConvertFunctionOracleStyleWithNIS() throws Exception {
+ @Test public void testVisitConvertFunctionOracleStyleWithNIS() throws Exception {
FakeMetadataFacade facade = new FakeMetadataFacade(exampleMetadataStore());
RuntimeMetadataImpl metadata = exampleRuntimeMetadata(facade);
@@ -231,7 +223,7 @@
assertEquals(expected, getString(test, metadata ));
}
- public void testVisitConvertFunctionOracleStyle() throws Exception {
+ @Test public void testVisitConvertFunctionOracleStyle() throws Exception {
String expected = "convert(columnA, integer)"; //$NON-NLS-1$
List<? extends IExpression> params = Arrays.asList(new ElementImpl(null, "columnA", null, String.class), new LiteralImpl("integer", String.class));
@@ -243,7 +235,7 @@
/*
* Test for void visit(IGroup)
*/
- public void testVisitIGroup() throws Exception {
+ @Test public void testVisitIGroup() throws Exception {
String expected = "g1 AS alias"; //$NON-NLS-1$
assertEquals(expected, getString(TestGroupImpl.example("alias", "vm1.g1"))); //$NON-NLS-1$ //$NON-NLS-2$
expected = "g1"; //$NON-NLS-1$
@@ -253,7 +245,7 @@
/*
* Test for void visit(IGroupBy)
*/
- public void testVisitIGroupBy() throws Exception {
+ @Test public void testVisitIGroupBy() throws Exception {
String expected = "GROUP BY g1.e1, g1.e2, g1.e3, g1.e4"; //$NON-NLS-1$
assertEquals(expected, getString(TestGroupByImpl.example()));
}
@@ -261,7 +253,7 @@
/*
* Test for void visit(IInCriteria)
*/
- public void testVisitIInCriteria() throws Exception {
+ @Test public void testVisitIInCriteria() throws Exception {
String expected = "300 IN (100, 200, 300, 400)"; //$NON-NLS-1$
assertEquals(expected, getString(TestInCriteriaImpl.example(false)));
expected = "300 NOT IN (100, 200, 300, 400)"; //$NON-NLS-1$
@@ -271,7 +263,7 @@
/*
* Test for void visit(IInsert)
*/
- public void testVisitIInsert() throws Exception {
+ @Test public void testVisitIInsert() throws Exception {
String expected = "INSERT INTO g1 (e1, e2, e3, e4) VALUES (1, 2, 3, 4)"; //$NON-NLS-1$
assertEquals(expected, getString(TestInsertImpl.example("g1"))); //$NON-NLS-1$
}
@@ -279,7 +271,7 @@
/*
* Test for void visit(IIsNullCriteria)
*/
- public void testVisitIIsNullCriteria() throws Exception {
+ @Test public void testVisitIIsNullCriteria() throws Exception {
String expected = "g1.e1 IS NULL"; //$NON-NLS-1$
assertEquals(expected, getString(TestIsNullCriteriaImpl.example(false)));
expected = "g1.e1 IS NOT NULL"; //$NON-NLS-1$
@@ -289,7 +281,7 @@
/*
* Test for void visit(IJoin)
*/
- public void testVisitIJoin() throws Exception {
+ @Test public void testVisitIJoin() throws Exception {
String expected = "g1 CROSS JOIN g2 ON g1.e1 = g2.e1"; //$NON-NLS-1$
assertEquals(expected, getString(TestJoinImpl.example(JoinType.JOIN_CROSS)));
expected = "g1 FULL OUTER JOIN g2 ON g1.e1 = g2.e1"; //$NON-NLS-1$
@@ -305,7 +297,7 @@
/*
* Test for void visit(ILikeCriteria)
*/
- public void testVisitILikeCriteria() throws Exception {
+ @Test public void testVisitILikeCriteria() throws Exception {
String expected = "g1.e1 LIKE 'likeString' ESCAPE '\\'"; //$NON-NLS-1$
assertEquals(expected, getString(TestLikeCriteriaImpl.example("likeString", '\\', false))); //$NON-NLS-1$
expected = "g1.e1 NOT LIKE 'likeString' ESCAPE '\\'"; //$NON-NLS-1$
@@ -315,7 +307,7 @@
/*
* Test for void visit(ILiteral)
*/
- public void testVisitILiteral() throws Exception {
+ @Test public void testVisitILiteral() throws Exception {
String expected = "'string''Literal'"; //$NON-NLS-1$
assertEquals(expected, getString(TestLiteralImpl.example("string'Literal"))); //$NON-NLS-1$
expected = "1000"; //$NON-NLS-1$
@@ -337,7 +329,7 @@
/*
* Test for void visit(INotCriteria)
*/
- public void testVisitINotCriteria() throws Exception {
+ @Test public void testVisitINotCriteria() throws Exception {
String expected = "NOT (100 >= 200)"; //$NON-NLS-1$
assertEquals(expected, getString(TestNotCriteriaImpl.example()));
}
@@ -345,7 +337,7 @@
/*
* Test for void visit(IOrderBy)
*/
- public void testVisitIOrderBy() throws Exception {
+ @Test public void testVisitIOrderBy() throws Exception {
String expected = "ORDER BY e1, e2 DESC, e3, e4 DESC"; //$NON-NLS-1$
assertEquals(expected, getString(TestOrderByImpl.example()));
}
@@ -353,7 +345,7 @@
/*
* Test for void visit(IParameter)
*/
-// public void testVisitIParameter() throws Exception {
+// @Test public void testVisitIParameter() throws Exception {
// String expected = "x"; //$NON-NLS-1$
// assertEquals(expected, getString(TestParameterImpl.example(1)));
// }
@@ -361,7 +353,7 @@
/*
* Test for void visit(IQuery)
*/
- public void testVisitIQuery() throws Exception {
+ @Test public void testVisitIQuery() throws Exception {
String expected = "SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC"; //$NON-NLS-1$
assertEquals(expected, getString(TestQueryImpl.example()));
}
@@ -369,7 +361,7 @@
/*
* Test for void visit(IScalarSubquery)
*/
- public void testVisitIScalarSubquery() throws Exception {
+ @Test public void testVisitIScalarSubquery() throws Exception {
String expected = "(SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC)"; //$NON-NLS-1$
assertEquals(expected, getString(TestScalarSubqueryImpl.example()));
}
@@ -377,7 +369,7 @@
/*
* Test for void visit(ISearchedCaseExpression)
*/
- public void testVisitISearchedCaseExpression() throws Exception {
+ @Test public void testVisitISearchedCaseExpression() throws Exception {
String expected = "CASE WHEN g1.e1 = 0 THEN 0 WHEN g1.e1 = 1 THEN 1 WHEN g1.e1 = 2 THEN 2 ELSE 9999 END"; //$NON-NLS-1$
assertEquals(expected, getString(TestSearchedCaseExpressionImpl.example()));
}
@@ -385,7 +377,7 @@
/*
* Test for void visit(ISelect)
*/
- public void testVisitISelect() throws Exception {
+ @Test public void testVisitISelect() throws Exception {
String expected = "SELECT g1.e1, g1.e2, g1.e3, g1.e4"; //$NON-NLS-1$
assertEquals(expected, getString(TestSelectImpl.example(false)));
expected = "SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4"; //$NON-NLS-1$
@@ -396,7 +388,7 @@
/*
* Test for void visit(ISelectSymbol)
*/
- public void testVisitISelectSymbol() throws Exception {
+ @Test public void testVisitISelectSymbol() throws Exception {
String expected = "g1.e1"; //$NON-NLS-1$
assertEquals(expected, getString(TestSelectSymbolImpl.example("e1", null))); //$NON-NLS-1$
expected = "g1.e1 AS alias"; //$NON-NLS-1$
@@ -406,7 +398,7 @@
/*
* Test for void visit(ISubqueryCompareCriteria)
*/
- public void testVisitISubqueryCompareCriteria() throws Exception {
+ @Test public void testVisitISubqueryCompareCriteria() throws Exception {
String expected = "g1.e1 > SOME (SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC)"; //$NON-NLS-1$
assertEquals(expected, getString(TestSubqueryCompareCriteriaImpl.example()));
}
@@ -414,23 +406,23 @@
/*
* Test for void visit(ISubqueryInCriteria)
*/
- public void testVisitISubqueryInCriteria() throws Exception {
+ @Test public void testVisitISubqueryInCriteria() throws Exception {
String expected = "g1.e1 NOT IN (SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC)"; //$NON-NLS-1$
assertEquals(expected, getString(TestSubqueryInCriteriaImpl.example()));
}
- public void testVisitIUnion1() throws Exception {
+ @Test public void testVisitIUnion1() throws Exception {
String expected = "SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC UNION SELECT DISTINCT g1.e1, g1.e2, g1.e3, g1.e4 FROM g1, g2 AS myAlias, g3, g4 WHERE (100 >= 200) AND (500 < 600) GROUP BY g1.e1, g1.e2, g1.e3, g1.e4 HAVING (100 >= 200) AND (500 < 600) ORDER BY e1, e2 DESC, e3, e4 DESC ORDER BY e1, e2 DESC, e3, e4 DESC";//$NON-NLS-1$
assertEquals(expected, getString(TestSetQueryImpl.example()));
}
- public void testVisitIUnion2() throws Exception {
+ @Test public void testVisitIUnion2() throws Exception {
String expected = "SELECT ted.nugent FROM ted UNION ALL SELECT dave.barry FROM dave";//$NON-NLS-1$
String actual = getString(TestSetQueryImpl.example2());
assertEquals(expected, actual);
}
- public void testVisitIUnion3() throws Exception {
+ @Test public void testVisitIUnion3() throws Exception {
String expected = "SELECT ted.nugent FROM ted UNION ALL SELECT dave.barry FROM dave ORDER BY nugent";//$NON-NLS-1$
String actual = getString(TestSetQueryImpl.example3());
assertEquals(expected, actual);
@@ -439,21 +431,30 @@
/*
* Test for void visit(IUpdate)
*/
- public void testVisitIUpdate() throws Exception {
+ @Test public void testVisitIUpdate() throws Exception {
String expected = "UPDATE g1 SET e1 = 1, e2 = 1, e3 = 1, e4 = 1 WHERE 1 = 1"; //$NON-NLS-1$
assertEquals(expected, getString(TestUpdateImpl.example()));
}
-
- public void testVisitProcedure() throws Exception {
+ @Test public void testVisitProcedure() throws Exception {
String expected = "EXEC sq3(, x, 1)"; //$NON-NLS-1$
assertEquals(expected, getString(TestProcedureImpl.example()));
}
- public void testTimestampAddFunction() throws Exception {
- String sql = "select timestampadd(" +SQLReservedWords.SQL_TSI_DAY+ ", 2, timestampvalue) from bqt1.smalla"; //$NON-NLS-1$
+ @Test public void testTimestampAddFunction() throws Exception {
+ String sql = "select timestampadd(" +SQLReservedWords.SQL_TSI_DAY+ ", 2, timestampvalue) from bqt1.smalla"; //$NON-NLS-1$ //$NON-NLS-2$
ICommand command = FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(sql);
assertEquals("SELECT timestampadd(SQL_TSI_DAY, 2, SmallA.TimestampValue) FROM SmallA", command.toString()); //$NON-NLS-1$
}
+
+ @Test public void testInsertWithQuery() throws Exception {
+ String sql = "insert into pm1.g1 values (null, null, null, null)"; //$NON-NLS-1$
+
+ IInsert insert = (IInsert)FakeTranslationFactory.getInstance().getExampleTranslationUtility().parseCommand(sql);
+
+ IQuery command = (IQuery)FakeTranslationFactory.getInstance().getExampleTranslationUtility().parseCommand("select * from pm1.g2"); //$NON-NLS-1$
+ insert.setValueSource(command);
+ assertEquals("INSERT INTO g1 (e1, e2, e3, e4) SELECT g2.e1, g2.e2, g2.e3, g2.e4 FROM g2", insert.toString()); //$NON-NLS-1$
+ }
}
14 years, 10 months
teiid SVN: r904 - trunk/client/src/main/java/org/jboss/netty/handler.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 10:34:39 -0400 (Mon, 11 May 2009)
New Revision: 904
Removed:
trunk/client/src/main/java/org/jboss/netty/handler/codec/
Log:
TEIID-525 TEIID-124 TEIID-572 removing redundant max in property overrides, adding pushdown of insert with a query expression, and adding full pushdown of all bulk update operations.
14 years, 10 months
teiid SVN: r903 - in trunk: connector-api/src/main/java/org/teiid/connector/basic and 36 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-11 10:34:31 -0400 (Mon, 11 May 2009)
New Revision: 903
Added:
trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertExpressionValueSource.java
trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertValueSource.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertValueExpressionsImpl.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestInsertProcessing.java
Removed:
trunk/connector-api/src/main/java/org/teiid/connector/language/IBulkInsert.java
trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCConnector.java
trunk/engine/src/main/java/com/metamatrix/query/sql/lang/BulkInsert.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/BulkInsertImpl.java
trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestBulkInsert.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestBulkInsertImpl.java
Modified:
trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicConnectorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/connector/language/IExpression.java
trunk/connector-api/src/main/java/org/teiid/connector/language/IInsert.java
trunk/connector-api/src/main/java/org/teiid/connector/language/ILanguageFactory.java
trunk/connector-api/src/main/java/org/teiid/connector/language/ILiteral.java
trunk/connector-api/src/main/java/org/teiid/connector/language/IQueryCommand.java
trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/AbstractLanguageVisitor.java
trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/HierarchyVisitor.java
trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/LanguageObjectVisitor.java
trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/CollectorVisitor.java
trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCPropertyNames.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCQueryExecution.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCUpdateExecution.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/SimpleCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/access/AccessCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/db2/DB2Capabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/SequeLinkOracleCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sybase/SybaseCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/teradata/TeradataCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/BindValueVisitor.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/ReplacementVisitor.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/SQLConversionVisitor.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/TranslatedCommand.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/Translator.java
trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnector.java
trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java
trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorPropertyNames.java
trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPUpdateExecution.java
trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Connector.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/SalesforceCapabilities.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java
trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml
trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCollapseSource.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/main/java/com/metamatrix/query/processor/relational/ProjectIntoNode.java
trunk/engine/src/main/java/com/metamatrix/query/sql/LanguageVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Insert.java
trunk/engine/src/main/java/com/metamatrix/query/sql/navigator/PreOrPostOrderNavigator.java
trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageFactoryImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LiteralImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/ProcedureImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseListImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectIntoNode.java
trunk/engine/src/test/java/com/metamatrix/query/sql/symbol/TestConstant.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestInsertImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCallableStatement.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java
Log:
TEIID-525 TEIID-124 TEIID-572 removing redundant max in property overrides, adding pushdown of insert with a query expression, and adding full pushdown of all bulk update operations.
Modified: trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorCapabilities.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -25,7 +25,7 @@
import java.util.List;
import org.teiid.connector.language.IBatchedUpdates;
-import org.teiid.connector.language.IBulkInsert;
+import org.teiid.connector.language.ISetQuery;
/**
@@ -372,9 +372,16 @@
boolean supportsBatchedUpdates();
/**
- * Whether the source supports {@link IBulkInsert}
+ * Whether the source supports updates with multiple value sets
* @since 6.0
*/
- boolean supportsBulkInsert();
+ boolean supportsBulkUpdate();
+
+ /**
+ * Support indicates that the connector can accept INSERTs with
+ * values specified by an {@link ISetQuery}.
+ * @since 6.1
+ */
+ boolean supportsInsertWithQueryExpression();
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicConnectorCapabilities.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicConnectorCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicConnectorCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -35,8 +35,6 @@
*/
public class BasicConnectorCapabilities implements ConnectorCapabilities {
- protected int maxInCriteriaSize = -1;
-
/**
* Construct the basic capabilities class.
*/
@@ -272,7 +270,7 @@
* @since 4.2
*/
public int getMaxInCriteriaSize() {
- return this.maxInCriteriaSize;
+ return -1;
}
/**
@@ -335,11 +333,6 @@
}
@Override
- public boolean supportsBulkInsert() {
- return false;
- }
-
- @Override
public boolean supportsGroupBy() {
return false;
}
@@ -368,5 +361,15 @@
public boolean supportsCompareCriteriaOrdered() {
return false;
}
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
+ @Override
+ public boolean supportsBulkUpdate() {
+ return false;
+ }
+
}
Deleted: trunk/connector-api/src/main/java/org/teiid/connector/language/IBulkInsert.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IBulkInsert.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IBulkInsert.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.language;
-
-import java.util.List;
-
-/**
- * This is a simple variation of insert, where multiple rows with single insert
- * will be loaded.
- */
-public interface IBulkInsert extends IInsert {
-
- /**
- * Get the list of row values for this bulk insert
- * @return list; never null
- */
- List<List<?>> getRows();
-
-}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/language/IExpression.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IExpression.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IExpression.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -30,21 +30,17 @@
public interface IExpression extends ILanguageObject {
/**
- * Determine the type returned by this expression. The connector should
- * return an object of this type if this expression is used in a SELECT
- * clause.
+ * Determine the type returned by this expression.
*
* @return The type, as defined by a Java class
*/
- Class getType();
+ Class<?> getType();
/**
- * Set the type returned by this expression. The connector should
- * return an object of this type if this expression is used in a SELECT
- * clause.
+ * Set the type returned by this expression.
*
* @param type The type, as defined by a Java class
*/
- void setType(Class type);
+ void setType(Class<?> type);
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/language/IInsert.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IInsert.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IInsert.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -42,12 +42,18 @@
List<IElement> getElements();
/**
- * Get list of values being inserted
- * @return List of ILiteral
+ * Get the IInsertValues
+ * @return
*/
- List<IExpression> getValues();
+ IInsertValueSource getValueSource();
/**
+ * Set the IInsertValues
+ * @param values
+ */
+ void setValueSource(IInsertValueSource values);
+
+ /**
* Set group that is being inserted into.
* @param group Insert group
*/
Added: trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertExpressionValueSource.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertExpressionValueSource.java (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertExpressionValueSource.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -0,0 +1,9 @@
+package org.teiid.connector.language;
+
+import java.util.List;
+
+public interface IInsertExpressionValueSource extends IInsertValueSource, ILanguageObject {
+
+ List<IExpression> getValues();
+
+}
Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertExpressionValueSource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertValueSource.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertValueSource.java (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertValueSource.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -0,0 +1,5 @@
+package org.teiid.connector.language;
+
+public interface IInsertValueSource extends ILanguageObject {
+
+}
Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/language/IInsertValueSource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connector-api/src/main/java/org/teiid/connector/language/ILanguageFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/ILanguageFactory.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/ILanguageFactory.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -106,7 +106,7 @@
* @param type Data type returned
* @return New IFunction
*/
- IFunction createFunction(String functionName, IExpression[] args, Class type);
+ IFunction createFunction(String functionName, IExpression[] args, Class<?> type);
/**
* Create new function
@@ -115,7 +115,7 @@
* @param type Data type returned
* @return New IFunction
*/
- IFunction createFunction(String functionName, List<? extends IExpression> args, Class type);
+ IFunction createFunction(String functionName, List<? extends IExpression> args, Class<?> type);
/**
* Create new group.
@@ -157,16 +157,14 @@
* @param values List of IExpression (usually ILiteral)
* @return New IInsert
*/
- IInsert createInsert(IGroup group, List<IElement> columns, List<? extends IExpression> values);
+ IInsert createInsert(IGroup group, List<IElement> columns, IInsertValueSource valueSource);
/**
- * Create new bulk insert command
- * @param group Insert group
- * @param columns List of IElement being inserted into
- * @param List of Lists containing the actual values
- * @return New IBulkInsert
+ * Create a new value source for an insert command
+ * @param values
+ * @return
*/
- IBulkInsert createBulkInsert(IGroup group, List<? extends IElement> columns, List<List<Object>> rows);
+ IInsertExpressionValueSource createInsertExpressionValueSource(List<IExpression> values);
/**
* Create new IS NULL criteria
Modified: trunk/connector-api/src/main/java/org/teiid/connector/language/ILiteral.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/ILiteral.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/ILiteral.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -38,7 +38,7 @@
* Get the Java type of the literal
* @return Java class name of type
*/
- Class getType();
+ Class<?> getType();
/**
* Set the value of the literal
@@ -50,13 +50,29 @@
* Set the Java type of the literal
* @param type Java class name of type
*/
- void setType(Class type);
+ void setType(Class<?> type);
/**
* Returns true if this literal should be treated as a bind value
*/
boolean isBindValue();
+ /**
+ * Set whether this literal should be treated as a bind value
+ * @param bindValue
+ */
void setBindValue(boolean bindValue);
+
+ /**
+ * Returns true if the value for this literal is a list of values.
+ * @return
+ */
+ boolean isMultiValued();
+
+ /**
+ * Set whether the value for this literal is a list of values.
+ * @param multiValued
+ */
+ void setMultiValued(boolean multiValued);
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/language/IQueryCommand.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/language/IQueryCommand.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/language/IQueryCommand.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,7 +22,7 @@
package org.teiid.connector.language;
-public interface IQueryCommand extends ICommand {
+public interface IQueryCommand extends ICommand, IInsertValueSource {
/**
* Set ORDER BY clause, may be null.
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/AbstractLanguageVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/AbstractLanguageVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/AbstractLanguageVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -26,7 +26,6 @@
import org.teiid.connector.language.IAggregate;
import org.teiid.connector.language.IBatchedUpdates;
-import org.teiid.connector.language.IBulkInsert;
import org.teiid.connector.language.ICompareCriteria;
import org.teiid.connector.language.ICompoundCriteria;
import org.teiid.connector.language.IDelete;
@@ -39,6 +38,7 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.IJoin;
import org.teiid.connector.language.ILanguageObject;
@@ -129,7 +129,7 @@
public void visit(IInCriteria obj) {}
public void visit(IInlineView obj) {}
public void visit(IInsert obj) {}
- public void visit(IBulkInsert obj) {}
+ public void visit(IInsertExpressionValueSource obj) {}
public void visit(IIsNullCriteria obj) {}
public void visit(IJoin obj) {}
public void visit(ILikeCriteria obj) {}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/HierarchyVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/HierarchyVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/HierarchyVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,6 +34,7 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.IJoin;
import org.teiid.connector.language.ILikeCriteria;
@@ -41,6 +42,7 @@
import org.teiid.connector.language.IOrderBy;
import org.teiid.connector.language.IProcedure;
import org.teiid.connector.language.IQuery;
+import org.teiid.connector.language.IQueryCommand;
import org.teiid.connector.language.IScalarSubquery;
import org.teiid.connector.language.ISearchedCaseExpression;
import org.teiid.connector.language.ISelect;
@@ -127,9 +129,16 @@
public void visit(IInsert obj) {
visitNode(obj.getGroup());
visitNodes(obj.getElements());
- visitNodes(obj.getValues());
+ if (!(obj.getValueSource() instanceof IQueryCommand) || visitSubcommands) {
+ visitNode(obj.getValueSource());
+ }
}
+ @Override
+ public void visit(IInsertExpressionValueSource obj) {
+ visitNodes(obj.getValues());
+ }
+
public void visit(IIsNullCriteria obj) {
visitNode(obj.getExpression());
}
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/LanguageObjectVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/LanguageObjectVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/framework/LanguageObjectVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -29,7 +29,7 @@
public interface LanguageObjectVisitor {
public void visit(IAggregate obj);
public void visit(IBatchedUpdates obj);
- public void visit(IBulkInsert obj);
+ public void visit(IInsertExpressionValueSource obj);
public void visit(ICompareCriteria obj);
public void visit(ICompoundCriteria obj);
public void visit(IDelete obj);
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/CollectorVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/CollectorVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/CollectorVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,9 +22,48 @@
package org.teiid.connector.visitor.util;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
-import org.teiid.connector.language.*;
+import org.teiid.connector.language.IAggregate;
+import org.teiid.connector.language.IBatchedUpdates;
+import org.teiid.connector.language.ICompareCriteria;
+import org.teiid.connector.language.ICompoundCriteria;
+import org.teiid.connector.language.IDelete;
+import org.teiid.connector.language.IElement;
+import org.teiid.connector.language.IExistsCriteria;
+import org.teiid.connector.language.IFrom;
+import org.teiid.connector.language.IFunction;
+import org.teiid.connector.language.IGroup;
+import org.teiid.connector.language.IGroupBy;
+import org.teiid.connector.language.IInCriteria;
+import org.teiid.connector.language.IInlineView;
+import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
+import org.teiid.connector.language.IIsNullCriteria;
+import org.teiid.connector.language.IJoin;
+import org.teiid.connector.language.ILanguageObject;
+import org.teiid.connector.language.ILikeCriteria;
+import org.teiid.connector.language.ILimit;
+import org.teiid.connector.language.ILiteral;
+import org.teiid.connector.language.INotCriteria;
+import org.teiid.connector.language.IOrderBy;
+import org.teiid.connector.language.IOrderByItem;
+import org.teiid.connector.language.IParameter;
+import org.teiid.connector.language.IProcedure;
+import org.teiid.connector.language.IQuery;
+import org.teiid.connector.language.IScalarSubquery;
+import org.teiid.connector.language.ISearchedCaseExpression;
+import org.teiid.connector.language.ISelect;
+import org.teiid.connector.language.ISelectSymbol;
+import org.teiid.connector.language.ISetClause;
+import org.teiid.connector.language.ISetClauseList;
+import org.teiid.connector.language.ISetQuery;
+import org.teiid.connector.language.ISubqueryCompareCriteria;
+import org.teiid.connector.language.ISubqueryInCriteria;
+import org.teiid.connector.language.IUpdate;
import org.teiid.connector.visitor.framework.DelegatingHierarchyVisitor;
import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
@@ -153,7 +192,7 @@
/*
* @see com.metamatrix.data.visitor.framework.LanguageObjectVisitor#visit(com.metamatrix.data.language.IBulkInsert)
*/
- public void visit(IBulkInsert obj) {
+ public void visit(IInsertExpressionValueSource obj) {
checkInstance(obj);
}
/*
Modified: trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connector-api/src/main/java/org/teiid/connector/visitor/util/SQLStringVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -27,7 +27,6 @@
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.language.IAggregate;
-import org.teiid.connector.language.IBulkInsert;
import org.teiid.connector.language.ICommand;
import org.teiid.connector.language.ICompareCriteria;
import org.teiid.connector.language.ICompoundCriteria;
@@ -44,6 +43,7 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.IJoin;
import org.teiid.connector.language.ILanguageObject;
@@ -124,11 +124,11 @@
*/
protected void append(List<? extends ILanguageObject> items) {
if (items != null && items.size() != 0) {
- append((ILanguageObject)items.get(0));
+ append(items.get(0));
for (int i = 1; i < items.size(); i++) {
buffer.append(COMMA)
.append(SPACE);
- append((ILanguageObject)items.get(i));
+ append(items.get(i));
}
}
}
@@ -538,57 +538,35 @@
* @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.connector.language.IInsert)
*/
public void visit(IInsert obj) {
- formatBasicInsert(obj);
- buffer.append(SPACE)
- .append(VALUES)
- .append(SPACE)
- .append(LPAREN);
- append(obj.getValues());
- buffer.append(RPAREN);
- }
-
- /**
- * @param obj
- */
- private void formatBasicInsert(IInsert obj) {
- buffer.append(INSERT)
- .append(SPACE);
- buffer.append(getSourceComment(obj));
- buffer.append(INTO)
- .append(SPACE);
- append(obj.getGroup());
- if (obj.getElements() != null && obj.getElements().size() != 0) {
- buffer.append(SPACE)
- .append(LPAREN);
+ buffer.append(INSERT).append(SPACE);
+ buffer.append(getSourceComment(obj));
+ buffer.append(INTO).append(SPACE);
+ append(obj.getGroup());
+ if (obj.getElements() != null && obj.getElements().size() != 0) {
+ buffer.append(SPACE).append(LPAREN);
- int elementCount= obj.getElements().size();
- for(int i=0; i<elementCount; i++) {
- buffer.append(getElementName(obj.getElements().get(i), false));
- if (i<elementCount-1) {
- buffer.append(COMMA);
- buffer.append(SPACE);
- }
- }
+ int elementCount = obj.getElements().size();
+ for (int i = 0; i < elementCount; i++) {
+ buffer.append(getElementName(obj.getElements().get(i), false));
+ if (i < elementCount - 1) {
+ buffer.append(COMMA);
+ buffer.append(SPACE);
+ }
+ }
- buffer.append(RPAREN);
- }
+ buffer.append(RPAREN);
+ }
+ buffer.append(SPACE);
+ append(obj.getValueSource());
}
- public void visit(IBulkInsert obj) {
- formatBasicInsert(obj);
- buffer.append(SPACE)
- .append(VALUES)
- .append(SPACE)
- .append(LPAREN);
- int elementCount= obj.getElements().size();
- for(int i=0; i<elementCount; i++) {
- buffer.append(UNDEFINED_PARAM);
- if (i<elementCount-1) {
- buffer.append(COMMA);
- }
- }
- buffer.append(RPAREN);
- }
+ @Override
+ public void visit(IInsertExpressionValueSource obj) {
+ buffer.append(VALUES).append(SPACE).append(LPAREN);
+ append(obj.getValues());
+ buffer.append(RPAREN);
+ }
+
/**
* @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.connector.language.IIsNullCriteria)
*/
@@ -720,7 +698,9 @@
* @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(org.teiid.connector.language.ILiteral)
*/
public void visit(ILiteral obj) {
- if (obj.getValue() == null) {
+ if (obj.isBindValue()) {
+ buffer.append("?"); //$NON-NLS-1$
+ } else if (obj.getValue() == null) {
buffer.append(NULL);
} else {
Class type = obj.getType();
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCBaseExecution.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -28,6 +28,7 @@
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
+import java.util.List;
import java.util.Properties;
import org.teiid.connector.api.ConnectorException;
@@ -39,6 +40,7 @@
import org.teiid.connector.jdbc.translator.TranslatedCommand;
import org.teiid.connector.jdbc.translator.Translator;
import org.teiid.connector.language.ICommand;
+import org.teiid.connector.language.ILiteral;
import com.metamatrix.common.util.PropertiesUtils;
@@ -90,7 +92,29 @@
fetchSize = Math.min(fetchSize, maxResultRows);
}
}
+
+ /**
+ * Return true if this is a batched update
+ */
+ protected void bindPreparedStatementValues(PreparedStatement stmt, TranslatedCommand tc, int rowCount) throws SQLException {
+ List params = tc.getPreparedValues();
+ for (int row = 0; row < rowCount; row++) {
+ for (int i = 0; i< params.size(); i++) {
+ ILiteral paramValue = (ILiteral)params.get(i);
+ Object value = paramValue.getValue();
+ if (paramValue.isMultiValued()) {
+ value = ((List<?>)value).get(row);
+ }
+ Class paramType = paramValue.getType();
+ sqlTranslator.bindValue(stmt, value, paramType, i+1);
+ if (rowCount > 1) {
+ stmt.addBatch();
+ }
+ }
+ }
+ }
+
// ===========================================================================================================================
// Methods
// ===========================================================================================================================
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -32,19 +32,16 @@
*/
public class JDBCCapabilities extends BasicConnectorCapabilities {
- public static final int DEFAULT_JDBC_MAX_IN_CRITERIA_SIZE = 1000;
-
/**
*
*/
public JDBCCapabilities() {
- this.setMaxInCriteriaSize(DEFAULT_JDBC_MAX_IN_CRITERIA_SIZE);
}
/*
* @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
*/
- public List getSupportedFunctions() {
+ public List<String> getSupportedFunctions() {
return Arrays.asList(new String[] { "+", "-", "*", "/" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@@ -53,13 +50,9 @@
* @since 4.2
*/
public int getMaxInCriteriaSize() {
- return maxInCriteriaSize;
+ return 1000;
}
- public void setMaxInCriteriaSize(int maxInCriteriaSize) {
- this.maxInCriteriaSize = maxInCriteriaSize;
- }
-
@Override
public boolean supportsGroupBy() {
return true;
@@ -291,7 +284,7 @@
}
@Override
- public boolean supportsBulkInsert() {
+ public boolean supportsBulkUpdate() {
return true;
}
@@ -324,5 +317,10 @@
public boolean supportsSelectExpression() {
return true;
}
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return true;
+ }
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCPropertyNames.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCPropertyNames.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCPropertyNames.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -36,14 +36,6 @@
public static final String TRIM_STRINGS = "TrimStrings"; //$NON-NLS-1$
/**
- * This is the property name of the ConnectorService property that defines
- * the size of a SetCriteria (IN criteria) before the criteria is broken into
- * multiple queries and the results are aggregated. 0 indicates that set
- * criteria should never be broken. The default value should be 0.
- */
- public static final String SET_CRITERIA_BATCH_SIZE = "SetCriteriaBatchSize"; //$NON-NLS-1$
-
- /**
* This is the property name used to set the transaction isolation level on
* a connector's data source. The value string must be the the same as one of the
* names of the values of the transaction isolation levels defined in
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCQueryExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCQueryExecution.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCQueryExecution.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -93,7 +93,7 @@
results = getStatement().executeQuery(sql);
} else {
PreparedStatement pstatement = getPreparedStatement(sql);
- sqlTranslator.bindPreparedStatementValues(this.connection, pstatement, translatedComm);
+ bindPreparedStatementValues(pstatement, translatedComm, 1);
results = pstatement.executeQuery();
}
addStatementWarnings();
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCUpdateExecution.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCUpdateExecution.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCUpdateExecution.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -37,8 +37,8 @@
import org.teiid.connector.jdbc.translator.TranslatedCommand;
import org.teiid.connector.jdbc.translator.Translator;
import org.teiid.connector.language.IBatchedUpdates;
-import org.teiid.connector.language.IBulkInsert;
import org.teiid.connector.language.ICommand;
+import org.teiid.connector.language.ILiteral;
/**
@@ -71,15 +71,13 @@
@Override
public void execute() throws ConnectorException {
- if (command instanceof IBulkInsert) {
- result = new int [] {execute((IBulkInsert)command)};
- } else if (command instanceof IBatchedUpdates) {
+ if (command instanceof IBatchedUpdates) {
result = execute(((IBatchedUpdates)command));
} else {
// translate command
TranslatedCommand translatedComm = translateCommand(command);
- result = new int [] {executeTranslatedCommand(translatedComm)};
+ result = executeTranslatedCommand(translatedComm);
}
}
@@ -119,7 +117,7 @@
}
pstmt = getPreparedStatement(command.getSql());
}
- sqlTranslator.bindPreparedStatementValues(this.connection, pstmt, command);
+ bindPreparedStatementValues(pstmt, command, 1);
pstmt.addBatch();
} else {
if (previousCommand != null && previousCommand.isPrepared()) {
@@ -149,44 +147,6 @@
return results;
}
- /**
- * An implementation to bulk insert rows into single table.
- *
- * @param command
- * @return
- * @throws ConnectorException
- */
- public int execute(IBulkInsert command) throws ConnectorException {
- boolean succeeded = false;
-
- // translate command
- TranslatedCommand translatedComm = translateCommand(command);
-
- // create statement or PreparedStatement and execute
- String sql = translatedComm.getSql();
-
- boolean commitType = getAutoCommit(translatedComm);
- int updateCount = -1;
- try {
- // temporarily turn the auto commit off, and set it back to what it was
- // before at the end of the command execution.
- if (commitType) {
- connection.setAutoCommit(false);
- }
- PreparedStatement stmt = getPreparedStatement(sql);
- updateCount = sqlTranslator.executeStatementForBulkInsert(this.connection, stmt, translatedComm);
- addStatementWarnings();
- succeeded = true;
- } catch (SQLException e) {
- throw new JDBCExecutionException(e, translatedComm);
- } finally {
- if (commitType) {
- restoreAutoCommit(!succeeded, translatedComm);
- }
- }
- return updateCount;
- }
-
private void executeBatch(int commandCount,
int[] results,
List<TranslatedCommand> commands) throws ConnectorException {
@@ -198,7 +158,7 @@
}
commands.clear();
} catch (SQLException err) {
- throw new JDBCExecutionException(err, commands.toArray(new TranslatedCommand[commands.size()])); //$NON-NLS-1$
+ throw new JDBCExecutionException(err, commands.toArray(new TranslatedCommand[commands.size()]));
}
}
@@ -207,23 +167,51 @@
* @throws ConnectorException
* @since 4.3
*/
- private int executeTranslatedCommand(TranslatedCommand translatedComm) throws ConnectorException {
+ private int[] executeTranslatedCommand(TranslatedCommand translatedComm) throws ConnectorException {
// create statement or PreparedStatement and execute
String sql = translatedComm.getSql();
-
+ boolean commitType = false;
+ boolean succeeded = false;
try {
- int updateCount;
+ int updateCount = 0;
if (!translatedComm.isPrepared()) {
updateCount = getStatement().executeUpdate(sql);
} else {
PreparedStatement pstatement = getPreparedStatement(sql);
- sqlTranslator.bindPreparedStatementValues(this.connection, pstatement, translatedComm);
- updateCount = pstatement.executeUpdate();
+ int rowCount = 1;
+ for (int i = 0; i< translatedComm.getPreparedValues().size(); i++) {
+ ILiteral paramValue = (ILiteral)translatedComm.getPreparedValues().get(i);
+ if (paramValue.isMultiValued()) {
+ rowCount = ((List<?>)paramValue).size();
+ break;
+ }
+ }
+ if (rowCount > 1) {
+ commitType = getAutoCommit(translatedComm);
+ if (commitType) {
+ connection.setAutoCommit(false);
+ }
+ }
+ bindPreparedStatementValues(pstatement, translatedComm, rowCount);
+ if (rowCount > 1) {
+ int[] results = pstatement.executeBatch();
+
+ for (int i=0; i<results.length; i++) {
+ updateCount += results[i];
+ }
+ succeeded = true;
+ } else {
+ updateCount = pstatement.executeUpdate();
+ }
}
addStatementWarnings();
- return updateCount;
+ return new int[] {updateCount};
} catch (SQLException err) {
throw new JDBCExecutionException(err, translatedComm);
+ } finally {
+ if (commitType) {
+ restoreAutoCommit(!succeeded, translatedComm);
+ }
}
}
@@ -253,9 +241,14 @@
if (exceptionOccurred) {
connection.rollback();
}
- connection.setAutoCommit(true);
} catch (SQLException err) {
throw new JDBCExecutionException(err, command);
+ } finally {
+ try {
+ connection.setAutoCommit(true);
+ } catch (SQLException err) {
+ throw new JDBCExecutionException(err, command);
+ }
}
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/SimpleCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/SimpleCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/SimpleCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,10 +34,13 @@
public class SimpleCapabilities extends JDBCCapabilities {
public SimpleCapabilities() {
- // Max acceptable by all BQT dbs (Sybase=250, Oracle=1000)
- setMaxInCriteriaSize(250);
}
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 250;
+ }
+
/*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
@@ -262,5 +265,10 @@
public boolean supportsUnions() {
return false;
}
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/access/AccessCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/access/AccessCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/access/AccessCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -37,5 +37,10 @@
public boolean supportsRowLimit() {
return true;
}
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/db2/DB2Capabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/db2/DB2Capabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/db2/DB2Capabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,12 +34,9 @@
*/
public class DB2Capabilities extends JDBCCapabilities {
- public static final int DB2_MAX_SET_SIZE = 1000;
-
public DB2Capabilities() {
- this.setMaxInCriteriaSize(DB2_MAX_SET_SIZE);
- }
-
+ }
+
/**
* @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
*/
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -33,12 +33,9 @@
*/
public class OracleCapabilities extends JDBCCapabilities {
- public static final int ORACLE_MAX_SET_SIZE = 1000;
-
public OracleCapabilities() {
- this.setMaxInCriteriaSize(ORACLE_MAX_SET_SIZE);
- }
-
+ }
+
/**
* @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
*/
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleSQLTranslator.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -45,6 +45,7 @@
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IGroup;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.ILimit;
import org.teiid.connector.language.IQueryCommand;
import org.teiid.connector.language.ISetQuery.Operation;
@@ -101,8 +102,13 @@
* then pull the Sequence name out of the name in source of the column.
*/
IInsert insert = (IInsert)command;
+
+ if (!(insert.getValueSource() instanceof IInsertExpressionValueSource)) {
+ return command;
+ }
+ IInsertExpressionValueSource values = (IInsertExpressionValueSource)insert.getValueSource();
List<Element> allElements = insert.getGroup().getMetadataObject().getChildren();
- if (allElements.size() == insert.getValues().size()) {
+ if (allElements.size() == values.getValues().size()) {
return command;
}
@@ -134,7 +140,7 @@
int delimiterIndex = sequence.indexOf(SQLReservedWords.DOT);
if (delimiterIndex == -1) {
- throw new ConnectorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name);
+ throw new ConnectorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
}
String sequenceGroupName = sequence.substring(0, delimiterIndex);
String sequenceElementName = sequence.substring(delimiterIndex + 1);
@@ -142,7 +148,7 @@
IGroup sequenceGroup = this.getLanguageFactory().createGroup(sequenceGroupName, null, null);
IElement sequenceElement = this.getLanguageFactory().createElement(sequenceElementName, sequenceGroup, null, element.getJavaType());
insert.getElements().add(index, this.getLanguageFactory().createElement(element.getName(), insert.getGroup(), element, element.getJavaType()));
- insert.getValues().add(index, sequenceElement);
+ values.getValues().add(index, sequenceElement);
}
return command;
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/SequeLinkOracleCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/SequeLinkOracleCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/SequeLinkOracleCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -30,7 +30,7 @@
public class SequeLinkOracleCapabilities extends OracleCapabilities {
@Override
- public boolean supportsBulkInsert() {
+ public boolean supportsBulkUpdate() {
return false;
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -33,12 +33,9 @@
*/
public class SqlServerCapabilities extends JDBCCapabilities {
- public static final int SQLSRVR_MAX_SET_SIZE = 1000;
-
public SqlServerCapabilities() {
- this.setMaxInCriteriaSize(SQLSRVR_MAX_SET_SIZE);
- }
-
+ }
+
/**
* @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
*/
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sybase/SybaseCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sybase/SybaseCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sybase/SybaseCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,10 +34,12 @@
*/
public class SybaseCapabilities extends JDBCCapabilities {
- public static final int SYBASE_MAX_SET_SIZE = 250;
-
public SybaseCapabilities() {
- this.setMaxInCriteriaSize(SYBASE_MAX_SET_SIZE);
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 250;
}
/**
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/teradata/TeradataCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/teradata/TeradataCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/teradata/TeradataCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,10 +34,7 @@
*/
public class TeradataCapabilities extends JDBCCapabilities {
- public static final int TERADATA_MAX_SET_SIZE = 1000;
-
public TeradataCapabilities() {
- this.setMaxInCriteriaSize(TERADATA_MAX_SET_SIZE);
}
/*
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/BindValueVisitor.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/BindValueVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/BindValueVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -28,6 +28,7 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.ILanguageObject;
import org.teiid.connector.language.ILikeCriteria;
import org.teiid.connector.language.ILiteral;
@@ -111,7 +112,7 @@
}
@Override
- public void visit(IInsert obj) {
+ public void visit(IInsertExpressionValueSource obj) {
replaceWithBinding = true;
visitNodes(obj.getValues());
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/ReplacementVisitor.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/ReplacementVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/ReplacementVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -34,7 +34,7 @@
import org.teiid.connector.language.IGroupBy;
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
-import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.ILikeCriteria;
import org.teiid.connector.language.IQueryCommand;
@@ -106,7 +106,7 @@
List<IExpression> expressions = obj.getElements();
for (int i=0; i<expressions.size(); i++) {
- IExpression expression = (IExpression)expressions.get(i);
+ IExpression expression = expressions.get(i);
expressions.set(i, replaceFunction(expression));
}
}
@@ -119,22 +119,20 @@
List<IExpression> rightExprs = obj.getRightExpressions();
for(int i=0; i<rightExprs.size(); i++) {
- IExpression expr = (IExpression) rightExprs.get(i);
+ IExpression expr = rightExprs.get(i);
rightExprs.set(i, replaceFunction(expr));
}
}
-
- /**
- * @see com.metamatrix.data.visitor.SQLStringVisitor#visit(org.teiid.connector.language.IInsert)
- */
- public void visit(IInsert obj) {
+
+ @Override
+ public void visit(IInsertExpressionValueSource obj) {
List<IExpression> values = obj.getValues();
for(int i=0; i<values.size(); i++) {
- IExpression expr = (IExpression) values.get(i);
+ IExpression expr = values.get(i);
values.set(i, replaceFunction(expr));
}
- }
+ }
/*
* @see com.metamatrix.data.visitor.LanguageObjectVisitor#visit(com.metamatrix.data.language.IIsNullCriteria)
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/SQLConversionVisitor.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/SQLConversionVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/SQLConversionVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -37,9 +37,7 @@
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.api.TypeFacility;
-import org.teiid.connector.language.IBulkInsert;
import org.teiid.connector.language.ICommand;
-import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IFunction;
import org.teiid.connector.language.ILanguageObject;
import org.teiid.connector.language.ILimit;
@@ -71,7 +69,6 @@
private boolean prepared;
private List preparedValues = new ArrayList();
- private List preparedTypes = new ArrayList();
private Set<ILanguageObject> recursionObjects = Collections.newSetFromMap(new IdentityHashMap<ILanguageObject, Boolean>());
@@ -123,19 +120,6 @@
}
}
- public void visit(IBulkInsert obj) {
- this.prepared = true;
-
- super.visit(obj);
-
- for (int i = 0; i < obj.getElements().size(); i++) {
- IElement element = (IElement) obj.getElements().get(i);
- this.preparedTypes.add(element.getType());
- }
-
- this.preparedValues = obj.getRows();
- }
-
/**
* @param type
* @param object
@@ -203,8 +187,7 @@
public void visit(ILiteral obj) {
if (this.prepared && obj.isBindValue()) {
buffer.append(UNDEFINED_PARAM);
- preparedValues.add(obj.getValue());
- preparedTypes.add(obj.getType());
+ preparedValues.add(obj);
} else {
translateSQLType(obj.getType(), obj.getValue(), buffer);
}
@@ -290,13 +273,6 @@
return this.preparedValues;
}
- /**
- * @return the preparedValues
- */
- List getPreparedTypes() {
- return this.preparedTypes;
- }
-
public boolean isPrepared() {
return prepared;
}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/TranslatedCommand.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/TranslatedCommand.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/TranslatedCommand.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -45,7 +45,6 @@
private String sql;
private boolean prepared;
private List preparedValues;
- private List preparedTypes;
private SQLConversionVisitor sqlConversionVisitor;
private ReplacementVisitor functionVisitor;
@@ -74,7 +73,6 @@
public void translateCommand(ICommand command) throws ConnectorException {
this.sql = getSQL(command);
this.preparedValues = this.sqlConversionVisitor.getPreparedValues();
- this.preparedTypes = this.sqlConversionVisitor.getPreparedTypes();
this.prepared = this.sqlConversionVisitor.isPrepared();
}
@@ -128,15 +126,6 @@
}
/**
- * Return List of types to set on a prepared statement, if
- * necessary (see {@link #getStatementType})
- * @return List of types to be set on a prepared statement
- */
- public List getPreparedTypes() {
- return preparedTypes;
- }
-
- /**
* Get String SQL of translated command; but use
* {@link #nextLargeSetQuerySQL} if this command is
* a {@link #isLargeSetQuery large set query}
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/Translator.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/Translator.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/translator/Translator.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -462,30 +462,6 @@
}
/**
- * Will be called by Query and Update executions if a PreparedStatement is used.
- *
- * bindValue is ultimately called from this method and for binding CallableStatement
- * values, so subclasses should override that method if necessery to change the binding
- * behavior.
- *
- * @see com.metamatrix.connector.jdbc.extension.ResultsTranslator#bindPreparedStatementValues(java.sql.Connection, java.sql.PreparedStatement, org.teiid.connector.jdbc.translator.TranslatedCommand)
- */
- public void bindPreparedStatementValues(Connection conn, PreparedStatement stmt, TranslatedCommand command) throws SQLException {
- List params = command.getPreparedValues();
-
- setPreparedStatementValues(stmt, params, command.getPreparedTypes());
- }
-
- private void setPreparedStatementValues(PreparedStatement stmt, List paramValues, List paramTypes) throws SQLException {
- for (int i = 0; i< paramValues.size(); i++) {
- Object parmvalue = paramValues.get(i);
- Class paramType = (Class)paramTypes.get(i);
- // this means the params is one row
- bindValue(stmt, parmvalue, paramType, i+1);
- }
- }
-
- /**
* Sets prepared statement parameter i with param.
*
* Performs special handling to translate dates using the database time zone and to
@@ -498,7 +474,7 @@
* @param cal
* @throws SQLException
*/
- protected void bindValue(PreparedStatement stmt, Object param, Class paramType, int i) throws SQLException {
+ public void bindValue(PreparedStatement stmt, Object param, Class paramType, int i) throws SQLException {
int type = TypeFacility.getSQLTypeFromRuntimeType(paramType);
if (param == null) {
@@ -529,34 +505,6 @@
stmt.setObject(i, param, type);
}
- /**
- * Execute a bulk insert on the given preparedstatement.
- * @param conn
- * @param stmt
- * @param command
- * @return
- * @throws SQLException
- */
- public int executeStatementForBulkInsert(Connection conn, PreparedStatement stmt, TranslatedCommand command) throws SQLException {
- List rows = command.getPreparedValues();
- int updateCount = 0;
-
- for (int i = 0; i< rows.size(); i++) {
- List row = (List) rows.get(i);
-
- setPreparedStatementValues(stmt, row, command.getPreparedTypes());
-
- stmt.addBatch();
- }
-
- int[] results = stmt.executeBatch();
-
- for (int i=0; i<results.length; i++) {
- updateCount += results[i];
- }
- return updateCount;
- }
-
/**
* Retrieve the value on the current resultset row for the given column index.
* @param results
@@ -818,16 +766,6 @@
result = getDefaultCapabilities().newInstance();
}
- if (result instanceof JDBCCapabilities) {
- String setCriteriaBatchSize = this.environment.getProperties().getProperty(JDBCPropertyNames.SET_CRITERIA_BATCH_SIZE);
- if (setCriteriaBatchSize != null) {
- int maxInCriteriaSize = Integer
- .parseInt(setCriteriaBatchSize);
- if (maxInCriteriaSize > 0) {
- ((JDBCCapabilities) result).setMaxInCriteriaSize(maxInCriteriaSize);
- }
- }
- }
return result;
} catch (Exception e) {
throw new ConnectorException(e);
Deleted: trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCConnector.java
===================================================================
--- trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCConnector.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCConnector.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.jdbc;
-
-import java.util.Properties;
-
-import static org.junit.Assert.*;
-import org.junit.Test;
-import org.teiid.connector.api.ConnectorCapabilities;
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.jdbc.translator.Translator;
-
-import com.metamatrix.cdk.api.EnvironmentUtility;
-
-
-public class TestJDBCConnector {
-
- public void helpTestMaxIn(int setting, int expected) throws Exception {
- Properties connProps = new Properties();
- connProps.setProperty(JDBCPropertyNames.SET_CRITERIA_BATCH_SIZE, String.valueOf(setting));
- connProps.setProperty(JDBCPropertyNames.EXT_CAPABILITY_CLASS, SimpleCapabilities.class.getName());
- Translator t = new Translator();
- t.initialize(EnvironmentUtility.createEnvironment(connProps));
- ConnectorCapabilities caps = t.getConnectorCapabilities();
- int maxIn = caps.getMaxInCriteriaSize();
- assertEquals(expected, maxIn);
- }
-
- @Test
- public void test1() throws Exception {
- helpTestMaxIn(-1, 250);
- }
-
- @Test
- public void test2() throws Exception {
- helpTestMaxIn(0, 250);
- }
-
- @Test
- public void test3() throws Exception {
- helpTestMaxIn(1, 1);
- }
-}
Modified: trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnector.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnector.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnector.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -73,24 +73,8 @@
}
this.props = env.getProperties();
- // Get properties for initial connection.
- // LDAP Max In Criteria
- String ldapMaxCriteriaStr = props.getProperty(LDAPConnectorPropertyNames.LDAP_MAX_CRITERIA);
- if(ldapMaxCriteriaStr!=null) {
- try {
- ldapMaxCriteria = Integer.parseInt(ldapMaxCriteriaStr);
- } catch (NumberFormatException ex) {
- final String msg = LDAPPlugin.Util.getString("LDAPConnection.maxCriteriaParseError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
- }
- } else {
- final String msg = LDAPPlugin.Util.getString("LDAPConnection.maxCriteriaPropNotFound"); //$NON-NLS-1$
- throw new ConnectorException(msg);
- }
-
// Create and configure capabilities class.
myCaps = new LDAPConnectorCapabilities();
- myCaps.setInCriteriaSize(ldapMaxCriteria);
}
/**
Modified: trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -29,8 +29,9 @@
*/
public class LDAPConnectorCapabilities extends BasicConnectorCapabilities {
- public void setInCriteriaSize(int maxInCriteriaSize) {
- this.maxInCriteriaSize = maxInCriteriaSize;
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 1000;
}
public boolean supportsCompareCriteriaEquals() {
Modified: trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorPropertyNames.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorPropertyNames.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorPropertyNames.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -29,7 +29,6 @@
public static final String LDAP_ADMIN_USER_DN = "LdapAdminUserDN"; //$NON-NLS-1$
public static final String LDAP_ADMIN_USER_PASSWORD = "LdapAdminUserPassword"; //$NON-NLS-1$
public static final String LDAP_TXN_TIMEOUT_IN_MILLIS = "LdapTxnTimeoutInMillis"; //$NON-NLS-1$
- public static final String LDAP_MAX_CRITERIA = "LdapMaxCriteria"; //$NON-NLS-1$
public static final String LDAP_DEFAULT_BASEDN = "SearchDefaultBaseDN"; //$NON-NLS-1$
public static final String LDAP_DEFAULT_SCOPE = "SearchDefaultScope"; //$NON-NLS-1$
public static final String LDAP_RESTRICT_TO_OBJECTCLASS = "RestrictToObjectClass"; //$NON-NLS-1$
Modified: trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPUpdateExecution.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPUpdateExecution.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPUpdateExecution.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -46,6 +46,7 @@
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.ILiteral;
import org.teiid.connector.language.ISetClause;
import org.teiid.connector.language.IUpdate;
@@ -164,7 +165,7 @@
throws ConnectorException {
List insertElementList = ((IInsert)command).getElements();
- List insertValueList = ((IInsert)command).getValues();
+ List insertValueList = ((IInsertExpressionValueSource)((IInsert)command).getValueSource()).getValues();
// create a new attribute list with case ignored in attribute
// names
Attributes insertAttrs = new BasicAttributes(true);
Modified: trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml
===================================================================
--- trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-ldap/src/main/resources/connector-ldap.xml 2009-05-11 14:34:31 UTC (rev 903)
@@ -2,11 +2,9 @@
<PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
<PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="extensionjar:connector_patch.jar;extensionjar:${project.artifactId}-${project.version}.jar;${classpath}" Multiplicity="0..1" IsExpert="true"/>
<PropertyDefinition Name="SearchDefaultBaseDN" DisplayName="Default Search Base DN" ShortDescription="Default Base DN for LDAP Searches" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.cleaning_interval" DisplayName="Pool cleaning Interval (seconds)" ShortDescription="Set the interval to cleaning the pool" DefaultValue="300" PropertyType="Integer" IsExpert="true" />
<PropertyDefinition Name="LdapAdminUserDN" DisplayName="Ldap Admin User DN" ShortDescription="User DN for the LDAP admin account." DefaultValue="cn=<>,ou=<>,dc=<>" Multiplicity="1" IsPreferred="true" />
<PropertyDefinition Name="Standard" DisplayName="Standard Type" ShortDescription="Standard Built-in Connector Type" DefaultValue="true" PropertyType="Boolean" IsExpert="true" IsModifiable="false" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.ldap.LDAPConnector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="LdapMaxCriteria" DisplayName="Ldap Max Criteria" ShortDescription="Maximum number of criteria supported in an LDAP search filter." DefaultValue="1000" Multiplicity="1" />
<PropertyDefinition Name="LdapAdminUserPassword" DisplayName="Ldap Admin Password" ShortDescription="Password of the LDAP admin user account." Multiplicity="1" IsMasked="true" IsPreferred="true" />
<PropertyDefinition Name="SearchDefaultScope" DisplayName="Default Search Scope" ShortDescription="Default Scope for LDAP Searches" DefaultValue="SUBTREE_SCOPE" Multiplicity="1">
<AllowedValue>OBJECT_SCOPE</AllowedValue>
@@ -14,10 +12,6 @@
<AllowedValue>SUBTREE_SCOPE</AllowedValue>
</PropertyDefinition>
<PropertyDefinition Name="RestrictToObjectClass" DisplayName="Restrict Searches To Named Object Class" ShortDescription="Restrict Searches to objectClass named in the Name field for a table" DefaultValue="false" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.max_connections" DisplayName="Pool Maximum Connections" ShortDescription="Set the maximum number of connections for the connection pool" DefaultValue="100" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
<PropertyDefinition Name="LdapTxnTimeoutInMillis" DisplayName="Ldap Transaction Timeout (ms)" ShortDescription="Timeout value for LDAP searches. Defaults to TCP timeout value." />
- <PropertyDefinition Name="com.metamatrix.data.pool.wait_for_source_time" DisplayName="Pool Connection Waiting Time (milliseconds)" ShortDescription="Set the time to wait if the connection is not available" DefaultValue="60000" PropertyType="Integer" IsExpert="true" />
<PropertyDefinition Name="LdapUrl" DisplayName="Ldap URL" ShortDescription="Ldap URL of the server, including port number." DefaultValue="ldap://<ldapServer>:<389>" Multiplicity="1" IsPreferred="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.live_and_unused_time" DisplayName="Pool Connection Idle Time (seconds)" ShortDescription="Set the idle time of the connection before it should be closed if pool shrinking is enabled" DefaultValue="300" PropertyType="Integer" IsExpert="true" />
- <PropertyDefinition Name="com.metamatrix.data.pool.enable_shrinking" DisplayName="Pool Shrinking Enabled" ShortDescription="Set whether to enable the pool shrinking" DefaultValue="true" PropertyType="Boolean" IsExpert="true" />
</ComponentType>
\ No newline at end of file
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Connector.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Connector.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/Connector.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -119,15 +119,6 @@
} catch (Exception e) {
throw new ConnectorException(e, "Unable to load Capabilities Class");
}
- try {
- String inLimitString = env.getProperties().getProperty("InLimit", Integer.toString(-1));
- int inLimit = inLimitString == null ? -1 : Integer.decode(inLimitString).intValue();
- salesforceCapabilites.setMaxInCriteriaSize(inLimit);
- } catch (NumberFormatException e) {
- throw new ConnectorException(Messages.getString("SalesforceConnection.bad.IN.value"));
- }
-
-
logger.logTrace("Return SalesforceSourceConnection.initialize()");
}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/SalesforceCapabilities.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/SalesforceCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/SalesforceCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -30,13 +30,9 @@
public class SalesforceCapabilities extends BasicConnectorCapabilities {
public int getMaxInCriteriaSize() {
- return maxInCriteriaSize;
+ return 100;
}
- public void setMaxInCriteriaSize(int size) {
- maxInCriteriaSize = size;
- }
-
public List getSupportedFunctions() {
List<String> supportedFunctions = new ArrayList<String>();
supportedFunctions.add("includes");
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/InsertVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -31,6 +31,7 @@
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.connector.language.ILiteral;
import org.teiid.connector.metadata.runtime.Element;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
@@ -51,7 +52,7 @@
loadColumnMetadata(insert.getGroup());
List<IElement> columns = insert.getElements();
- List<IExpression> values = insert.getValues();
+ List<IExpression> values = ((IInsertExpressionValueSource)insert.getValueSource()).getValues();
if(columns.size() != values.size()) {
throw new ConnectorException("Error: columns.size and values.size are not the same.");
}
Modified: trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml
===================================================================
--- trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/connectors/connector-salesforce/src/main/resources/connector-salesforce.xml 2009-05-11 14:34:31 UTC (rev 903)
@@ -4,9 +4,7 @@
<PropertyDefinition Name="username" DisplayName="User Name" ShortDescription="Name value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsPreferred="true" />
<PropertyDefinition Name="ConnectorStateClass" DisplayName="Connector State Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.ConnectorState" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" DefaultValue="com.metamatrix.connector.salesforce.Connector" Multiplicity="1" IsExpert="true" />
- <PropertyDefinition Name="InLimit" DisplayName="IN Criteria Limit" ShortDescription="The maximum number of values that can be supplied in an IN criteria" DefaultValue="-1" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="password" DisplayName="Password" ShortDescription="Password value for Salesforce authentication" DefaultValue="" Multiplicity="1" IsMasked="true" IsPreferred="true" />
<PropertyDefinition Name="URL" DisplayName="Salesforce URL" ShortDescription="URL for connecting to Salesforce" DefaultValue="" IsExpert="true" />
<PropertyDefinition Name="ConnectorCapabilities" DisplayName="Connector Capabilities Class" ShortDescription="The class to use to provide the Connector Capabilities" DefaultValue="com.metamatrix.connector.salesforce.SalesforceCapabilities" IsConstrainedToAllowedValues="false" IsExpert="true" />
- <PropertyDefinition Name="SetCriteriaBatchSize" DisplayName="SetCriteria Batch Size" ShortDescription="Max number of values in a SetCriteria before batching into multiple queries. A value <= 0 indicates batching is OFF." DefaultValue="0" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
</ComponentType>
\ No newline at end of file
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -277,13 +277,8 @@
* @since 4.2
*/
BATCHED_UPDATES,
+ BULK_UPDATE,
/**
- * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
- *
- * @since 4.2
- */
- BULK_INSERT,
- /**
* Support indicates connector can limit result rows
*
* @since 5.0 SP1
@@ -308,10 +303,6 @@
* @since 5.0.2
*/
CONNECTOR_ID,
- /** Support indicates connector support prepared statement batch update
- * @since 5.5.2
- */
- PREPARED_BATCH_UPDATE,
/**
* @since 6.0.0 indicates the source supports XA transactions
*/
@@ -320,6 +311,7 @@
* @since 6.0.0 indicates support for where all
*/
REQUIRES_CRITERIA,
+ INSERT_WITH_QUERYEXPRESSION
}
public enum Scope {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -171,7 +171,7 @@
if (!metadata.isVirtualGroup(groupID) && !metadata.isTemporaryTable(groupID)) {
SourceCapabilities caps = capFinder.findCapabilities(modelName);
pinode.setDoBatching(caps.supportsCapability(Capability.BATCHED_UPDATES));
- pinode.setDoBulkInsert(caps.supportsCapability(Capability.BULK_INSERT));
+ pinode.setDoBulkInsert(caps.supportsCapability(Capability.BULK_UPDATE));
} else if (metadata.isTemporaryTable(groupID)) {
pinode.setDoBulkInsert(true);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCollapseSource.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCollapseSource.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCollapseSource.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -41,6 +41,7 @@
import com.metamatrix.query.processor.ProcessorPlan;
import com.metamatrix.query.processor.relational.AccessNode;
import com.metamatrix.query.processor.relational.RelationalPlan;
+import com.metamatrix.query.resolver.util.ResolverUtil;
import com.metamatrix.query.rewriter.QueryRewriter;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.CompoundCriteria;
@@ -48,6 +49,7 @@
import com.metamatrix.query.sql.lang.From;
import com.metamatrix.query.sql.lang.FromClause;
import com.metamatrix.query.sql.lang.GroupBy;
+import com.metamatrix.query.sql.lang.Insert;
import com.metamatrix.query.sql.lang.JoinPredicate;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.lang.Limit;
@@ -87,8 +89,19 @@
Command command = FrameUtil.getNonQueryCommand(accessNode);
if(command == null) {
- plan = removeUnnecessaryInlineView(plan, accessNode);
- command = createQuery(metadata, capFinder, accessNode, accessNode);
+ PlanNode commandRoot = accessNode;
+ GroupSymbol intoGroup = (GroupSymbol)accessNode.getFirstChild().getProperty(NodeConstants.Info.INTO_GROUP);
+ if (intoGroup != null) {
+ commandRoot = NodeEditor.findNodePreOrder(accessNode, NodeConstants.Types.SOURCE).getFirstChild();
+ }
+ plan = removeUnnecessaryInlineView(plan, commandRoot);
+ QueryCommand queryCommand = createQuery(metadata, capFinder, accessNode, commandRoot);
+ command = queryCommand;
+ if (intoGroup != null) {
+ Insert insertCommand = new Insert(intoGroup, ResolverUtil.resolveElementsInGroup(intoGroup, metadata), null);
+ insertCommand.setQueryExpression(queryCommand);
+ command = insertCommand;
+ }
}
accessNode.setProperty(NodeConstants.Info.ATOMIC_REQUEST, command);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -179,8 +179,17 @@
return null;
}
- if (!CapabilitiesUtil.supportsInlineView(modelID, metadata, capFinder)) {
+ //raise only if there is no intervening project into
+ PlanNode parentProject = NodeEditor.findParent(parentNode, NodeConstants.Types.PROJECT);
+ GroupSymbol intoGroup = (GroupSymbol)parentProject.getProperty(NodeConstants.Info.INTO_GROUP);
+ if (intoGroup != null && parentProject.getParent() == null) {
+ if (CapabilitiesUtil.supports(Capability.INSERT_WITH_QUERYEXPRESSION, modelID, metadata, capFinder) && CapabilitiesUtil.isSameConnector(modelID, metadata.getModelID(intoGroup.getMetadataID()), metadata, capFinder)) {
+ rootNode = performRaise(rootNode, accessNode, parentNode);
+ return performRaise(rootNode, accessNode, parentProject);
+ }
return null;
+ } else if (!CapabilitiesUtil.supportsInlineView(modelID, metadata, capFinder)) {
+ return null;
}
//is there another query that will be used with this source
@@ -188,12 +197,6 @@
return null;
}
- //raise only if there is no intervening project into
- PlanNode parentProject = NodeEditor.findParent(parentNode, NodeConstants.Types.PROJECT);
- if (parentProject.getProperty(NodeConstants.Info.INTO_GROUP) != null) {
- return null;
- }
-
//switch to inline view and change the group on the access to that of the source
parentNode.setProperty(NodeConstants.Info.INLINE_VIEW, Boolean.TRUE);
accessNode.getGroups().clear();
Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/relational/ProjectIntoNode.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/relational/ProjectIntoNode.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/relational/ProjectIntoNode.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -35,12 +35,12 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.buffer.TupleSource;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Insert;
import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.sql.symbol.Reference;
public class ProjectIntoNode extends RelationalNode {
@@ -115,7 +115,7 @@
currentBatch = getChildren()[0].nextBatch(); // can throw BlockedException
this.batchRow = currentBatch.getBeginRow();
- if(currentBatch.getRowCount() == 0 && !this.intoGroup.isImplicitTempGroupSymbol()) {
+ if(currentBatch.getRowCount() == 0) {
continue;
}
} else if (currentBatch.getTerminationFlag() && this.batchRow > currentBatch.getEndRow()) {
@@ -126,15 +126,22 @@
int batchSize = currentBatch.getRowCount();
if (doBulkInsert) {
+ //convert to multivalued parameter
+ List<Constant> parameters = new ArrayList<Constant>(intoElements.size());
+ for (int i = 0; i < intoElements.size(); i++) {
+ Constant value = new Constant(null, ((ElementSymbol)intoElements.get(i)).getType());
+ value.setMultiValued(new ArrayList<Object>(currentBatch.getAllTuples().length));
+ parameters.add(value);
+ }
+ for (List row : currentBatch.getAllTuples()) {
+ for (int i = 0; i < row.size(); i++) {
+ ((List<Object>)parameters.get(i).getValue()).add(row.get(i));
+ }
+ }
// Create a bulk insert command batching all rows in the current batch.
- BulkInsert insert = new BulkInsert(intoGroup, intoElements);
-
- List rows = Arrays.asList(currentBatch.getAllTuples());
- insert.setRows(rows);
-
+ Insert insert = new Insert(intoGroup, intoElements, parameters);
// Register insert command against source
registerRequest(insert);
-
} else if (doBatching) {
// Register batched update command against source
int endRow = currentBatch.getEndRow();
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/LanguageVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/LanguageVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/LanguageVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -60,7 +60,6 @@
public void visit(Insert obj) {
visit((ProcedureContainer)obj);
}
- public void visit(BulkInsert obj) {}
public void visit(IsNullCriteria obj) {}
public void visit(JoinPredicate obj) {}
public void visit(JoinType obj) {}
Deleted: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/BulkInsert.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/BulkInsert.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/BulkInsert.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.query.sql.lang;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.core.util.EquivalenceUtil;
-import com.metamatrix.query.metadata.QueryMetadataInterface;
-import com.metamatrix.query.sql.LanguageVisitor;
-import com.metamatrix.query.sql.symbol.ElementSymbol;
-import com.metamatrix.query.sql.symbol.Expression;
-import com.metamatrix.query.sql.symbol.GroupSymbol;
-
-/**
- * Bulk insert is variation of Insert command, where a single table is being
- * inserted with multiple values. The purpose of this class from Insert is to
- * minimize the memory footprint and avoid multiple planning and performace.
- */
-public class BulkInsert extends Insert {
- private List rowValues = null;
-
- /**
- * Default ctor
- * @param group - Group Name
- * @param variables - Column Names
- */
- public BulkInsert(GroupSymbol group, List variables, List rows){
- super(group,variables, null);
- this.rowValues = rows;
- }
-
- /**
- * Default ctor
- * @param group - Group Name
- * @param variables - Column Names
- */
- public BulkInsert(GroupSymbol group, List variables){
- super(group,variables, null);
- }
-
- /**
- * Get the list of rows of column values.
- * @return List(row)-->list of column values; never null
- */
- public List getRows() {
- if (rowValues == null) {
- return Collections.EMPTY_LIST;
- }
- return rowValues;
-
- }
-
- /**
- * Get the list of rows of column values.
- * (row)-->list of column values
- */
- public void setRows(List rows) {
- rowValues = rows;
- }
-
- /**
- * @see com.metamatrix.query.sql.lang.Insert#addValue(com.metamatrix.query.sql.symbol.Expression)
- */
- public void addValue(Expression value) {
- throw new UnsupportedOperationException("This operation not allowed in BulkInsert"); //$NON-NLS-1$
- }
- /**
- * @see com.metamatrix.query.sql.lang.Insert#getValues()
- */
- public List getValues() {
- throw new UnsupportedOperationException("This operation not allowed in BulkInsert"); //$NON-NLS-1$
- }
- /**
- * @see com.metamatrix.query.sql.lang.Insert#setValues(java.util.List)
- */
- public void setValues(List values) {
- throw new UnsupportedOperationException("This operation not allowed in BulkInsert"); //$NON-NLS-1$
- }
-
- /**
- * @see java.lang.Object#clone()
- */
- public Object clone() {
- GroupSymbol group = getGroup();
- GroupSymbol copyGroup = null;
- if(group != null) {
- copyGroup = (GroupSymbol) group.clone();
- }
-
- List copyVars = null;
- if(getVariables() != null) {
- copyVars = new ArrayList(getVariables().size());
- Iterator iter = getVariables().iterator();
- while(iter.hasNext()) {
- ElementSymbol element = (ElementSymbol) iter.next();
- copyVars.add( element.clone() );
- }
- }
-
- // now make a new copy of the original
- BulkInsert copy = new BulkInsert(copyGroup, copyVars);
- copy.rowValues = getRows();
- copyMetadataState(copy);
- return copy;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- // Quick same object test
- if(this == obj) {
- return true;
- }
-
- // Quick fail tests
- if(!(obj instanceof BulkInsert)) {
- return false;
- }
-
- BulkInsert other = (BulkInsert) obj;
-
- return EquivalenceUtil.areEqual(getGroup(), other.getGroup()) &&
- EquivalenceUtil.areEqual(getVariables(), other.getVariables()) &&
- EquivalenceUtil.areEqual(getRows(), other.getRows());
- }
-
- public void acceptVisitor(LanguageVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * @see com.metamatrix.query.sql.lang.PreparedBatchUpdate#updatingModelCount(com.metamatrix.query.metadata.QueryMetadataInterface)
- */
- public int updatingModelCount(QueryMetadataInterface metadata) throws MetaMatrixComponentException {
- return 2; // return 2 since we may be multibatch
- }
-}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Insert.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Insert.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Insert.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -33,6 +33,7 @@
import com.metamatrix.core.util.HashCodeUtil;
import com.metamatrix.query.sql.LanguageVisitor;
import com.metamatrix.query.sql.ProcedureReservedWords;
+import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
@@ -104,6 +105,16 @@
public void setGroup(GroupSymbol group) {
this.group = group;
}
+
+ public boolean isBulk() {
+ if (this.values == null) {
+ return false;
+ }
+ if (!(this.values.get(0) instanceof Constant)) {
+ return false;
+ }
+ return ((Constant)this.values.get(0)).isMultiValued();
+ }
/**
* Return an ordered List of variables, may be null if no columns were specified
@@ -260,6 +271,9 @@
}
Insert copy = new Insert(copyGroup, copyVars, copyVals);
+ if (this.queryExpression != null) {
+ copy.setQueryExpression((QueryCommand)this.queryExpression.clone());
+ }
this.copyMetadataState(copy);
return copy;
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/navigator/PreOrPostOrderNavigator.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/navigator/PreOrPostOrderNavigator.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/navigator/PreOrPostOrderNavigator.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -29,7 +29,6 @@
import com.metamatrix.query.sql.LanguageVisitor;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
import com.metamatrix.query.sql.lang.BetweenCriteria;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.CompoundCriteria;
import com.metamatrix.query.sql.lang.Create;
@@ -300,15 +299,6 @@
visitNode(obj.getTable());
postVisitVisitor(obj);
}
- public void visit(BulkInsert obj) {
- preVisitVisitor(obj);
- visitNode(obj.getGroup());
- visitNodes(obj.getVariables());
- // No values neeed to be traversed for this.
- // visitNodes(obj.getValues());
- visitNode(obj.getOption());
- postVisitVisitor(obj);
- }
public void visit(Into obj) {
preVisitVisitor(obj);
visitNode(obj.getGroup());
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/symbol/Constant.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,6 +22,8 @@
package com.metamatrix.query.sql.symbol;
+import java.util.List;
+
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.query.QueryPlugin;
import com.metamatrix.query.sql.LanguageVisitor;
@@ -34,10 +36,11 @@
* value, but that is not true if the value is null. In that case, the type is unknown
* and is set to the null type until the type is resolved at a later point.
*/
-public class Constant implements Expression, Comparable {
+public class Constant implements Expression {
private Object value;
private Class type;
+ private boolean multiValued;
/**
* Construct a typed constant. The specified value is not verified to be a value
@@ -103,11 +106,20 @@
public boolean isResolved() {
return true;
}
+
+ public void setMultiValued(List<?> value) {
+ this.multiValued = true;
+ this.value = value;
+ }
+
+ public boolean isMultiValued() {
+ return multiValued;
+ }
public void acceptVisitor(LanguageVisitor visitor) {
visitor.visit(this);
}
-
+
/**
* Compare this constant to another constant for equality.
* @param obj Other object
@@ -155,7 +167,9 @@
* @return Shallow copy of object
*/
public Object clone() {
- return new Constant(getValue(), getType());
+ Constant copy = new Constant(getValue(), getType());
+ copy.multiValued = multiValued;
+ return copy;
}
/**
@@ -165,26 +179,5 @@
public String toString() {
return SQLStringVisitor.getSQLString(this);
}
-
- /**
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- * @since 4.2
- */
- public int compareTo(Object o) throws ClassCastException {
- if(o instanceof Constant) {
- Constant compare = (Constant)o;
- if(this.type.equals(compare.type)) {
- if(compare.value == null) {
- return 1;
- } else if(this.value == null) {
- return -1;
- } else if(compare.value instanceof Comparable) {
- return ((Comparable)this.value).compareTo(compare.value);
- }
- }
- }
- throw new ClassCastException();
- }
-
-
+
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluatableVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -39,6 +39,7 @@
import com.metamatrix.query.sql.lang.SubquerySetCriteria;
import com.metamatrix.query.sql.navigator.PreOrderNavigator;
import com.metamatrix.query.sql.symbol.AggregateSymbol;
+import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.ExpressionSymbol;
import com.metamatrix.query.sql.symbol.Function;
@@ -73,6 +74,13 @@
}
}
+ @Override
+ public void visit(Constant obj) {
+ if (obj.isMultiValued()) {
+ evaluationNotPossible(EvaluationLevel.PUSH_DOWN);
+ }
+ }
+
private void setDeterminismLevel(int value) {
determinismLevel = Math.max(determinismLevel, value);
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/EvaluateExpressionVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -83,12 +83,12 @@
try {
value = new Evaluator(Collections.emptyMap(), dataMgr, context).evaluate(expr, Collections.emptyList());
} catch (MetaMatrixException err) {
- if (expr instanceof Reference) {
- return expr;
- }
throw new MetaMatrixRuntimeException(err);
}
- return new Constant(value, expr.getType());
+ if (value instanceof Constant) {
+ return (Constant)value; //multi valued substitution
+ }
+ return new Constant(value, expr.getType());
}
/**
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/SQLStringVisitor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/SQLStringVisitor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -36,7 +36,6 @@
import com.metamatrix.query.sql.LanguageVisitor;
import com.metamatrix.query.sql.ReservedWords;
import com.metamatrix.query.sql.lang.BetweenCriteria;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.CompoundCriteria;
import com.metamatrix.query.sql.lang.Create;
@@ -468,26 +467,6 @@
}
}
- public void visit(BulkInsert obj) {
- formatBasicInsert(obj);
- int varCount = obj.getVariables().size();
- parts.add(ReservedWords.VALUES);
- parts.add(" ("); //$NON-NLS-1$
- for (int i=0; i<varCount; i++) {
- parts.add("?"); //$NON-NLS-1$
- if (i < varCount-1) {
- parts.add(","); //$NON-NLS-1$
- }
- }
- parts.add(")"); //$NON-NLS-1$
-
- // Option clause
- if(obj.getOption() != null) {
- parts.add(SPACE);
- parts.add(registerNode(obj.getOption()));
- }
- }
-
public void visit(IsNullCriteria obj) {
Expression expr = obj.getExpression();
Object exprPart = registerNode(expr);
@@ -1153,8 +1132,9 @@
public void visit(Constant obj) {
Object[] constantParts = null;
-
- if(obj.isNull()) {
+ if (obj.isMultiValued()) {
+ constantParts = new Object[] {"?"}; //$NON-NLS-1$
+ } else if(obj.isNull()) {
constantParts = new Object[] {"null"}; //$NON-NLS-1$
} else {
try {
Modified: trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/com/metamatrix/query/tempdata/TempTableStoreImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -48,12 +48,12 @@
import com.metamatrix.query.metadata.TempMetadataStore;
import com.metamatrix.query.processor.proc.UpdateCountTupleSource;
import com.metamatrix.query.resolver.util.ResolverUtil;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Create;
import com.metamatrix.query.sql.lang.Drop;
import com.metamatrix.query.sql.lang.Insert;
import com.metamatrix.query.sql.lang.Query;
+import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
@@ -178,7 +178,7 @@
return new UpdateCountTupleSource(0);
}
}
- throw new AssertionError("unhandled temp table reqest");
+ throw new AssertionError("unhandled temp table reqest"); //$NON-NLS-1$
}
public void removeTempTables() throws MetaMatrixComponentException{
@@ -225,8 +225,8 @@
TupleBatch tupleBatch;
List elements = ResolverUtil.resolveElementsInGroup(group, new TempMetadataAdapter(null, tempMetadataStore));
- if ( insert instanceof BulkInsert ) {
- List tuples = ((BulkInsert)insert).getRows();
+ if ( insert.isBulk() ) {
+ List<List<Object>> tuples = getBulkRows(insert);
tuplesAdded = tuples.size();
@@ -261,6 +261,23 @@
return new UpdateCountTupleSource(tuplesAdded);
}
+
+ public static List<List<Object>> getBulkRows(Insert insert) {
+ Constant c = (Constant)insert.getValues().get(0);
+ int bulkRowCount = ((List<?>)c.getValue()).size();
+
+ List<List<Object>> tuples = new ArrayList<List<Object>>(bulkRowCount);
+
+ for (int row = 0; row < bulkRowCount; row++) {
+ List<Object> currentRow = new ArrayList<Object>(insert.getValues().size());
+ for (int i = 0; i < insert.getValues().size(); i++) {
+ Constant multiValue = (Constant)insert.getValues().get(i);
+ currentRow.add(((List<?>)multiValue.getValue()).get(row));
+ }
+ tuples.add(currentRow);
+ }
+ return tuples;
+ }
public boolean hasTempTable(Command command){
switch (command.getType()) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -83,7 +83,7 @@
tgtCaps.setCapabilitySupport(Capability.QUERY_INTERSECT, srcCaps.supportsIntersect());
tgtCaps.setCapabilitySupport(Capability.QUERY_EXCEPT, srcCaps.supportsExcept());
tgtCaps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, srcCaps.supportsSetQueryOrderBy());
- tgtCaps.setCapabilitySupport(Capability.BULK_INSERT , srcCaps.supportsBulkInsert());
+ tgtCaps.setCapabilitySupport(Capability.BULK_UPDATE , srcCaps.supportsBulkUpdate());
tgtCaps.setCapabilitySupport(Capability.BATCHED_UPDATES, srcCaps.supportsBatchedUpdates());
tgtCaps.setCapabilitySupport(Capability.QUERY_FUNCTIONS_IN_GROUP_BY, srcCaps.supportsFunctionsInGroupBy());
tgtCaps.setCapabilitySupport(Capability.ROW_LIMIT, srcCaps.supportsRowLimit());
@@ -92,6 +92,7 @@
tgtCaps.setCapabilitySupport(Capability.REQUIRES_CRITERIA, srcCaps.requiresCriteria());
tgtCaps.setCapabilitySupport(Capability.QUERY_GROUP_BY, srcCaps.supportsGroupBy());
tgtCaps.setCapabilitySupport(Capability.QUERY_HAVING, srcCaps.supportsHaving());
+ tgtCaps.setCapabilitySupport(Capability.INSERT_WITH_QUERYEXPRESSION, srcCaps.supportsInsertWithQueryExpression());
List functions = srcCaps.getSupportedFunctions();
if(functions != null && functions.size() > 0) {
Deleted: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/BulkInsertImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/BulkInsertImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/BulkInsertImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.dqp.internal.datamgr.language;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.teiid.connector.language.IBulkInsert;
-import org.teiid.connector.language.IGroup;
-import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
-
-
-
-/**
- * A simple variation of insert where multiple rows can be inserted as single
- * operation.
- */
-public class BulkInsertImpl extends InsertImpl implements IBulkInsert {
- List rowValues = null;
-
- public BulkInsertImpl(IGroup group, List elements) {
- super(group, elements, null);
- }
-
- public BulkInsertImpl(IGroup group, List elements, List rows) {
- super(group, elements, null);
- this.rowValues = rows;
- }
-
- /**
- * @see org.teiid.connector.language.IBulkInsert#getRows()
- */
- public List getRows() {
- if (rowValues == null) {
- return Collections.EMPTY_LIST;
- }
- return rowValues;
- }
-
- /**
- * Set the list of row values for this bulk insert
- * @return list; never null
- */
- public void setRows(List rows) {
- rowValues = rows;
- }
-
- /**
- * @see org.teiid.connector.language.IInsert#getValues()
- */
- public List getValues() {
- throw new UnsupportedOperationException("This operation is not supported"); //$NON-NLS-1$
- }
- /**
- * @see org.teiid.connector.language.IInsert#setValues(java.util.List)
- */
- public void setValues(List values) {
- throw new UnsupportedOperationException("This operation is not supported"); //$NON-NLS-1$
- }
-
- /**
- * @see org.teiid.connector.language.ILanguageObject#acceptVisitor(com.metamatrix.data.visitor.LanguageObjectVisitor)
- */
- public void acceptVisitor(LanguageObjectVisitor visitor) {
- visitor.visit(this);
- }
-}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -26,19 +26,20 @@
import org.teiid.connector.language.IGroup;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertValueSource;
import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
public class InsertImpl extends BaseLanguageObject implements IInsert {
- private IGroup group = null;
- private List elements = null;
- private List values = null;
+ private IGroup group;
+ private List elements;
+ private IInsertValueSource valueSource;
- public InsertImpl(IGroup group, List elements, List values) {
+ public InsertImpl(IGroup group, List elements, IInsertValueSource valueSource) {
this.group = group;
this.elements = elements;
- this.values = values;
+ this.valueSource = valueSource;
}
/**
* @see org.teiid.connector.language.IInsert#getGroup()
@@ -55,10 +56,10 @@
}
/**
- * @see org.teiid.connector.language.IInsert#getValues()
+ * @see org.teiid.connector.language.IInsert#getValueSource()
*/
- public List getValues() {
- return values;
+ public IInsertValueSource getValueSource() {
+ return valueSource;
}
/**
@@ -79,11 +80,10 @@
public void setElements(List elements) {
this.elements = elements;
}
- /*
- * @see com.metamatrix.data.language.IInsert#setValues(java.util.List)
- */
- public void setValues(List values) {
- this.values = values;
+
+ @Override
+ public void setValueSource(IInsertValueSource values) {
+ this.valueSource = values;
}
}
Added: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertValueExpressionsImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertValueExpressionsImpl.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertValueExpressionsImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -0,0 +1,27 @@
+package org.teiid.dqp.internal.datamgr.language;
+
+import java.util.List;
+
+import org.teiid.connector.language.IExpression;
+import org.teiid.connector.language.IInsertExpressionValueSource;
+import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
+
+public class InsertValueExpressionsImpl extends BaseLanguageObject implements IInsertExpressionValueSource {
+
+ private List<IExpression> values;
+
+ public InsertValueExpressionsImpl(List<IExpression> values) {
+ this.values = values;
+ }
+
+ @Override
+ public List<IExpression> getValues() {
+ return values;
+ }
+
+ @Override
+ public void acceptVisitor(LanguageObjectVisitor visitor) {
+ visitor.visit(this);
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/InsertValueExpressionsImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -44,6 +44,7 @@
import org.teiid.connector.language.IGroupBy;
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.IJoin;
import org.teiid.connector.language.ILikeCriteria;
@@ -79,7 +80,6 @@
import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.metadata.TempMetadataID;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.CompoundCriteria;
@@ -119,7 +119,6 @@
import com.metamatrix.query.sql.symbol.ExpressionSymbol;
import com.metamatrix.query.sql.symbol.Function;
import com.metamatrix.query.sql.symbol.GroupSymbol;
-import com.metamatrix.query.sql.symbol.Reference;
import com.metamatrix.query.sql.symbol.ScalarSubquery;
import com.metamatrix.query.sql.symbol.SearchedCaseExpression;
import com.metamatrix.query.sql.symbol.SingleElementSymbol;
@@ -468,8 +467,6 @@
return translate((Constant)expr);
} else if (expr instanceof Function) {
return translate((Function)expr);
- } else if (expr instanceof Reference) {
- return translate((Reference)expr);
} else if (expr instanceof ScalarSubquery) {
return translate((ScalarSubquery)expr);
} else if (expr instanceof SearchedCaseExpression) {
@@ -481,7 +478,10 @@
}
ILiteral translate(Constant constant) {
- return new LiteralImpl(constant.getValue(), constant.getType());
+ LiteralImpl result = new LiteralImpl(constant.getValue(), constant.getType());
+ result.setBindValue(constant.isMultiValued());
+ result.setMultiValued(constant.isMultiValued());
+ return result;
}
IFunction translate(Function function) throws MetaMatrixComponentException {
@@ -495,10 +495,6 @@
return new FunctionImpl(function.getName(), params, function.getType());
}
- IExpression translate(Reference ref) throws MetaMatrixComponentException {
- return translate(ref.getExpression());
- }
-
ISearchedCaseExpression translate(SearchedCaseExpression expr) throws MetaMatrixComponentException {
ArrayList whens = new ArrayList(), thens = new ArrayList();
for (int i = 0; i < expr.getWhenCount(); i++) {
@@ -570,32 +566,31 @@
translatedElements.add(translate((ElementSymbol)i.next()));
}
- // If the insert is bulk insert then translate the multiple values
- if (insert instanceof BulkInsert) {
- BulkInsert bulkInsert = (BulkInsert)insert;
- BulkInsertImpl translatedBulkInsert =
- new BulkInsertImpl(translate(insert.getGroup()),translatedElements);
- List rows = bulkInsert.getRows();
- translatedBulkInsert.setRows(rows);
- return translatedBulkInsert;
+ IInsertValueSource valueSource = null;
+ if (insert.getQueryExpression() != null) {
+ valueSource = translate(insert.getQueryExpression());
+ } else {
+ // This is for the simple one row insert.
+ List values = insert.getValues();
+ List translatedValues = new ArrayList();
+ for (Iterator i = values.iterator(); i.hasNext();) {
+ translatedValues.add(translate((Expression)i.next()));
+ }
+ valueSource = new InsertValueExpressionsImpl(translatedValues);
}
- // This is for the simple one row insert.
- List values = insert.getValues();
- List translatedValues = new ArrayList();
- for (Iterator i = values.iterator(); i.hasNext();) {
- translatedValues.add(translate((Expression)i.next()));
- }
- return new InsertImpl(translate(insert.getGroup()),
+ InsertImpl result = new InsertImpl(translate(insert.getGroup()),
translatedElements,
- translatedValues);
+ valueSource);
+ return result;
}
/* Update */
IUpdate translate(Update update) throws MetaMatrixComponentException {
- return new UpdateImpl(translate(update.getGroup()),
+ UpdateImpl updateImpl = new UpdateImpl(translate(update.getGroup()),
translate(update.getChangeList()),
translate(update.getCriteria()));
+ return updateImpl;
}
ISetClauseList translate(SetClauseList setClauseList) throws MetaMatrixComponentException {
@@ -612,8 +607,9 @@
/* Delete */
IDelete translate(Delete delete) throws MetaMatrixComponentException {
- return new DeleteImpl(translate(delete.getGroup()),
+ DeleteImpl deleteImpl = new DeleteImpl(translate(delete.getGroup()),
translate(delete.getCriteria()));
+ return deleteImpl;
}
/* Execute */
@@ -636,7 +632,7 @@
return new ProcedureImpl(sp.getProcedureName(), translatedParameters, proc);
}
- IParameter translate(SPParameter param, Procedure parent) throws MetaMatrixComponentException {
+ IParameter translate(SPParameter param, Procedure parent) {
Direction direction = Direction.IN;
switch(param.getParameterType()) {
case ParameterInfo.IN:
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageFactoryImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageFactoryImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageFactoryImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -26,7 +26,6 @@
import java.util.List;
import org.teiid.connector.language.IAggregate;
-import org.teiid.connector.language.IBulkInsert;
import org.teiid.connector.language.ICompareCriteria;
import org.teiid.connector.language.ICompoundCriteria;
import org.teiid.connector.language.ICriteria;
@@ -42,6 +41,8 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.IInlineView;
import org.teiid.connector.language.IInsert;
+import org.teiid.connector.language.IInsertExpressionValueSource;
+import org.teiid.connector.language.IInsertValueSource;
import org.teiid.connector.language.IIsNullCriteria;
import org.teiid.connector.language.IJoin;
import org.teiid.connector.language.ILanguageFactory;
@@ -136,14 +137,15 @@
@Override
public IFunction createFunction(String functionName, IExpression[] args,
- Class type) {
+ Class<?> type) {
return new FunctionImpl(functionName, Arrays.asList(args), type);
}
/*
* @see com.metamatrix.data.language.ILanguageFactory#createFunction(java.lang.String, com.metamatrix.data.language.IExpression[], java.lang.Class)
*/
- public IFunction createFunction(String functionName, List<? extends IExpression> args, Class type) {
+ @Override
+ public IFunction createFunction(String functionName, List<? extends IExpression> args, Class<?> type) {
return new FunctionImpl(functionName, args, type);
}
@@ -167,19 +169,17 @@
public IInCriteria createInCriteria(IExpression leftExpression, List rightExpressions, boolean isNegated) {
return new InCriteriaImpl(leftExpression, rightExpressions, isNegated);
}
-
- /*
- * @see com.metamatrix.data.language.ILanguageFactory#createInsert(com.metamatrix.data.language.IGroup, java.util.List, java.util.List)
- */
- public IInsert createInsert(IGroup group, List columns, List values) {
- return new InsertImpl(group, columns, values);
+
+ @Override
+ public IInsert createInsert(IGroup group, List<IElement> columns,
+ IInsertValueSource valueSource) {
+ return new InsertImpl(group, columns, valueSource);
}
-
- /**
- * @see org.teiid.connector.language.ILanguageFactory#createBulkInsert(org.teiid.connector.language.IGroup, java.util.List, java.util.List)
- */
- public IBulkInsert createBulkInsert(IGroup group, List columns, List rows) {
- return new BulkInsertImpl(group, columns, rows);
+
+ @Override
+ public IInsertExpressionValueSource createInsertExpressionValueSource(
+ List<IExpression> values) {
+ return new InsertValueExpressionsImpl(values);
}
/*
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LiteralImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LiteralImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LiteralImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -27,11 +27,12 @@
public class LiteralImpl extends BaseLanguageObject implements ILiteral {
- Object value;
- Class type;
- private boolean bindValue = false;
+ private Object value;
+ private Class<?> type;
+ private boolean bindValue;
+ private boolean multiValued;
- public LiteralImpl(Object value, Class type) {
+ public LiteralImpl(Object value, Class<?> type) {
this.value = value;
this.type = type;
}
@@ -53,7 +54,7 @@
/*
* @see com.metamatrix.data.language.ILiteral#getType()
*/
- public Class getType() {
+ public Class<?> getType() {
return this.type;
}
@@ -64,13 +65,6 @@
this.value = value;
}
- /*
- * @see com.metamatrix.data.language.ILiteral#setType(java.lang.Class)
- */
- public void setType(Class type) {
- this.type = type;
- }
-
/**
* @see org.teiid.connector.language.ILiteral#isBindValue()
*/
@@ -85,4 +79,19 @@
this.bindValue = bindValue;
}
+ @Override
+ public boolean isMultiValued() {
+ return multiValued;
+ }
+
+ @Override
+ public void setMultiValued(boolean multiValued) {
+ this.multiValued = multiValued;
+ }
+
+ @Override
+ public void setType(Class<?> type) {
+ this.type = type;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/ProcedureImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/ProcedureImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/ProcedureImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,7 +22,6 @@
package org.teiid.dqp.internal.datamgr.language;
-import java.util.Iterator;
import java.util.List;
import org.teiid.connector.api.ConnectorException;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -27,7 +27,7 @@
import org.teiid.connector.language.ISetClause;
import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
-public class SetClauseImpl implements ISetClause {
+public class SetClauseImpl extends BaseLanguageObject implements ISetClause {
private IElement symbol;
private IExpression value;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseListImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseListImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/SetClauseListImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -30,7 +30,7 @@
import org.teiid.connector.visitor.framework.LanguageObjectVisitor;
-public class SetClauseListImpl implements ISetClauseList {
+public class SetClauseListImpl extends BaseLanguageObject implements ISetClauseList {
private List<ISetClause> clauses;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,6 +22,7 @@
package org.teiid.dqp.internal.process;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -193,29 +194,38 @@
*/
private void handlePreparedBatchUpdate() throws QueryMetadataException,
MetaMatrixComponentException, QueryResolverException, QueryPlannerException, QueryValidatorException {
- ProcessorPlan plan = this.processPlan;
List<List<?>> paramValues = requestMsg.getParameterValues();
if (paramValues.isEmpty()) {
throw new QueryValidatorException("No batch values sent for prepared batch update"); //$NON-NLS-1$
}
boolean supportPreparedBatchUpdate = false;
- if (plan instanceof RelationalPlan) {
- RelationalPlan rPlan = (RelationalPlan)plan;
+ if (this.processPlan instanceof RelationalPlan && this.prepPlan.getRewritenCommand().getSubCommands().isEmpty()) {
+ RelationalPlan rPlan = (RelationalPlan)this.processPlan;
if (rPlan.getRootNode() instanceof AccessNode) {
AccessNode aNode = (AccessNode)rPlan.getRootNode();
- String modelName = aNode.getModelName();
+ String modelName = aNode.getModelName();
SourceCapabilities caps = capabilitiesFinder.findCapabilities(modelName);
- supportPreparedBatchUpdate = caps.supportsCapability(SourceCapabilities.Capability.PREPARED_BATCH_UPDATE);
+ supportPreparedBatchUpdate = caps.supportsCapability(SourceCapabilities.Capability.BULK_UPDATE);
}
}
CommandTreeNode ctn = new CommandTreeNode();
List<Command> commands = new LinkedList<Command>();
List<VariableContext> contexts = new LinkedList<VariableContext>();
+ List<List<Object>> multiValues = new ArrayList<List<Object>>(this.prepPlan.getReferences().size());
for (List<?> values : paramValues) {
resolveAndValidateParameters(this.userCommand, this.prepPlan.getReferences(), values);
contexts.add(this.context.getVariableContext());
if(supportPreparedBatchUpdate){
- continue; // -- TODO make this work
+ if (multiValues.isEmpty()) {
+ for (int i = 0; i < values.size(); i++) {
+ multiValues.add(new ArrayList<Object>(paramValues.size()));
+ }
+ }
+ for (int i = 0; i < values.size(); i++) {
+ List<Object> multiValue = multiValues.get(i);
+ multiValue.add(values.get(i));
+ }
+ continue;
}
Command c = (Command)this.prepPlan.getRewritenCommand().clone();
commands.add(c);
@@ -229,10 +239,19 @@
this.context.setVariableContext(new VariableContext());
}
- if (supportPreparedBatchUpdate || paramValues.size() == 1) {
- return; // just use the existing plan
+ if (paramValues.size() == 1) {
+ return; // just use the existing plan, and global reference evaluation
}
+ if (supportPreparedBatchUpdate) {
+ for (int i = 0; i < this.prepPlan.getReferences().size(); i++) {
+ Constant c = new Constant(null, this.prepPlan.getReferences().get(i).getType());
+ c.setMultiValued(multiValues.get(i));
+ this.context.getVariableContext().setGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol(), c);
+ }
+ return;
+ }
+
BatchedUpdateCommand buc = new BatchedUpdateCommand(commands);
ctn.setCommand(buc);
ctn.setProperty(RelationalPlanner.VARIABLE_CONTEXTS, contexts);
Added: trunk/engine/src/test/java/com/metamatrix/query/processor/TestInsertProcessing.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestInsertProcessing.java (rev 0)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestInsertProcessing.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -0,0 +1,396 @@
+package com.metamatrix.query.processor;
+
+import static com.metamatrix.query.processor.TestProcessor.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+import com.metamatrix.common.types.DataTypeManager;
+import com.metamatrix.query.optimizer.TestOptimizer;
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
+import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
+import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
+import com.metamatrix.query.sql.lang.Command;
+import com.metamatrix.query.sql.lang.Insert;
+import com.metamatrix.query.sql.symbol.Constant;
+import com.metamatrix.query.unittest.FakeMetadataFacade;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
+import com.metamatrix.query.unittest.FakeMetadataObject;
+import com.metamatrix.query.unittest.FakeMetadataStore;
+
+public class TestInsertProcessing {
+
+ @Test public void testSelectIntoWithTypeConversion() {
+ FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
+ FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.BATCHED_UPDATES, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
+ new String[] { "e1", "e2", "e3" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.FLOAT});
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(pm1);
+ store.addObject(pm1g1);
+ store.addObjects(pm1g1e);
+
+ FakeMetadataFacade metadata = new FakeMetadataFacade(store);
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("BatchedUpdate{I}", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1) })});
+
+ String sql = "SELECT 1, 1, 1 INTO pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ BatchedUpdateCommand buc = (BatchedUpdateCommand)dataManager.getCommandHistory().iterator().next();
+ Insert insert = (Insert)buc.getUpdateCommands().get(0);
+
+ Constant value0 = (Constant)insert.getValues().get(0);
+ Constant value1 = (Constant)insert.getValues().get(1);
+
+ assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getValue().getClass());
+ assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getValue().getClass());
+ }
+
+
+ @Test public void testSelectInto_Case5569a_BATCH_NO_BULK_NO() {
+ boolean doBatching = false;
+ boolean doBulkInsert = false;
+ helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
+ }
+
+ @Test public void testSelectInto_Case5569b_BATCH_YES_BULK_NO() {
+ boolean doBatching = true;
+ boolean doBulkInsert = false;
+ helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
+ }
+
+ @Test public void testSelectInto_Case5569c_BATCH_NO_BULK_YES() {
+ boolean doBatching = false;
+ boolean doBulkInsert = true;
+ helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
+ }
+
+ public void helpSelectInto_Case5569Processor( boolean doBatching, boolean doBulkInsert ) {
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+
+ caps.setCapabilitySupport(Capability.BATCHED_UPDATES, doBatching);
+ caps.setCapabilitySupport(Capability.BULK_UPDATE, doBulkInsert);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+
+ dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
+
+ if (doBulkInsert) {
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?, ?, ?, ?)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ }
+ else
+ if (doBatching) {
+ dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ } else {
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ }
+
+ String sql = "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 INTO pm1.g2 from pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ // if not doBulkInsert and is doBatching,
+ // check the command hist to ensure it contains the expected commands
+ if ( !doBulkInsert && doBatching ) {
+ BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
+ assertEquals(2, bu.getUpdateCommands().size());
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
+ }
+ }
+
+
+ @Test public void testSelectInto_Case5412a() {
+
+ // test setting BULK_INSERT capability to true
+ FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
+ FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+
+ caps.setCapabilitySupport(Capability.BULK_UPDATE, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
+ new String[] { "e1", "e2" }, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT});
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(pm1);
+ store.addObject(pm1g1);
+ store.addObjects(pm1g1e);
+
+ FakeMetadataFacade metadata = new FakeMetadataFacade(store);
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2) VALUES (?, ?)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1) })});
+
+ String sql = "SELECT 1, 1 INTO pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ Insert insert = (Insert)dataManager.getCommandHistory().iterator().next();
+ //List lst = (List)insert.getParameterValues().get(0);
+ //Object value0 = lst.get(0);
+ //Object value1 = lst.get(1);
+
+ //assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getClass());
+ //assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getClass());
+ }
+
+
+ @Test public void testSelectInto_Case5412b() {
+
+ // test setting BULK_INSERT capability to false
+ FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
+ FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+
+ caps.setCapabilitySupport(Capability.BULK_UPDATE, false);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
+ new String[] { "e1", "e2" }, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT});
+
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(pm1);
+ store.addObject(pm1g1);
+ store.addObjects(pm1g1e);
+
+ FakeMetadataFacade metadata = new FakeMetadataFacade(store);
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2) VALUES (1, 1.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1) })});
+
+ String sql = "SELECT 1, 1 INTO pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(1) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ Insert insert = (Insert)dataManager.getCommandHistory().iterator().next();
+
+ Constant value0 = (Constant)insert.getValues().get(0);
+ Constant value1 = (Constant)insert.getValues().get(1);
+
+ assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getValue().getClass());
+ assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getValue().getClass());
+ }
+
+ @Test public void testInsertIntoWithSubquery_None() {
+ helpInsertIntoWithSubquery( null );
+ }
+
+ @Test public void testInsertIntoWithSubquery_Batch() {
+ helpInsertIntoWithSubquery( Capability.BATCHED_UPDATES );
+ }
+
+ @Test public void testInsertIntoWithSubquery_Bulk() {
+ helpInsertIntoWithSubquery( Capability.BULK_UPDATE );
+ }
+
+ @Test public void testInsertIntoWithSubquery_Pushdown() {
+ helpInsertIntoWithSubquery( Capability.INSERT_WITH_QUERYEXPRESSION );
+ }
+
+ public void helpInsertIntoWithSubquery( Capability cap ) {
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+
+ caps.setCapabilitySupport(cap, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+
+ dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
+
+ if (cap != null) {
+ switch (cap) {
+ case BULK_UPDATE:
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?, ?, ?, ?)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ break;
+ case BATCHED_UPDATES:
+ dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ break;
+ case INSERT_WITH_QUERYEXPRESSION:
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ break;
+ }
+ } else {
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ }
+
+ String sql = "INSERT INTO pm1.g2 SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(2) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ // if not doBulkInsert and is doBatching,
+ // check the command hist to ensure it contains the expected commands
+ if ( cap == Capability.BATCHED_UPDATES ) {
+ BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
+ assertEquals(2, bu.getUpdateCommands().size());
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
+ }
+ }
+
+ @Test public void testInsertIntoWithSubquery2_BATCH_NO_BULK_NO() {
+ boolean doBatching = false;
+ boolean doBulkInsert = false;
+ helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
+ }
+
+ @Test public void testInsertIntoWithSubquery2_BATCH_YES_BULK_NO() {
+ boolean doBatching = true;
+ boolean doBulkInsert = false;
+ helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
+ }
+
+ @Test public void testInsertIntoWithSubquery2_BATCH_NO_BULK_YES() {
+ boolean doBatching = false;
+ boolean doBulkInsert = true;
+ helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
+ }
+
+ public void helpInsertIntoWithSubquery2( boolean doBatching, boolean doBulkInsert ) {
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+
+ caps.setCapabilitySupport(Capability.BATCHED_UPDATES, doBatching);
+ caps.setCapabilitySupport(Capability.BULK_UPDATE, doBulkInsert);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
+
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1();
+
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+
+ dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
+ Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
+
+ if (doBulkInsert) {
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?, ?, ?, ?)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ }
+ else
+ if (doBatching) {
+ dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(2)})});
+ } else {
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
+ new List[] { Arrays.asList(new Object[] { new Integer(1)})});
+ }
+
+ String sql = "INSERT INTO pm1.g2 SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1 UNION ALL SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1"; //$NON-NLS-1$
+// String sql = "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 INTO pm1.g2 from pm1.g1"; //$NON-NLS-1$
+
+ Command command = helpParse(sql);
+
+ ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
+
+ List[] expected = new List[] {
+ Arrays.asList(new Object[] { new Integer(4) }),
+ };
+
+ helpProcess(plan, dataManager, expected);
+
+ // if not doBulkInsert and is doBatching,
+ // check the command hist to ensure it contains the expected commands
+ if ( !doBulkInsert && doBatching ) {
+ BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(2);
+ assertEquals(2, bu.getUpdateCommands().size());
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
+ assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
+ }
+ }
+
+}
Property changes on: trunk/engine/src/test/java/com/metamatrix/query/processor/TestInsertProcessing.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -75,7 +75,6 @@
import com.metamatrix.query.resolver.util.BindVariableVisitor;
import com.metamatrix.query.rewriter.QueryRewriter;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Insert;
import com.metamatrix.query.sql.lang.SPParameter;
@@ -241,7 +240,7 @@
}
}
- static void doProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults, CommandContext context) throws Exception {
+ public static void doProcess(ProcessorPlan plan, ProcessorDataManager dataManager, List[] expectedResults, CommandContext context) throws Exception {
BufferManagerImpl bufferMgr = (BufferManagerImpl)BufferManagerFactory.getStandaloneBufferManager();
bufferMgr.getConfig().setProcessorBatchSize(context.getProcessorBatchSize());
bufferMgr.getConfig().setConnectorBatchSize(context.getProcessorBatchSize());
@@ -6646,223 +6645,7 @@
Arrays.asList(new Object[] { new Integer(1), new Integer(1) })});
helpProcess(plan, dataManager, expected);
}
-
- public void testSelectIntoWithTypeConversion() {
- FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
- FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.BATCHED_UPDATES, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
- new String[] { "e1", "e2", "e3" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT, DataTypeManager.DefaultDataTypes.FLOAT});
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(pm1);
- store.addObject(pm1g1);
- store.addObjects(pm1g1e);
-
- FakeMetadataFacade metadata = new FakeMetadataFacade(store);
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("BatchedUpdate{I}", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1) })});
-
- String sql = "SELECT 1, 1, 1 INTO pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- BatchedUpdateCommand buc = (BatchedUpdateCommand)dataManager.getCommandHistory().iterator().next();
- Insert insert = (Insert)buc.getUpdateCommands().get(0);
-
- Constant value0 = (Constant)insert.getValues().get(0);
- Constant value1 = (Constant)insert.getValues().get(1);
-
- assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getValue().getClass());
- assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getValue().getClass());
- }
-
-
- public void testSelectInto_Case5569a_BATCH_NO_BULK_NO() {
- boolean doBatching = false;
- boolean doBulkInsert = false;
- helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
- }
-
- public void testSelectInto_Case5569b_BATCH_YES_BULK_NO() {
- boolean doBatching = true;
- boolean doBulkInsert = false;
- helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
- }
-
- public void testSelectInto_Case5569c_BATCH_NO_BULK_YES() {
- boolean doBatching = false;
- boolean doBulkInsert = true;
- helpSelectInto_Case5569Processor( doBatching, doBulkInsert );
- }
-
- public void helpSelectInto_Case5569Processor( boolean doBatching, boolean doBulkInsert ) {
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
-
- caps.setCapabilitySupport(Capability.BATCHED_UPDATES, doBatching);
- caps.setCapabilitySupport(Capability.BULK_INSERT, doBulkInsert);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
-
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1();
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
-
- dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
-
- if (doBulkInsert) {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?,?,?,?)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- }
- else
- if (doBatching) {
- dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- } else {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- }
-
- String sql = "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 INTO pm1.g2 from pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
-
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(2) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- // if not doBulkInsert and is doBatching,
- // check the command hist to ensure it contains the expected commands
- if ( !doBulkInsert && doBatching ) {
- BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
- assertEquals(2, bu.getUpdateCommands().size());
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
- }
- }
-
-
- public void testSelectInto_Case5412a() {
-
- // test setting BULK_INSERT capability to true
- FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
- FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
-
- caps.setCapabilitySupport(Capability.BULK_INSERT, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
- new String[] { "e1", "e2" }, //$NON-NLS-1$ //$NON-NLS-2$
- new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT});
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(pm1);
- store.addObject(pm1g1);
- store.addObjects(pm1g1e);
-
- FakeMetadataFacade metadata = new FakeMetadataFacade(store);
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2) VALUES (?,?)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1) })});
-
- String sql = "SELECT 1, 1 INTO pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- BulkInsert insert = (BulkInsert)dataManager.getCommandHistory().iterator().next();
- List lst = (List)insert.getRows().get(0);
- Object value0 = lst.get(0);
- Object value1 = lst.get(1);
-
- assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getClass());
- assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getClass());
- }
-
-
- public void testSelectInto_Case5412b() {
-
- // test setting BULK_INSERT capability to false
- FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
- FakeMetadataObject pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
-
- caps.setCapabilitySupport(Capability.BULK_INSERT, false);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
- new String[] { "e1", "e2" }, //$NON-NLS-1$ //$NON-NLS-2$
- new String[] { DataTypeManager.DefaultDataTypes.BIG_INTEGER, DataTypeManager.DefaultDataTypes.FLOAT});
-
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(pm1);
- store.addObject(pm1g1);
- store.addObjects(pm1g1e);
-
- FakeMetadataFacade metadata = new FakeMetadataFacade(store);
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
- dataManager.addData("INSERT INTO pm1.g1 (pm1.g1.e1, pm1.g1.e2) VALUES (1, 1.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1) })});
-
- String sql = "SELECT 1, 1 INTO pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(1) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- Insert insert = (Insert)dataManager.getCommandHistory().iterator().next();
-
- Constant value0 = (Constant)insert.getValues().get(0);
- Constant value1 = (Constant)insert.getValues().get(1);
-
- assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getValue().getClass());
- assertEquals(DataTypeManager.DefaultDataClasses.FLOAT, value1.getValue().getClass());
- }
-
private void sampleDataBQT2a(FakeDataManager dataMgr) throws QueryMetadataException, MetaMatrixComponentException {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQT();
@@ -7754,160 +7537,8 @@
TestOptimizer.checkDependentJoinCount(plan, 1);
// Run query
helpProcess(plan, dataManager, expected);
- }
-
- public void testInsertIntoWithSubquery_BATCH_NO_BULK_NO() {
- boolean doBatching = false;
- boolean doBulkInsert = false;
- helpInsertIntoWithSubquery( doBatching, doBulkInsert );
- }
+ }
- public void testInsertIntoWithSubquery_BATCH_YES_BULK_NO() {
- boolean doBatching = true;
- boolean doBulkInsert = false;
- helpInsertIntoWithSubquery( doBatching, doBulkInsert );
- }
-
- public void testInsertIntoWithSubquery_BATCH_NO_BULK_YES() {
- boolean doBatching = false;
- boolean doBulkInsert = true;
- helpInsertIntoWithSubquery( doBatching, doBulkInsert );
- }
-
-
- public void helpInsertIntoWithSubquery( boolean doBatching, boolean doBulkInsert ) {
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
-
- caps.setCapabilitySupport(Capability.BATCHED_UPDATES, doBatching);
- caps.setCapabilitySupport(Capability.BULK_INSERT, doBulkInsert);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
-
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1();
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
-
- dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
-
- if (doBulkInsert) {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?,?,?,?)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- }
- else
- if (doBatching) {
- dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- } else {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- }
-
- String sql = "INSERT INTO pm1.g2 SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1"; //$NON-NLS-1$
-// String sql = "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 INTO pm1.g2 from pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
-
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(2) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- // if not doBulkInsert and is doBatching,
- // check the command hist to ensure it contains the expected commands
- if ( !doBulkInsert && doBatching ) {
- BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
- assertEquals(2, bu.getUpdateCommands().size());
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
- }
- }
-
- public void testInsertIntoWithSubquery2_BATCH_NO_BULK_NO() {
- boolean doBatching = false;
- boolean doBulkInsert = false;
- helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
- }
-
- public void testInsertIntoWithSubquery2_BATCH_YES_BULK_NO() {
- boolean doBatching = true;
- boolean doBulkInsert = false;
- helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
- }
-
- public void testInsertIntoWithSubquery2_BATCH_NO_BULK_YES() {
- boolean doBatching = false;
- boolean doBulkInsert = true;
- helpInsertIntoWithSubquery2( doBatching, doBulkInsert );
- }
-
-
- public void helpInsertIntoWithSubquery2( boolean doBatching, boolean doBulkInsert ) {
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
-
- caps.setCapabilitySupport(Capability.BATCHED_UPDATES, doBatching);
- caps.setCapabilitySupport(Capability.BULK_INSERT, doBulkInsert);
- caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
-
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- FakeMetadataFacade metadata = FakeMetadataFactory.example1();
-
- HardcodedDataManager dataManager = new HardcodedDataManager();
-
- dataManager.addData("SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 FROM pm1.g1", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { "1", new Integer(1), Boolean.FALSE, new Double(1)}), //$NON-NLS-1$
- Arrays.asList(new Object[] { "2", new Integer(2), Boolean.TRUE, new Double(2) })}); //$NON-NLS-1$
-
- if (doBulkInsert) {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES (?,?,?,?)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- }
- else
- if (doBatching) {
- dataManager.addData("BatchedUpdate{I,I}", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(2)})});
- } else {
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- dataManager.addData("INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", //$NON-NLS-1$
- new List[] { Arrays.asList(new Object[] { new Integer(1)})});
- }
-
- String sql = "INSERT INTO pm1.g2 SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1 UNION ALL SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 from pm1.g1"; //$NON-NLS-1$
-// String sql = "SELECT pm1.g1.e1, pm1.g1.e2, pm1.g1.e3, pm1.g1.e4 INTO pm1.g2 from pm1.g1"; //$NON-NLS-1$
-
- Command command = helpParse(sql);
-
- ProcessorPlan plan = helpGetPlan(command, metadata, capFinder);
-
- List[] expected = new List[] {
- Arrays.asList(new Object[] { new Integer(4) }),
- };
-
- helpProcess(plan, dataManager, expected);
-
- // if not doBulkInsert and is doBatching,
- // check the command hist to ensure it contains the expected commands
- if ( !doBulkInsert && doBatching ) {
- BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(2);
- assertEquals(2, bu.getUpdateCommands().size());
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() ); //$NON-NLS-1$
- assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() ); //$NON-NLS-1$
- }
- }
-
/**
* A control test to ensure that y will still exist for sorting
*/
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectIntoNode.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectIntoNode.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/relational/TestProjectIntoNode.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -37,12 +37,12 @@
import com.metamatrix.query.processor.ProcessorDataManager;
import com.metamatrix.query.processor.FakeTupleSource.FakeComponentException;
import com.metamatrix.query.sql.lang.BatchedUpdateCommand;
-import com.metamatrix.query.sql.lang.BulkInsert;
import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Insert;
import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.tempdata.TempTableStoreImpl;
import com.metamatrix.query.util.CommandContext;
@@ -152,17 +152,19 @@
int batchSize = 1;
// ensure that we have the right kind of insert, and that the data for this row is valid
- if (!(command instanceof BulkInsert) && (command instanceof Insert)) {
- ensureValue((Insert)command, 2, callCount);
- } else if ( command instanceof BulkInsert ){
- BulkInsert bulkInsert = (BulkInsert)command;
- List batch = bulkInsert.getRows();
- batchSize = batch.size();
- assertEquals("Unexpected batch on call " + callCount, expectedBatchSize, batchSize); //$NON-NLS-1$
-
- for (int i = 0; i < batchSize; i++) {
- ensureValue2((List)batch.get(i), 2, ((callCount-1) * batchSize) + i + 1);
- }
+ if (command instanceof Insert) {
+ Insert insert = (Insert)command;
+ if (insert.isBulk()) {
+ List batch = TempTableStoreImpl.getBulkRows(insert);
+ batchSize = batch.size();
+ assertEquals("Unexpected batch on call " + callCount, expectedBatchSize, batchSize); //$NON-NLS-1$
+
+ for (int i = 0; i < batchSize; i++) {
+ ensureValue2((List)batch.get(i), 2, ((callCount-1) * batchSize) + i + 1);
+ }
+ } else {
+ ensureValue((Insert)command, 2, callCount);
+ }
} else if ( command instanceof BatchedUpdateCommand ){
BatchedUpdateCommand bu = (BatchedUpdateCommand)command;
List batch = bu.getSubCommands();
Deleted: trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestBulkInsert.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestBulkInsert.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestBulkInsert.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.query.sql.lang;
-
-import java.util.ArrayList;
-
-import junit.framework.TestCase;
-
-import com.metamatrix.query.sql.symbol.GroupSymbol;
-import com.metamatrix.query.unittest.FakeMetadataFacade;
-import com.metamatrix.query.unittest.FakeMetadataFactory;
-import com.metamatrix.query.unittest.FakeMetadataObject;
-import com.metamatrix.query.unittest.FakeMetadataStore;
-
-
-
-/**
- * @since 4.3
- */
-public class TestBulkInsert extends TestCase{
- public TestBulkInsert(String name) {
- super(name);
- }
-
-
- public void test1() throws Exception{
- FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
- FakeMetadataObject pm1g = FakeMetadataFactory.createPhysicalGroup("pm1.g", pm1); //$NON-NLS-1$
- FakeMetadataStore store = new FakeMetadataStore();
- store.addObject(pm1);
- store.addObject(pm1g);
- GroupSymbol g = new GroupSymbol("g");//$NON-NLS-1$
- g.setMetadataID(pm1g);
-
- BulkInsert bulkInsert = new BulkInsert(g, new ArrayList());
- assertEquals(2, bulkInsert.updatingModelCount(new FakeMetadataFacade(store)));
- }
-
-}
Modified: trunk/engine/src/test/java/com/metamatrix/query/sql/symbol/TestConstant.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/symbol/TestConstant.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/symbol/TestConstant.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -157,72 +157,4 @@
}
}
- public void testCompareToString1() {
- Constant a = new Constant(new String("a")); //$NON-NLS-1$
- Constant b = new Constant(new String("b")); //$NON-NLS-1$
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare < 0); //$NON-NLS-1$
- }
-
- public void testCompareToString2() {
- Constant a = new Constant(new String("a")); //$NON-NLS-1$
- Constant b = new Constant(new String("a")); //$NON-NLS-1$
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare == 0); //$NON-NLS-1$
- }
-
- public void testCompareToString3() {
- Constant a = new Constant(new String("b")); //$NON-NLS-1$
- Constant b = new Constant(new String("a")); //$NON-NLS-1$
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare > 0); //$NON-NLS-1$
- }
-
- public void testCompareToInt1() {
- Constant a = new Constant(new Integer(1));
- Constant b = new Constant(new Integer(2));
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare < 0); //$NON-NLS-1$
-
- }
-
- public void testCompareToInt2() {
- Constant a = new Constant(new Integer(2));
- Constant b = new Constant(new Integer(2));
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare == 0); //$NON-NLS-1$
-
- }
-
- public void testCompareToInt3() {
- Constant a = new Constant(new Integer(2));
- Constant b = new Constant(new Integer(1));
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare > 0); //$NON-NLS-1$
- }
-
- public void testCompareToDifferingTypes() {
- Constant a = new Constant(new Integer(2));
- Constant b = new Constant(null);
- try{
- a.compareTo(b);
- }catch(ClassCastException e) {
- //do nothing this should happen
- }
- }
-
- public void testCompareToNull1() {
- Constant a = new Constant(null, Integer.class);
- Constant b = new Constant(new Integer(1));
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare < 0); //$NON-NLS-1$
- }
-
- public void testCompareToNull2() {
- Constant a = new Constant(new Integer(1));
- Constant b = new Constant(null, Integer.class);
- int compare = a.compareTo(b);
- assertTrue("The String Values for these constants were incorrectly compared.", compare > 0); //$NON-NLS-1$
- }
-
}
Deleted: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestBulkInsertImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestBulkInsertImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestBulkInsertImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.dqp.internal.datamgr.language;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.teiid.connector.language.IElement;
-import org.teiid.dqp.internal.datamgr.language.BulkInsertImpl;
-
-import junit.framework.TestCase;
-
-import com.metamatrix.query.sql.lang.BulkInsert;
-import com.metamatrix.query.sql.symbol.GroupSymbol;
-
-/**
- * A Testcase for Bulk Insert, this is a simple extension of regular insert
- */
-public class TestBulkInsertImpl extends TestCase {
-
- /**
- * Constructor for TestBulkInsert.
- * @param name
- */
- public TestBulkInsertImpl(String name) {
- super(name);
- }
-
- public static BulkInsert helpExample(String groupName) {
- GroupSymbol group = TestGroupImpl.helpExample(groupName);
- ArrayList elements = new ArrayList();
- elements.add(TestElementImpl.helpExample(groupName, "e1")); //$NON-NLS-1$
- elements.add(TestElementImpl.helpExample(groupName, "e2")); //$NON-NLS-1$
- elements.add(TestElementImpl.helpExample(groupName, "e3")); //$NON-NLS-1$
- elements.add(TestElementImpl.helpExample(groupName, "e4")); //$NON-NLS-1$
-
- ArrayList rows = new ArrayList();
- for (int i =0; i < 4; i++) {
- ArrayList values = new ArrayList();
- values.add(TestLiteralImpl.helpExample(1));
- values.add(TestLiteralImpl.helpExample(2));
- values.add(TestLiteralImpl.helpExample(3));
- values.add(TestLiteralImpl.helpExample(4));
- rows.add(values);
- }
-
- return new BulkInsert(group,elements,rows);
- }
-
-
- public static BulkInsertImpl example(String groupName) throws Exception {
- return (BulkInsertImpl)TstLanguageBridgeFactory.factory.translate(helpExample(groupName));
-
- }
-
- public void testGetGroup() throws Exception {
- assertNotNull(example("a.b").getGroup()); //$NON-NLS-1$
- }
-
- public void testGetElements() throws Exception {
- BulkInsertImpl insert = example("a.b"); //$NON-NLS-1$
- assertNotNull(insert.getElements());
- assertEquals(4, insert.getElements().size());
- for (Iterator i = insert.getElements().iterator(); i.hasNext();) {
- assertTrue(i.next() instanceof IElement);
- }
- }
-
- public void testGetRows() throws Exception {
- BulkInsertImpl insert = example("a.b"); //$NON-NLS-1$
- assertNotNull(insert.getRows());
- assertEquals(4, insert.getRows().size());
-// for (Iterator iterRow = insert.getRows().iterator(); iterRow.hasNext();) {
-// List row = (List) iterRow.next();
-// for (Iterator i = row.iterator(); i.hasNext();) {
-// assertTrue(i.next() instanceof IExpression);
-// }
-// }
- }
-}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestInsertImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestInsertImpl.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestInsertImpl.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -27,6 +27,7 @@
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
+import org.teiid.connector.language.IInsertExpressionValueSource;
import org.teiid.dqp.internal.datamgr.language.InsertImpl;
import com.metamatrix.query.sql.lang.Insert;
@@ -103,9 +104,9 @@
public void testGetValues() throws Exception {
InsertImpl insert = example("a.b"); //$NON-NLS-1$
- assertNotNull(insert.getValues());
- assertEquals(4, insert.getValues().size());
- for (Iterator i = insert.getValues().iterator(); i.hasNext();) {
+ assertNotNull(insert.getValueSource());
+ assertEquals(4, ((IInsertExpressionValueSource)insert.getValueSource()).getValues().size());
+ for (Iterator i = ((IInsertExpressionValueSource)insert.getValueSource()).getValues().iterator(); i.hasNext();) {
assertTrue(i.next() instanceof IExpression);
}
}
@@ -117,9 +118,9 @@
for (Iterator i = insert.getElements().iterator(); i.hasNext();) {
assertTrue(i.next() instanceof IElement);
}
- assertNotNull(insert.getValues());
- assertEquals(1, insert.getValues().size());
- for (Iterator i = insert.getValues().iterator(); i.hasNext();) {
+ assertNotNull(insert.getValueSource());
+ assertEquals(1, ((IInsertExpressionValueSource)insert.getValueSource()).getValues().size());
+ for (Iterator i = ((IInsertExpressionValueSource)insert.getValueSource()).getValues().iterator(); i.hasNext();) {
assertTrue(i.next() instanceof IExpression);
}
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCallableStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCallableStatement.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCallableStatement.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -39,7 +39,7 @@
String sql = "{? = call pm4.spTest9()}"; //$NON-NLS-1$
try {
- TestPreparedStatement.helpTestProcessing(sql, Collections.EMPTY_LIST, null, FakeMetadataFactory.exampleBQTCached(), true);
+ TestPreparedStatement.helpTestProcessing(sql, Collections.EMPTY_LIST, null, new HardcodedDataManager(), FakeMetadataFactory.exampleBQTCached(), true);
fail();
} catch (QueryResolverException e) {
assertEquals("Required parameter 'PM4.SPTEST9.INKEY' has no value was set or is an invalid parameter.", e.getMessage()); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -79,10 +79,6 @@
super(name);
}
- static void helpTestProcessing(String preparedSql, List values, List[] expected, QueryMetadataInterface metadata, boolean callableStatement) throws Exception {
- helpTestProcessing(preparedSql, values, expected, (ProcessorDataManager)null, metadata, callableStatement);
- }
-
static void helpTestProcessing(String preparedSql, List values, List[] expected, ProcessorDataManager dataManager, QueryMetadataInterface metadata, boolean callableStatement) throws Exception {
helpTestProcessing(preparedSql, values, expected, dataManager, metadata, callableStatement, false);
}
@@ -126,7 +122,7 @@
PreparedStatementRequest plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, SESSION_ID, callableStatement, false);
// Run query
- TestProcessor.helpProcess(plan.processPlan, plan.context, dManager, expected);
+ TestProcessor.doProcess(plan.processPlan, dataManager, expected, plan.context);
//test cached plan
plan = TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, SESSION_ID, callableStatement, false);
@@ -135,7 +131,7 @@
assertEquals("should reuse the plan", exHitCount, pPlanCache.hitCount); //$NON-NLS-1$
// Run query again
- TestProcessor.helpProcess(plan.processPlan, plan.context, dManager, expected);
+ TestProcessor.doProcess(plan.processPlan, dataManager, expected, plan.context);
//get the plan again with a new connection
assertNotNull(TestPreparedStatement.helpGetProcessorPlan(preparedSql, values, cFinder, metadata, pPlanCache, 7, callableStatement, false));
@@ -162,8 +158,9 @@
List values = new ArrayList();
values.add(new Short((short)0));
-
- helpTestProcessing(preparedSql, values, expected, FakeMetadataFactory.example1Cached(), false);
+ FakeDataManager dataManager = new FakeDataManager();
+ TestProcessor.sampleData1(dataManager);
+ helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false);
}
public void testSessionSpecificFunction() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java 2009-05-10 04:51:35 UTC (rev 902)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatementBatchedUpdate.java 2009-05-11 14:34:31 UTC (rev 903)
@@ -22,19 +22,23 @@
package org.teiid.dqp.internal.process;
+import static org.junit.Assert.*;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import junit.framework.TestCase;
-
+import org.junit.Test;
import org.teiid.dqp.internal.process.TestPreparedStatement.TestablePreparedPlanCache;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
import com.metamatrix.query.processor.FakeDataManager;
+import com.metamatrix.query.processor.HardcodedDataManager;
import com.metamatrix.query.processor.TestProcessor;
+import com.metamatrix.query.sql.lang.Update;
+import com.metamatrix.query.sql.symbol.Constant;
import com.metamatrix.query.unittest.FakeMetadataFactory;
/**
@@ -42,12 +46,8 @@
* plans that contain batched updates.
*
*/
-public class TestPreparedStatementBatchedUpdate extends TestCase {
+public class TestPreparedStatementBatchedUpdate {
- public TestPreparedStatementBatchedUpdate(String name) {
- super(name);
- }
-
/**
* Test prepared statements that use batched updates using the same prepared
* command with varying number of commands in the batch.
@@ -80,7 +80,7 @@
*
* @throws Exception
*/
- public void testPlanCache_VarNumCmds() throws Exception {
+ @Test public void testPlanCache_VarNumCmds() throws Exception {
// Create query
String preparedSql = "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"; //$NON-NLS-1$
@@ -152,10 +152,10 @@
*
* @throws Exception
*/
- public void testProcessor_VarNumCmds() throws Exception {
+ @Test public void testProcessor_VarNumCmds() throws Exception {
// Create query
String preparedSql = "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"; //$NON-NLS-1$
-
+ int executionsPerTest = 2;
// Create a testable prepared plan cache
TestablePreparedPlanCache prepPlanCache = new TestablePreparedPlanCache();
@@ -167,11 +167,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.BATCHED_UPDATES, true);
- caps.setCapabilitySupport(Capability.PREPARED_BATCH_UPDATE, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Something to hold our final query list
- List<String> finalQueryList = new ArrayList<String>(42);
+ List<String> finalQueryList = new ArrayList<String>(13);
// Create expected results
// first command should result in 2 rows affected
@@ -187,7 +186,7 @@
values.add(new ArrayList<Object>(Arrays.asList(new Object[] { null, Boolean.FALSE, new Integer(1) })));
// Add our expected queries to the final query list
- for ( int i = 0; i < 6; i++ ) {
+ for ( int i = 0; i < executionsPerTest; i++ ) {
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = null, e3 = FALSE WHERE pm1.g1.e2 = 1")); //$NON-NLS-1$
}
@@ -207,7 +206,7 @@
values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "a", Boolean.FALSE, new Integer(0) }))); //$NON-NLS-1$
// Add our expected queries to the final query list
- for (int i = 0; i < 6; i++) {
+ for (int i = 0; i < executionsPerTest; i++) {
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
}
@@ -235,7 +234,7 @@
values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "b", Boolean.TRUE, new Integer(5)} ))); //$NON-NLS-1$
// Add our expected queries to the final query list
- for (int i = 0; i < 6; i++) {
+ for (int i = 0; i < executionsPerTest; i++) {
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'a', e3 = FALSE WHERE pm1.g1.e2 = 0")); //$NON-NLS-1$
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = null, e3 = FALSE WHERE pm1.g1.e2 = 1")); //$NON-NLS-1$
finalQueryList.add(new String("UPDATE pm1.g1 SET e1 = 'c', e3 = TRUE WHERE pm1.g1.e2 = 4")); //$NON-NLS-1$
@@ -245,8 +244,38 @@
TestPreparedStatement.helpTestProcessing(preparedSql, values, expected, dataManager, capFinder, FakeMetadataFactory.example1Cached(), prepPlanCache, false, false, true);
// Verify all the queries that were run
- assertNotNull(dataManager);
assertEquals("Unexpected queries executed -", finalQueryList, dataManager.getQueries()); //$NON-NLS-1$
}
-
+
+ @Test public void testBatchedUpdatePushdown() throws Exception {
+ // Create query
+ String preparedSql = "UPDATE pm1.g1 SET pm1.g1.e1=?, pm1.g1.e3=? WHERE pm1.g1.e2=?"; //$NON-NLS-1$
+
+ // Create a testable prepared plan cache
+ TestablePreparedPlanCache prepPlanCache = new TestablePreparedPlanCache();
+
+ // Construct data manager with data
+ HardcodedDataManager dataManager = new HardcodedDataManager();
+ dataManager.addData("UPDATE pm1.g1 SET e1 = ?, e3 = ? WHERE pm1.g1.e2 = ?", new List[] {Arrays.asList(4)}); //$NON-NLS-1$
+ // Source capabilities must support batched updates
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.BULK_UPDATE, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ // batch with two commands
+ ArrayList<ArrayList<Object>> values = new ArrayList<ArrayList<Object>>(2);
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { "a", Boolean.FALSE, new Integer(0) }))); //$NON-NLS-1$
+ values.add(new ArrayList<Object>(Arrays.asList(new Object[] { null, Boolean.FALSE, new Integer(1) })));
+
+ List<?>[] expected = new List[] {
+ Arrays.asList(4)
+ };
+
+ // Create the plan and process the query
+ TestPreparedStatement.helpTestProcessing(preparedSql, values, expected, dataManager, capFinder, FakeMetadataFactory.example1Cached(), prepPlanCache, false, false, false);
+ Update update = (Update)dataManager.getCommandHistory().iterator().next();
+ assertTrue(((Constant)update.getChangeList().getClauses().get(0).getValue()).isMultiValued());
+ }
+
}
14 years, 10 months