teiid SVN: r872 - trunk/server/src/main/java/com/metamatrix/admin/server.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-07 10:57:11 -0400 (Thu, 07 May 2009)
New Revision: 872
Modified:
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
Log:
Teiid 470 - fix the logic in returning all connectors
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-06 23:01:15 UTC (rev 871)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-05-07 14:57:11 UTC (rev 872)
@@ -22,7 +22,7 @@
package com.metamatrix.admin.server;
-import static org.teiid.dqp.internal.process.Util.*;
+import static org.teiid.dqp.internal.process.Util.convertStats;
import java.io.File;
import java.io.IOException;
@@ -149,6 +149,9 @@
Map runtimeMap = new HashMap();
for (Iterator iter = components.iterator(); iter.hasNext();) {
BasicDeployedComponent component = (BasicDeployedComponent)iter.next();
+ if (!component.isDeployedConnector()) {
+ continue;
+ }
String bindingName = component.getName();
String[] identifierParts = new String[] {
@@ -172,8 +175,7 @@
binding.setLastUpdated(configBinding.getLastChangedDate());
binding.setLastUpdatedBy(configBinding.getLastChangedBy());
- String key = binding.getIdentifier().toUpperCase();
- runtimeMap.put(key, binding);
+ runtimeMap.put(component.getFullName(), binding);
results.add(binding);
}
@@ -191,25 +193,28 @@
String name = serviceBinding.getDeployedName();
MMConnectorBinding binding;
- String[] identifierParts = new String[] {serviceBinding.getHostName(), serviceBinding.getProcessName(), name};
- String key = MMAdminObject.buildIdentifier(identifierParts).toUpperCase();
- if (runtimeMap.containsKey(key)) {
+ if (runtimeMap.containsKey(deployedComponent.getFullName())) {
//reuse MMConnectorBinding from config
- binding = (MMConnectorBinding) runtimeMap.get(key);
- } else {
- //not in config - create new MMConnectorBinding
- binding = new MMConnectorBinding(identifierParts);
- binding.setDeployed(false);
- binding.setState(MMConnectorBinding.STATE_NOT_DEPLOYED);
- }
-
- if (identifierMatches(identifier, identifierParts)) {
+ binding = (MMConnectorBinding) runtimeMap.get(deployedComponent.getFullName());
binding.setConnectorTypeName(deployedComponent.getComponentTypeID().getFullName());
binding.setDescription(deployedComponent.getDescription());
binding.setState(serviceBinding.getCurrentState());
binding.setStateChangedTime(serviceBinding.getStateChangeTime());
binding.setRegistered(true);
binding.setServiceID(serviceBinding.getServiceID().getID());
+
+ } else {
+ String[] identifierParts = new String[] {
+ deployedComponent.getHostID().getName(),
+ deployedComponent.getVMComponentDefnID().getName(),
+ deployedComponent.getName()
+ };
+ String key = MMAdminObject.buildIdentifier(identifierParts).toUpperCase();
+
+ //not in config - create new MMConnectorBinding
+ binding = new MMConnectorBinding(identifierParts);
+ binding.setDeployed(false);
+ binding.setState(MMConnectorBinding.STATE_NOT_DEPLOYED);
results.add(binding);
}
15 years, 7 months
teiid SVN: r871 - trunk/build/kit-embedded/deploy.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-06 19:01:15 -0400 (Wed, 06 May 2009)
New Revision: 871
Modified:
trunk/build/kit-embedded/deploy/configuration.xml
Log:
TEIID-560: fixed the port number and also upgraded all the changes happened during the 6.0.0 Designer phase.
Modified: trunk/build/kit-embedded/deploy/configuration.xml
===================================================================
--- trunk/build/kit-embedded/deploy/configuration.xml 2009-05-06 22:51:39 UTC (rev 870)
+++ trunk/build/kit-embedded/deploy/configuration.xml 2009-05-06 23:01:15 UTC (rev 871)
@@ -47,7 +47,7 @@
<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" />
+ <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" />
@@ -62,57 +62,57 @@
<AllowedValue>vdb</AllowedValue>
<AllowedValue>session</AllowedValue>
</PropertyDefinition>
- <PropertyDefinition Name="supportsAndCriteria" DisplayName="supportsAndCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteria" DisplayName="supportsCompareCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaEquals" DisplayName="supportsCompareCriteriaEquals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThan" DisplayName="supportsCompareCriteriaGreaterThan" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThanOrEqual" DisplayName="supportsCompareCriteriaGreaterThanOrEqual" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThan" DisplayName="supportsCompareCriteriaLessThan" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThanOrEqual" DisplayName="supportsCompareCriteriaLessThanOrEqual" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaNotEquals" DisplayName="supportsCompareCriteriaNotEquals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCriteria" DisplayName="supportsCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteria" DisplayName="supportsInCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsIsNullCriteria" DisplayName="supportsIsNullCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsJoins" DisplayName="supportsJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteria" DisplayName="supportsLikeCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsNotCriteria" DisplayName="supportsNotCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrCriteria" DisplayName="supportsOrCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectDistinct" DisplayName="supportsSelectDistinct" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectLiterals" DisplayName="supportsSelectLiterals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAliasedGroup" DisplayName="supportsAliasedGroup" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelfJoins" DisplayName="supportsSelfJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOuterJoins" DisplayName="supportsOuterJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsFullOuterJoins" DisplayName="supportsFullOuterJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsBetweenCriteria" DisplayName="supportsBetweenCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteriaEscapeCharacter" DisplayName="supportsLikeCriteriaEscapeCharacter" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteriaSubquery" DisplayName="supportsInCriteriaSubquery" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsExistsCriteria" DisplayName="supportsExistsCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteria" DisplayName="supportsQuantifiedCompareCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaSome" DisplayName="supportsQuantifiedCompareCriteriaSome" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaAll" DisplayName="supportsQuantifiedCompareCriteriaAll" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderBy" DisplayName="supportsOrderBy" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregates" DisplayName="supportsAggregates" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesSum" DisplayName="supportsAggregatesSum" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesAvg" DisplayName="supportsAggregatesAvg" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMin" DisplayName="supportsAggregatesMin" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMax" DisplayName="supportsAggregatesMax" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCount" DisplayName="supportsAggregatesCount" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCountStar" DisplayName="supportsAggregatesCountStar" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesDistinct" DisplayName="supportsAggregatesDistinct" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarSubqueries" DisplayName="supportsScalarSubqueries" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCorrelatedSubqueries" DisplayName="supportsCorrelatedSubqueries" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCaseExpressions" DisplayName="supportsCaseExpressions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSearchedCaseExpressions" DisplayName="supportsSearchedCaseExpressions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarFunctions" DisplayName="supportsScalarFunctions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="getSupportedFunctions" DisplayName="getSupportedFunctions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="string" IsExpert="true" />
- <PropertyDefinition Name="supportsInlineViews" DisplayName="supportsInlineViews" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderByInInlineViews" DisplayName="supportsOrderByInInlineViews" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnionOrderBy" DisplayName="supportsUnionOrderBy" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnions" DisplayName="supportsUnions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
+ <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" />
+ <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" />
@@ -134,7 +134,7 @@
</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" />
+ <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" />
@@ -143,8 +143,8 @@
<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;extension:commons-codec-1.2.jar;extension:commons-discovery-0.2.jar;extension:commons-httpclient-3.0.1.jar;extension:xmlsec-1.3.0.jar;extension:axis-1.3.jar;extension:axis-jaxrpc-1.3.jar;extension:axis-saaj-1.2.jar;extension:axis-schema-1.3.jar;extension:commons-discovery-0.2.jar;extension:commons-logging-1.1.jar;extension:jms-1.1.jar;extension:servlet-api-2.5.jar;extension:jaxen-1.1.1.jar;extension:jdom-1.0.jar;extension:log4j-1.2.8.jar;extension:opensaml-1.1b.jar;extension:salesforce-api-6.1.0-SNAPSHOT.jar;extension:wsdl4j-1.5.1.jar;extension:wss4j-1.5.0.jar;extension:xalan-2.7.0.jar;extension:xml-apis-1.0.b2.jar"
- Multiplicity="0..1" IsExpert="true" />
+ 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" />
@@ -155,7 +155,7 @@
</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" />
+ <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" />
@@ -166,8 +166,8 @@
<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;extension:commons-codec-1.2.jar;extension:commons-discovery-0.2.jar;extension:commons-httpclient-3.0.1.jar;extension:xmlsec-1.3.0.jar;extension:axis-1.3.jar;extension:axis-jaxrpc-1.3.jar;extension:axis-saaj-1.2.jar;extension:axis-schema-1.3.jar;extension:commons-discovery-0.2.jar;extension:commons-logging-1.1.jar;extension:jms-1.1.jar;extension:servlet-api-2.5.jar;extension:jaxen-1.1.1.jar;extension:jdom-1.0.jar;extension:log4j-1.2.8.jar;extension:opensaml-1.1b.jar;extension:wsdl4j-1.5.1.jar;extension:wss4j-1.5.0.jar;extension:xalan-2.7.0.jar;extension:xml-apis-1.0.b2.jar"
- Multiplicity="0..1" IsExpert="true" />
+ 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" />
@@ -294,14 +294,13 @@
<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" />
+ <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="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" />
@@ -312,107 +311,109 @@
<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 ANSI 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.oracle.OracleDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:oracle://<host>:1521;SID=<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 ANSI 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.db2.DB2Driver" 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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="Sybase ANSI 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.sybase.SybaseDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sybase://<host>:5000;DatabaseName=<databasename>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" 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" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Sybase ANSI 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="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 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.sqlserver.SQLServerDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sqlserver://<host>:1433;DatabaseName=<databasename>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:mysql-connector-java-5.1.5.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="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="" DefaultValue="extensionjar:mysql-connector-java-5.1.5.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:postgresql-8.3-603.jdbc3.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432;DatabaseName=/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:postgresql-8.3-603.jdbc3.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:derby.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:derbyclient.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="MetaMatrix JDBC 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.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="" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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" LastChangedDate="2008-10-31T10:26:19.953-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.953-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" />
+ <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="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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.access.AccessSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="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" />
+ <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>
</ComponentTypes>
</ConfigurationDocument>
\ No newline at end of file
15 years, 7 months
teiid SVN: r870 - branches/6.0.x/build/kit-embedded/deploy.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-06 18:51:39 -0400 (Wed, 06 May 2009)
New Revision: 870
Modified:
branches/6.0.x/build/kit-embedded/deploy/configuration.xml
Log:
Syncing with Designer copy of the configuration
Modified: branches/6.0.x/build/kit-embedded/deploy/configuration.xml
===================================================================
--- branches/6.0.x/build/kit-embedded/deploy/configuration.xml 2009-05-06 22:23:37 UTC (rev 869)
+++ branches/6.0.x/build/kit-embedded/deploy/configuration.xml 2009-05-06 22:51:39 UTC (rev 870)
@@ -47,7 +47,7 @@
<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" />
+ <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" />
@@ -62,57 +62,57 @@
<AllowedValue>vdb</AllowedValue>
<AllowedValue>session</AllowedValue>
</PropertyDefinition>
- <PropertyDefinition Name="supportsAndCriteria" DisplayName="supportsAndCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteria" DisplayName="supportsCompareCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaEquals" DisplayName="supportsCompareCriteriaEquals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThan" DisplayName="supportsCompareCriteriaGreaterThan" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaGreaterThanOrEqual" DisplayName="supportsCompareCriteriaGreaterThanOrEqual" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThan" DisplayName="supportsCompareCriteriaLessThan" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaLessThanOrEqual" DisplayName="supportsCompareCriteriaLessThanOrEqual" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCompareCriteriaNotEquals" DisplayName="supportsCompareCriteriaNotEquals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCriteria" DisplayName="supportsCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteria" DisplayName="supportsInCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsIsNullCriteria" DisplayName="supportsIsNullCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsJoins" DisplayName="supportsJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteria" DisplayName="supportsLikeCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsNotCriteria" DisplayName="supportsNotCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrCriteria" DisplayName="supportsOrCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectDistinct" DisplayName="supportsSelectDistinct" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelectLiterals" DisplayName="supportsSelectLiterals" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAliasedGroup" DisplayName="supportsAliasedGroup" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSelfJoins" DisplayName="supportsSelfJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOuterJoins" DisplayName="supportsOuterJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsFullOuterJoins" DisplayName="supportsFullOuterJoins" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsBetweenCriteria" DisplayName="supportsBetweenCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsLikeCriteriaEscapeCharacter" DisplayName="supportsLikeCriteriaEscapeCharacter" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsInCriteriaSubquery" DisplayName="supportsInCriteriaSubquery" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsExistsCriteria" DisplayName="supportsExistsCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteria" DisplayName="supportsQuantifiedCompareCriteria" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaSome" DisplayName="supportsQuantifiedCompareCriteriaSome" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsQuantifiedCompareCriteriaAll" DisplayName="supportsQuantifiedCompareCriteriaAll" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderBy" DisplayName="supportsOrderBy" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregates" DisplayName="supportsAggregates" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesSum" DisplayName="supportsAggregatesSum" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesAvg" DisplayName="supportsAggregatesAvg" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMin" DisplayName="supportsAggregatesMin" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesMax" DisplayName="supportsAggregatesMax" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCount" DisplayName="supportsAggregatesCount" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesCountStar" DisplayName="supportsAggregatesCountStar" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsAggregatesDistinct" DisplayName="supportsAggregatesDistinct" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarSubqueries" DisplayName="supportsScalarSubqueries" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCorrelatedSubqueries" DisplayName="supportsCorrelatedSubqueries" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsCaseExpressions" DisplayName="supportsCaseExpressions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsSearchedCaseExpressions" DisplayName="supportsSearchedCaseExpressions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsScalarFunctions" DisplayName="supportsScalarFunctions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="getSupportedFunctions" DisplayName="getSupportedFunctions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="string" IsExpert="true" />
- <PropertyDefinition Name="supportsInlineViews" DisplayName="supportsInlineViews" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsOrderByInInlineViews" DisplayName="supportsOrderByInInlineViews" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnionOrderBy" DisplayName="supportsUnionOrderBy" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
- <PropertyDefinition Name="supportsUnions" DisplayName="supportsUnions" ShortDescription="" DefaultValue="" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
+ <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.0.1-SNAPSHOT.jar;" 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:connector-ldap-6.0.1-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" />
@@ -134,7 +134,7 @@
</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.0.1-SNAPSHOT.jar;" 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:connector-loopback-6.0.1-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" />
@@ -143,8 +143,8 @@
<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.0.1-SNAPSHOT.jar;extension:commons-codec-1.2.jar;extension:commons-discovery-0.2.jar;extension:commons-httpclient-3.0.1.jar;extension:xmlsec-1.3.0.jar;extension:axis-1.3.jar;extension:axis-jaxrpc-1.3.jar;extension:axis-saaj-1.2.jar;extension:axis-schema-1.3.jar;extension:commons-discovery-0.2.jar;extension:commons-logging-1.1.jar;extension:jms-1.1.jar;extension:servlet-api-2.5.jar;extension:jaxen-1.1.1.jar;extension:jdom-1.0.jar;extension:log4j-1.2.8.jar;extension:opensaml-1.1b.jar;extension:salesforce-api-6.0.1-SNAPSHOT.jar;extension:wsdl4j-1.5.1.jar;extension:wss4j-1.5.0.jar;extension:xalan-2.7.0.jar;extension:xml-apis-1.0.b2.jar"
- Multiplicity="0..1" IsExpert="true" />
+ DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-salesforce-6.0.1.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.0.1-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" />
@@ -155,7 +155,7 @@
</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.0.1-SNAPSHOT.jar;" 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:connector-text-6.0.1-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" />
@@ -166,8 +166,8 @@
<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.0.1-SNAPSHOT.jar;extension:commons-codec-1.2.jar;extension:commons-discovery-0.2.jar;extension:commons-httpclient-3.0.1.jar;extension:xmlsec-1.3.0.jar;extension:axis-1.3.jar;extension:axis-jaxrpc-1.3.jar;extension:axis-saaj-1.2.jar;extension:axis-schema-1.3.jar;extension:commons-discovery-0.2.jar;extension:commons-logging-1.1.jar;extension:jms-1.1.jar;extension:servlet-api-2.5.jar;extension:jaxen-1.1.1.jar;extension:jdom-1.0.jar;extension:log4j-1.2.8.jar;extension:opensaml-1.1b.jar;extension:wsdl4j-1.5.1.jar;extension:wss4j-1.5.0.jar;extension:xalan-2.7.0.jar;extension:xml-apis-1.0.b2.jar"
- Multiplicity="0..1" IsExpert="true" />
+ DefaultValue="extensionjar:connector_patch.jar;extensionjar:connector-xml-6.0.1-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" />
@@ -294,14 +294,13 @@
<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.0.1-SNAPSHOT.jar;" 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:connector-jdbc-6.0.1-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="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" />
@@ -312,107 +311,109 @@
<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 ANSI 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.oracle.OracleDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:oracle://<host>:1521;SID=<sid>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 ANSI 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.db2.DB2Driver" 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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="Sybase ANSI 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.sybase.SybaseDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sybase://<host>:5000;DatabaseName=<databasename>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" 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" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
- </ComponentType>
- <ComponentType Name="Sybase ANSI 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="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 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.sqlserver.SQLServerDriver" Multiplicity="1" IsConstrainedToAllowedValues="false" IsPreferred="true" />
- <PropertyDefinition Name="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:mmx:sqlserver://<host>:1433;DatabaseName=<databasename>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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 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.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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:metamatrix-datadirect-0.0.1-SNAPSHOT.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:mysql-connector-java-5.1.5.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="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="" DefaultValue="extensionjar:mysql-connector-java-5.1.5.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:postgresql-8.3-603.jdbc3.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="URL" DisplayName="JDBC URL" ShortDescription="" DefaultValue="jdbc:postgresql://<host>:5432;DatabaseName=/<databaseName>" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" DefaultValue="extensionjar:postgresql-8.3-603.jdbc3.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:derby.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="" DefaultValue="extensionjar:connector_patch.jar;extensionjar:derbyclient.jar" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="MetaMatrix JDBC 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.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="" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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" LastChangedDate="2008-10-31T10:26:19.953-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.953-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" />
+ <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="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" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true" />
- <PropertyDefinition Name="ExtensionTranslationClass" DisplayName="Extension SQL Translation Class" ShortDescription="" DefaultValue="org.teiid.connector.jdbc.access.AccessSQLTranslator" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="true" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false" />
+ <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="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" />
+ <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>
</ComponentTypes>
</ConfigurationDocument>
\ No newline at end of file
15 years, 7 months
teiid SVN: r869 - in trunk: embedded/src/main/java/com/metamatrix/dqp/embedded/admin and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-06 18:23:37 -0400 (Wed, 06 May 2009)
New Revision: 869
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/embedded/EmbeddedConfigAdmin.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
Log:
TEIID-472, TEIID-558, TEIID-557
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/embedded/EmbeddedConfigAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/embedded/EmbeddedConfigAdmin.java 2009-05-06 20:38:38 UTC (rev 868)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/embedded/EmbeddedConfigAdmin.java 2009-05-06 22:23:37 UTC (rev 869)
@@ -23,12 +23,17 @@
package com.metamatrix.admin.api.embedded;
import com.metamatrix.admin.api.core.CoreConfigAdmin;
+import com.metamatrix.admin.api.exception.AdminException;
/**
* @since 4.3
*/
-public interface EmbeddedConfigAdmin extends
- CoreConfigAdmin {
-
+public interface EmbeddedConfigAdmin extends CoreConfigAdmin {
+ /**
+ * Reload the User Defined function.
+ * @throws AdminException
+ * @since 6.1.0
+ */
+ void reloadUDF() throws AdminException;
}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java 2009-05-06 20:38:38 UTC (rev 868)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPConfigAdminImpl.java 2009-05-06 22:23:37 UTC (rev 869)
@@ -213,8 +213,6 @@
}
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
- } catch (MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
}
}
@@ -287,20 +285,18 @@
// now that all of the input parameters validated, add the connector binding
binding = addConnectorBinding(deployName, binding, ctype, true);
- } catch (MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
}
return (com.metamatrix.admin.api.objects.ConnectorBinding) convertToAdminObjects(binding);
}
- boolean bindingExists(String name) throws MetaMatrixComponentException, MetaMatrixProcessingException {
+ boolean bindingExists(String name) throws MetaMatrixComponentException {
ConnectorBinding binding = getDataService().getConnectorBinding(name);
return (binding != null);
}
- boolean bindingTypeExists(String name) throws MetaMatrixComponentException, MetaMatrixProcessingException {
+ boolean bindingTypeExists(String name) throws MetaMatrixComponentException {
ConnectorBindingType type = getConfigurationService().getConnectorType(name);
return (type != null);
}
@@ -366,8 +362,6 @@
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
- } catch (MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
}
return (com.metamatrix.admin.api.objects.ConnectorBinding) convertToAdminObjects(binding);
@@ -397,9 +391,7 @@
return binding;
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
- } catch (MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
- }
+ }
}
throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.connector_load_failed_wrong_type", deployName)); //$NON-NLS-1$
}
@@ -468,7 +460,6 @@
try {
startVDBConnectorBindings(deployedVDB);
} catch (MetaMatrixComponentException e) {
- } catch (MetaMatrixProcessingException e) {
} catch (ApplicationLifecycleException e) {
// we can safely ignore these because the cause of the not starting is already recorded
// and more likely VDB deployment succeeded.
@@ -478,8 +469,6 @@
return (VDB) convertToAdminObjects(deployedVDB);
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
- } catch (MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
}
}
@@ -488,7 +477,7 @@
* @param vdb
*/
private void startVDBConnectorBindings(VDBArchive vdb) throws MetaMatrixComponentException,
- MetaMatrixProcessingException, ApplicationLifecycleException {
+ ApplicationLifecycleException {
VDBDefn def = vdb.getConfigurationDef();
Collection<ConnectorBinding> bindings = def.getConnectorBindings().values();
@@ -503,8 +492,7 @@
* the decrypt properties.
*/
void validateConnectorBindingsInVdb(VDBArchive vdb, AdminOptions options)
- throws MetaMatrixComponentException, MetaMatrixProcessingException,
- AdminProcessingException, AdminException {
+ throws MetaMatrixComponentException, AdminProcessingException, AdminException {
VDBDefn def = vdb.getConfigurationDef();
@@ -861,7 +849,7 @@
if (type == null) {
type = connectorTypes[typeIndex];
ExtensionModule[] extModules = archive.getExtensionModules(type);
- checkAddingConnectorType(type, extModules, options, previouslyAddedModules);
+ checkDuplicateExtensionModules(extModules, options, previouslyAddedModules);
saveConnectorType(type);
} else {
@@ -876,14 +864,14 @@
// Now that we know we need to add this to configuration; let's get on with it
type = connectorTypes[typeIndex];
ExtensionModule[] extModules = archive.getExtensionModules(type);
- checkAddingConnectorType(type, extModules, options, previouslyAddedModules);
+ checkDuplicateExtensionModules(extModules, options, previouslyAddedModules);
saveConnectorType(type);
}
}
// Now that we know we need to add this to configuration; let's get on with it
type = connectorTypes[typeIndex];
ExtensionModule[] extModules = archive.getExtensionModules(type);
- checkAddingConnectorType(type, extModules, options, previouslyAddedModules);
+ checkDuplicateExtensionModules(extModules, options, previouslyAddedModules);
}
// Now add the extension modules
@@ -894,8 +882,6 @@
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
- } catch(MetaMatrixProcessingException e) {
- throw new AdminProcessingException(e);
}
}
@@ -904,12 +890,12 @@
* system, if it there takes the appropriate action. Otherwise keeps tracks of all modules
* to add.
* @param type - connector type
- * @param extModules - Extension modules for the Coneector Type
+ * @param extModules - Extension modules for the Connector Type
* @param options - Admin Options
* @param ignorableModules - Modules which are already added, can be ignored for adding
*/
- void checkAddingConnectorType(ConnectorBindingType type, ExtensionModule[] extModules, AdminOptions options, HashSet ignorableModules)
- throws MetaMatrixComponentException, MetaMatrixProcessingException, AdminException {
+ void checkDuplicateExtensionModules(ExtensionModule[] extModules, AdminOptions options, HashSet ignorableModules)
+ throws AdminException {
// Now check if the the extension modules are already there
for (int i = 0; i < extModules.length; i++) {
@@ -932,7 +918,7 @@
// this is OK, we did not find any thing
}
- // if we found it take approprite action.
+ // if we found it take appropriate action.
if(previousModule != null && options.containsOption(AdminOptions.OnConflict.EXCEPTION)) {
throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.extension_module_exists", previousModule.getFullName())); //$NON-NLS-1$
}
@@ -1003,14 +989,12 @@
}
}
- private void saveConnectorType(ConnectorBindingType type) throws MetaMatrixProcessingException, MetaMatrixComponentException {
+ private void saveConnectorType(ConnectorBindingType type) throws MetaMatrixComponentException {
getConfigurationService().saveConnectorType(type);
}
- /**
- * @see com.metamatrix.admin.api.core.CoreConfigAdmin#addUDF(byte[], java.lang.String)
- */
+ @Override
public void addUDF(byte[] modelFileContents, String classpath)
throws AdminException {
if (modelFileContents == null || modelFileContents.length == 0) {
@@ -1057,9 +1041,7 @@
}
}
- /**
- * @see com.metamatrix.admin.api.core.CoreConfigAdmin#deleteUDF()
- */
+ @Override
public void deleteUDF() throws AdminException {
try {
getConfigurationService().unloadUDF();
@@ -1067,5 +1049,14 @@
} catch (MetaMatrixComponentException e) {
throw new AdminComponentException(e);
}
+ }
+
+ @Override
+ public void reloadUDF() throws AdminException {
+ try {
+ getConfigurationService().loadUDF();
+ } catch (MetaMatrixComponentException e) {
+ throw new AdminComponentException(e);
+ }
}
}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java 2009-05-06 20:38:38 UTC (rev 868)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/configuration/ServerConfigFileReader.java 2009-05-06 22:23:37 UTC (rev 869)
@@ -27,16 +27,22 @@
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import com.metamatrix.common.config.api.ComponentType;
+import com.metamatrix.common.config.api.ComponentTypeID;
import com.metamatrix.common.config.api.Configuration;
import com.metamatrix.common.config.api.ConfigurationModelContainer;
import com.metamatrix.common.config.api.ConnectorBinding;
+import com.metamatrix.common.config.api.ConnectorBindingType;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
+import com.metamatrix.common.config.model.BasicComponentType;
import com.metamatrix.common.config.model.ConfigurationModelContainerAdapter;
+import com.metamatrix.common.object.PropertyDefinition;
/**
* This class loades the server configuration file <code>ServerConfig.xml</code>
@@ -78,7 +84,7 @@
for (Iterator i = componentTypes.iterator(); i.hasNext();) {
ComponentType type = (ComponentType)i.next();
if (type.getComponentTypeCode() == ComponentType.CONNECTOR_COMPONENT_TYPE_CODE) {
- connectorTypes.put(type.getName(), type);
+ connectorTypes.put(type.getName(), resolvePropertyDefns(type, this.configuration));
}
}
@@ -134,4 +140,23 @@
public Map getConnectorTypes() {
return connectorTypes;
}
+
+ public static ComponentType resolvePropertyDefns(ComponentType type, ConfigurationModelContainer configuration) {
+ BasicComponentType baseType = (BasicComponentType)type;
+ Collection c = configuration.getAllComponentTypeDefinitions((ComponentTypeID)baseType.getID());
+
+ // if the type is found in the configuration.xml, then add its prop-definitions; else look for parent
+ if (c == null || c.isEmpty()) {
+ // this means user has added a new connector type
+ c = configuration.getAllComponentTypeDefinitions(type.getSuperComponentTypeID());
+ }
+
+ if (c != null && !c.isEmpty()) {
+ Set<PropertyDefinition> defns = new HashSet<PropertyDefinition>();
+ defns.addAll(c);
+ defns.addAll(type.getComponentTypeDefinitions());
+ baseType.setComponentTypeDefinitions(defns);
+ }
+ return baseType;
+ }
}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-05-06 20:38:38 UTC (rev 868)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java 2009-05-06 22:23:37 UTC (rev 869)
@@ -231,32 +231,6 @@
DQPEmbeddedPlugin.logError(e, "EmbeddedConfigurationService.udf_classspath_failure", new Object[] {}); //$NON-NLS-1$
}
}
- /*
- else {
- try {
- StringBuffer sb = new StringBuffer();
- List<ExtensionModule> extModules = getExtensionModules();
- boolean valid = false;
- for (ExtensionModule module:extModules) {
- sb.append("extensionjar:").append(module.getFullName()).append(";"); //$NON-NLS-1$ //$NON-NLS-2$
- valid = true;
- }
- if (valid) {
- classpath = sb.toString();
- ArrayList<URL> allExtensionModules = new ArrayList<URL>();
- URL[] contexts = getExtensionPath();
- for (URL context:contexts) {
- allExtensionModules.addAll(ExtensionModuleReader.resolveExtensionClasspath(classpath, context));
- }
- return allExtensionModules;
- }
- } catch (MetaMatrixComponentException e) {
- // ok to return null
- } catch (IOException e) {
- DQPEmbeddedPlugin.logError(e, "EmbeddedConfigurationService.udf_classspath_failure", new Object[] {}); //$NON-NLS-1$
- }
- }
- */
return null;
}
@@ -875,7 +849,7 @@
* @since 4.3
*/
public void saveConnectorType(ConnectorBindingType type) throws MetaMatrixComponentException {
- loadedConnectorTypes.put(type.getName(), addFullPropertyDefns(type));
+ loadedConnectorTypes.put(type.getName(), ServerConfigFileReader.resolvePropertyDefns(type, this.configurationModel));
// Also add binding type to the configuration and save.
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.connector_type_save", new Object[] {type.getName()}); //$NON-NLS-1$
@@ -928,7 +902,12 @@
if(udfFile != null && exists(udfFile)) {
List<URL> urls = getCommonExtensionClasspath();
try {
- this.udfSource = new UDFSource(udfFile, urls.toArray(new URL[urls.size()]));
+ if (urls == null || urls.isEmpty()) {
+ this.udfSource = new UDFSource(udfFile);
+ }
+ else {
+ this.udfSource = new UDFSource(udfFile, urls.toArray(new URL[urls.size()]));
+ }
FunctionLibraryManager.registerSource(this.udfSource);
DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.udf_load", new Object[] {udfFile, urls}); //$NON-NLS-1$
} catch (IOException e) {
@@ -1089,7 +1068,7 @@
for (Iterator it = def.getConnectorTypes().values().iterator(); it.hasNext();) {
ConnectorBindingType type= (ConnectorBindingType)it.next();
if (!loadedConnectorTypes.containsKey(type.getName())) {
- loadedConnectorTypes.put(type.getName(), addFullPropertyDefns(type));
+ loadedConnectorTypes.put(type.getName(), ServerConfigFileReader.resolvePropertyDefns(type, this.configurationModel));
}
}
@@ -1107,24 +1086,7 @@
}
}
- private ComponentType addFullPropertyDefns(ConnectorBindingType type) {
- BasicComponentType baseType = (BasicComponentType)type;
- Collection c = this.configurationModel.getAllComponentTypeDefinitions((ComponentTypeID)baseType.getID());
- // if the type is found in the configuration.xml, then add its prop-definitions; else look for parent
- if (c == null || c.isEmpty()) {
- // this means user has added a new connector type
- c = this.configurationModel.getAllComponentTypeDefinitions(type.getSuperComponentTypeID());
- }
-
- if (c != null && !c.isEmpty()) {
- Set<PropertyDefinition> defns = new HashSet<PropertyDefinition>();
- defns.addAll(c);
- defns.addAll(type.getComponentTypeDefinitions());
- baseType.setComponentTypeDefinitions(defns);
- }
- return baseType;
- }
/**
* Add the connnector binding with new deployment name
15 years, 7 months
teiid SVN: r868 - in trunk: connector-api/src/main/java/org/teiid/connector/basic and 46 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-06 16:38:38 -0400 (Wed, 06 May 2009)
New Revision: 868
Added:
trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/
trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/
trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/TestVisitors.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestComparableMetadataPushdown.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinPushdownRestrictions.java
trunk/test-integration/teiid/
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-metadata/src/main/java/com/metamatrix/connector/metadata/adapter/ObjectConnectorCapabilities.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/SimpleCapabilities.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/derby/DerbyCapabilities.java
trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mm/MMCapabilities.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/postgresql/PostgreSQLCapabilities.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-ldap/src/main/java/com/metamatrix/connector/ldap/IQueryToLdapSearchParser.java
trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java
trunk/connectors/connector-ldap/src/test/java/com/metamatrix/connector/ldap/TestIQueryToLdapSearchParser.java
trunk/connectors/connector-loopback/src/main/java/com/metamatrix/connector/loopback/LoopbackCapabilities.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/QueryExecutionImpl.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/DeleteVisitor.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java
trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/UpdateVisitor.java
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLCapabilities.java
trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLCapabilities.java
trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecCapabilities.java
trunk/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnectorCapabilities.java
trunk/connectors/sandbox/connector-yahoo/src/main/java/com/metamatrix/connector/yahoo/YahooCapabilities.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/BasicSourceCapabilities.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/plantree/NodeConstants.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/JoinRegion.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseDependent.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseJoinStrategy.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/RuleCopyCriteria.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlanJoins.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePushSelectCriteria.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/main/java/com/metamatrix/query/sql/lang/CompareCriteria.java
trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Criteria.java
trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/ElementCollectorVisitor.java
trunk/engine/src/main/java/com/metamatrix/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceCapabilitiesFinder.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAggregatePushdown.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAnsiJoinPushdown.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestDependentJoins.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestExpressionsInGroupBy.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestLimit.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptionalJoins.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestPartitionedJoinPlanning.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleMergeVirtual.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleRaiseNull.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestStoredProcedurePlanning.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestSubqueryPushdown.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestUnionPlanning.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/capabilities/TestBasicSourceCapabilities.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCapabilitiesUtil.java
trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCriteriaCapabilityValidatorVisitor.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestDependentJoins.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java
trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java
trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestCriteria.java
trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java
trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataObject.java
trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestElementImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/metadata/TestMetadataFactory.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceCapabilitiesFinder.java
trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestTPCR.java
Log:
TEIID-556 TEIID-103 TEIID-555 TEIID-553 TEIID-552 TEIID-203 TEIID-529 changes to simplify and expand the coverage of capabilities. Also added new abilities to the salesforce and ldap connectors.
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-06 17:19:14 UTC (rev 867)
+++ trunk/connector-api/src/main/java/org/teiid/connector/api/ConnectorCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -33,7 +33,27 @@
* supports.
*/
public interface ConnectorCapabilities {
-
+
+ public enum SupportedJoinCriteria {
+ /**
+ * Indicates that any supported criteria is allowed.
+ */
+ ANY,
+ /**
+ * Indicates that any simple comparison of elements is allowed.
+ */
+ THETA,
+ /**
+ * Indicates that only equality predicates of elements are allowed.
+ */
+ EQUI,
+ /**
+ * Indicates that only equality predicates between
+ * exactly one primary and foreign key is allowed per join.
+ */
+ KEY
+ }
+
/**
* Support indicates connector can accept queries with SELECT DISTINCT
* @since 3.1 SP2
@@ -41,22 +61,31 @@
boolean supportsSelectDistinct();
/**
- * Support indicates connector can accept literals in the SELECT clause
- * @since 4.1.2
+ * Support indicates connector can accept expressions other than element
+ * symbols in the SELECT clause. Specific supports for the expression
+ * type are still checked.
+ * @since 6.1.0
*/
- boolean supportsSelectLiterals();
+ boolean supportsSelectExpression();
/**
* Support indicates connector can accept groups with aliases
* @since 3.1 SP2
*/
boolean supportsAliasedGroup();
+
+ /**
+ * Get the supported join criteria. A null return value will be treated
+ * as {@link SupportedJoinCriteria#ANY}
+ * @since 6.1.0
+ */
+ SupportedJoinCriteria getSupportedJoinCriteria();
/**
- * Support indicates connector can accept joins
- * @since 3.1 SP2
+ * Support indicates connector can accept inner or cross joins
+ * @since 6.1.0
*/
- boolean supportsJoins();
+ boolean supportsInnerJoins();
/**
* Support indicates connector can accept self-joins where a
@@ -67,7 +96,7 @@
boolean supportsSelfJoins();
/**
- * Support indicates connector can accept right or left outer joins
+ * Support indicates connector can accept left outer joins
* @since 3.1 SP2
*/
boolean supportsOuterJoins();
@@ -86,67 +115,34 @@
boolean supportsInlineViews();
/**
- * Support indicates connector can accept a WHERE criteria on queries
- * @since 3.1 SP2
- */
- boolean supportsCriteria();
-
- /**
- * Support indicates connector accepts criteria of form (element BETWEEN constant AND constant)
+ * Support indicates connector accepts criteria of form (element BETWEEN constant AND constant)
+ * <br>NOT CURRENTLY USED - between is rewritten as compound compare criteria
* @since 4.0
*/
boolean supportsBetweenCriteria();
/**
- * Support indicates connector accepts criteria of form (element operator constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteria();
-
- /**
* Support indicates connector accepts criteria of form (element = constant)
* @since 3.1 SP2
*/
boolean supportsCompareCriteriaEquals();
/**
- * Support indicates connector accepts criteria of form (element <> constant)
+ * Support indicates connector accepts criteria of form (element <=|>= constant)
+ * <br>The query engine will may pushdown queries containing < or > if NOT is also
+ * supported.
* @since 3.1 SP2
*/
- boolean supportsCompareCriteriaNotEquals();
+ boolean supportsCompareCriteriaOrdered();
/**
- * Support indicates connector accepts criteria of form (element < constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaLessThan();
-
- /**
- * Support indicates connector accepts criteria of form (element <= constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaLessThanOrEqual();
-
- /**
- * Support indicates connector accepts criteria of form (element > constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaGreaterThan();
-
- /**
- * Support indicates connector accepts criteria of form (element >= constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaGreaterThanOrEqual();
-
- /**
* Support indicates connector accepts criteria of form (element LIKE constant)
* @since 3.1 SP2
*/
boolean supportsLikeCriteria();
-
+
/**
- * Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char) - CURRENTLY NOT USED
+ * Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)
* @since 3.1 SP2
*/
boolean supportsLikeCriteriaEscapeCharacter();
@@ -170,12 +166,6 @@
boolean supportsIsNullCriteria();
/**
- * Support indicates connector accepts logical criteria connected by AND
- * @since 3.1 SP2
- */
- boolean supportsAndCriteria();
-
- /**
* Support indicates connector accepts logical criteria connected by OR
* @since 3.1 SP2
*/
@@ -194,12 +184,6 @@
boolean supportsExistsCriteria();
/**
- * Support indicates connector accepts quantified subquery comparison criteria
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteria();
-
- /**
* Support indicates connector accepts the quantified comparison criteria that
* use SOME
* @since 4.0
@@ -219,14 +203,19 @@
* @since 3.1 SP2
*/
boolean supportsOrderBy();
-
- /**
- * Support indicates connector accepts GROUP BY and HAVING clauses as well as
- * aggregate functions in the SELECT clause.
- * @since 3.1 SP2
+
+ /**
+ * Whether the source supports an explicit GROUP BY clause
+ * @since 6.1
*/
- boolean supportsAggregates();
+ boolean supportsGroupBy();
+ /**
+ * Whether the source supports the HAVING clause
+ * @since 6.1
+ */
+ boolean supportsHaving();
+
/**
* Support indicates connector can accept the SUM aggregate function
* @since 3.1 SP2
@@ -277,7 +266,7 @@
boolean supportsScalarSubqueries();
/**
- * Support indicates connector can accept correalted subqueries wherever subqueries
+ * Support indicates connector can accept correlated subqueries wherever subqueries
* are accepted
* @since 4.0
*/
@@ -286,6 +275,7 @@
/**
* Support indicates connector can accept queries with non-searched
* CASE <expression> WHEN <expression> ... END
+ * <br>NOT CURRENTLY USED - case is pushed down as searched case
* @since 4.0
*/
boolean supportsCaseExpressions();
@@ -297,12 +287,6 @@
boolean supportsSearchedCaseExpressions();
/**
- * Support indicates that the connector supports scalar functions.
- * @since 3.1 SP3
- */
- boolean supportsScalarFunctions();
-
- /**
* Support indicates that the connector supports the UNION of two queries.
* @since 4.2
*/
@@ -344,9 +328,7 @@
* <p>Support indicates that the connector supports functions in GROUP BY, such as:
* <code>SELECT dayofmonth(theDate), COUNT(*) FROM table GROUP BY dayofmonth(theDate)</code></p>
*
- * <p>This capability requires both {@link #supportsAggregates()} and
- * {@link #supportsScalarFunctions()} to be true as well to take effective.</p>
- *
+ * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
* @since 5.0
*/
boolean supportsFunctionsInGroupBy();
@@ -394,11 +376,5 @@
* @since 6.0
*/
boolean supportsBulkInsert();
-
- /**
- * Whether the source supports an explicit GROUP BY clause
- * @since 6.0
- */
- boolean supportsGroupBy();
-
+
}
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-06 17:19:14 UTC (rev 867)
+++ trunk/connector-api/src/main/java/org/teiid/connector/basic/BasicConnectorCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -50,14 +50,6 @@
return false;
}
- /**
- * @see org.teiid.connector.api.ConnectorCapabilities#supportsSelectLiterals()
- * @since 4.2
- */
- public boolean supportsSelectLiterals() {
- return false;
- }
-
/*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsAliasedGroup()
*/
@@ -66,13 +58,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsJoins()
- */
- public boolean supportsJoins() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsSelfJoins()
*/
public boolean supportsSelfJoins() {
@@ -94,13 +79,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsBetweenCriteria()
*/
public boolean supportsBetweenCriteria() {
@@ -108,13 +86,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -122,41 +93,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaNotEquals()
- */
- public boolean supportsCompareCriteriaNotEquals() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaLessThan()
- */
- public boolean supportsCompareCriteriaLessThan() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaLessThanOrEqual()
- */
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaGreaterThan()
- */
- public boolean supportsCompareCriteriaGreaterThan() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaGreaterThanOrEqual()
- */
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteria()
*/
public boolean supportsLikeCriteria() {
@@ -192,13 +128,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsOrCriteria()
*/
public boolean supportsOrCriteria() {
@@ -220,13 +149,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteria()
- */
- public boolean supportsQuantifiedCompareCriteria() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaSome()
*/
public boolean supportsQuantifiedCompareCriteriaSome() {
@@ -248,13 +170,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregates()
- */
- public boolean supportsAggregates() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesSum()
*/
public boolean supportsAggregatesSum() {
@@ -331,19 +246,12 @@
return false;
}
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsScalarFunctions()
- */
- public boolean supportsScalarFunctions() {
- return false;
- }
-
/**
* Return null to indicate no functions are supported.
* @return null
* @see org.teiid.connector.api.ConnectorCapabilities#getSupportedFunctions()
*/
- public List getSupportedFunctions() {
+ public List<String> getSupportedFunctions() {
return null;
}
@@ -435,4 +343,30 @@
public boolean supportsGroupBy() {
return false;
}
+
+ @Override
+ public boolean supportsHaving() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInnerJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSelectExpression() {
+ return false;
+ }
+
+ @Override
+ public SupportedJoinCriteria getSupportedJoinCriteria() {
+ return SupportedJoinCriteria.ANY;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return false;
+ }
+
}
Modified: trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/adapter/ObjectConnectorCapabilities.java
===================================================================
--- trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/adapter/ObjectConnectorCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/adapter/ObjectConnectorCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -44,20 +44,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -72,22 +58,7 @@
return true;
}
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
/**
- * @see org.teiid.connector.basic.BasicConnectorCapabilities#supportsScalarFunctions()
- * @since 4.3
- */
- public boolean supportsScalarFunctions() {
- return true;
- }
-
- /**
* @see org.teiid.connector.basic.BasicConnectorCapabilities#getSupportedFunctions()
* @since 4.3
*/
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -66,13 +66,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregates()
- */
- public boolean supportsAggregates() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesAvg()
*/
public boolean supportsAggregatesAvg() {
@@ -129,13 +122,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsBetweenCriteria()
*/
public boolean supportsBetweenCriteria() {
@@ -150,13 +136,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -164,41 +143,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThan()
- */
- public boolean supportsCompareCriteriaGreaterThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThanOrEqual()
- */
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThan()
- */
- public boolean supportsCompareCriteriaLessThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThanOrEqual()
- */
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaNotEquals()
- */
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCorrelatedSubqueries()
*/
public boolean supportsCorrelatedSubqueries() {
@@ -206,13 +150,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsExistsCriteria()
*/
public boolean supportsExistsCriteria() {
@@ -248,13 +185,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsJoins()
- */
- public boolean supportsJoins() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteria()
*/
public boolean supportsLikeCriteria() {
@@ -297,13 +227,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteria()
- */
- public boolean supportsQuantifiedCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
*/
public boolean supportsQuantifiedCompareCriteriaAll() {
@@ -311,13 +234,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsScalarFunctions()
- */
- public boolean supportsScalarFunctions() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsScalarSubqueries()
*/
public boolean supportsScalarSubqueries() {
@@ -339,13 +255,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSelectLiterals()
- */
- public boolean supportsSelectLiterals() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsSelfJoins()
*/
public boolean supportsSelfJoins() {
@@ -390,5 +299,30 @@
public boolean supportsBatchedUpdates() {
return true;
}
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
+
+ @Override
+ public SupportedJoinCriteria getSupportedJoinCriteria() {
+ return SupportedJoinCriteria.ANY;
+ }
+
+ @Override
+ public boolean supportsHaving() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInnerJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelectExpression() {
+ return true;
+ }
}
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/SimpleCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -24,16 +24,14 @@
import java.util.List;
-import org.teiid.connector.api.ConnectorCapabilities;
-
/**
* This is a "simple" capabilities class that allows criteria but no
* complicated joins, subqueries, etc to be passed to the connector.
* This capabilities class may come in handy for testing and for
* sources that support JDBC but don't support extended JDBC capabilities.
*/
-public class SimpleCapabilities extends JDBCCapabilities implements ConnectorCapabilities {
+public class SimpleCapabilities extends JDBCCapabilities {
public SimpleCapabilities() {
// Max acceptable by all BQT dbs (Sybase=250, Oracle=1000)
@@ -41,20 +39,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -62,48 +46,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaGreaterThan()
- */
- public boolean supportsCompareCriteriaGreaterThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaGreaterThanOrEqual()
- */
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaLessThan()
- */
- public boolean supportsCompareCriteriaLessThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaLessThanOrEqual()
- */
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaNotEquals()
- */
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsInCriteria()
*/
public boolean supportsInCriteria() {
@@ -118,13 +60,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsJoins()
- */
- public boolean supportsJoins() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteria()
*/
public boolean supportsLikeCriteria() {
@@ -152,14 +87,6 @@
return true;
}
- /**
- * @see org.teiid.connector.api.ConnectorCapabilities#supportsSelectLiterals()
- * @since 4.2
- */
- public boolean supportsSelectLiterals() {
- return false;
- }
-
/*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsAliasedGroup()
*/
@@ -218,13 +145,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteria()
- */
- public boolean supportsQuantifiedCompareCriteria() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaSome()
*/
public boolean supportsQuantifiedCompareCriteriaSome() {
@@ -246,13 +166,6 @@
}
/*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregates()
- */
- public boolean supportsAggregates() {
- return false;
- }
-
- /*
* @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesSum()
*/
public boolean supportsAggregatesSum() {
@@ -329,13 +242,6 @@
return false;
}
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsScalarFunctions()
- */
- public boolean supportsScalarFunctions() {
- return false;
- }
-
/**
* Return null to indicate no functions are supported.
* @return null
@@ -349,19 +255,7 @@
return false;
}
- public boolean supportsOrderByInInlineViews() {
- return false;
- }
-
/**
- * @see org.teiid.connector.api.ConnectorCapabilities#supportsUnionOrderBy()
- * @since 4.2
- */
- public boolean supportsUnionOrderBy() {
- return false;
- }
-
- /**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsUnions()
* @since 4.2
*/
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/db2/DB2Capabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -114,10 +114,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return true;
- }
-
/**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
* @since 5.0
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/derby/DerbyCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/derby/DerbyCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/derby/DerbyCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -152,15 +152,6 @@
return true;
}
- /**
- * UNION is supported, but not UNIONs with a final ORDER BY.
- * @see org.teiid.connector.api.ConnectorCapabilities#supportsUnionOrderBy()
- * @since 5.0
- */
- public boolean supportsUnionOrderBy() {
- return false;
- }
-
@Override
public boolean supportsSetQueryOrderBy() {
return false;
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mm/MMCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mm/MMCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/mm/MMCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -139,10 +139,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return true;
- }
-
/**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
* @since 5.0
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/oracle/OracleCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -115,10 +115,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return true;
- }
-
/**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
* @since 5.0
Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/postgresql/PostgreSQLCapabilities.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/postgresql/PostgreSQLCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/postgresql/PostgreSQLCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -248,10 +248,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return true;
- }
-
public boolean supportsRowLimit() {
return true;
}
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sqlserver/SqlServerCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -118,10 +118,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return false;
- }
-
/**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
* @since 5.0
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/sybase/SybaseCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -98,10 +98,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return false;
- }
-
/**
* @see org.teiid.connector.api.ConnectorCapabilities#supportsFunctionsInGroupBy()
* @since 5.0
Modified: trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/IQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/IQueryToLdapSearchParser.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/IQueryToLdapSearchParser.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -29,8 +29,6 @@
* This class should remove all the MMX-specific stuff, and turn it into something any
* LDAP implementation can understand.
*
- * TODO: Escape all special characters according to http://www.ietf.org/rfc/rfc2254.txt.
- *
*/
package com.metamatrix.connector.ldap;
@@ -66,6 +64,7 @@
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.IQuery;
@@ -463,6 +462,7 @@
if(criteria == null) {
filterList.add("(objectClass=*)"); //$NON-NLS-1$
}
+ boolean isNegated = false;
// Recursive case: compound criteria
if(criteria instanceof ICompoundCriteria) {
logger.logTrace("Parsing compound criteria."); //$NON-NLS-1$
@@ -485,6 +485,8 @@
logger.logTrace("Parsing compare criteria."); //$NON-NLS-1$
ICompareCriteria.Operator op = ((ICompareCriteria) criteria).getOperator();
+ isNegated = op == Operator.NE || op == Operator.GT || op == Operator.LT;
+
IExpression lhs = ((ICompareCriteria) criteria).getLeftExpression();
IExpression rhs = ((ICompareCriteria) criteria).getRightExpression();
@@ -503,6 +505,7 @@
// Base case
} else if(criteria instanceof ILikeCriteria) {
logger.logTrace("Parsing LIKE criteria."); //$NON-NLS-1$
+ isNegated = ((ILikeCriteria) criteria).isNegated();
// Convert LIKE to Equals, where any "%" symbol is replaced with "*".
ICompareCriteria.Operator op = Operator.EQ;
IExpression lhs = ((ILikeCriteria) criteria).getLeftExpression();
@@ -516,12 +519,23 @@
// Base case
} else if(criteria instanceof IInCriteria) {
logger.logTrace("Parsing IN criteria."); //$NON-NLS-1$
+ isNegated = ((IInCriteria) criteria).isNegated();
IExpression lhs = ((IInCriteria)criteria).getLeftExpression();
List rhsList = ((IInCriteria)criteria).getRightExpressions();
// Recursively add each IN expression to the filter list.
processInCriteriaList(filterList, rhsList, lhs);
+ } else if (criteria instanceof INotCriteria) {
+ logger.logTrace("Parsing NOT criteria."); //$NON-NLS-1$
+ isNegated = true;
+ filterList = getSearchFilterFromWhereClause(((INotCriteria)criteria).getCriteria(), filterList);
}
+ if (isNegated) {
+ filterList.add(0, "("); //$NON-NLS-1$
+ filterList.add(1, "!"); //$NON-NLS-1$
+ filterList.add(")"); //$NON-NLS-1$
+ }
+
return filterList;
}
@@ -554,10 +568,6 @@
// Push the comparison statement into the list, e.g.:
// (sn=Mike)
// !(empNum>=100)
- if(op == Operator.NE || op == Operator.GT || op == Operator.LT) {
- filterList.add("("); //$NON-NLS-1$
- filterList.add("!"); //$NON-NLS-1$
- }
filterList.add("("); //$NON-NLS-1$
filterList.add(lhs);
@@ -581,9 +591,6 @@
}
filterList.add(rhs);
filterList.add(")"); //$NON-NLS-1$
- if(op == Operator.NE || op == Operator.GT || op == Operator.LT) {
- filterList.add(")"); //$NON-NLS-1$
- }
}
/**
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-ldap/src/main/java/com/metamatrix/connector/ldap/LDAPConnectorCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -33,42 +33,10 @@
this.maxInCriteriaSize = maxInCriteriaSize;
}
- public boolean supportsAndCriteria() {
+ public boolean supportsCompareCriteriaEquals() {
return true;
}
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- public boolean supportsCompareCriteriaGreaterThan() {
- return true;
- }
-
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return true;
- }
-
- public boolean supportsCompareCriteriaLessThan() {
- return true;
- }
-
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return true;
- }
-
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
-
- public boolean supportsCriteria() {
- return true;
- }
-
public boolean supportsInCriteria() {
return true;
}
@@ -99,5 +67,15 @@
// won't do it alone.
return false;
}
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
}
Modified: trunk/connectors/connector-ldap/src/test/java/com/metamatrix/connector/ldap/TestIQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/connector-ldap/src/test/java/com/metamatrix/connector/ldap/TestIQueryToLdapSearchParser.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-ldap/src/test/java/com/metamatrix/connector/ldap/TestIQueryToLdapSearchParser.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -159,6 +159,53 @@
}
+ /**
+ * Test a Query with a criteria
+ */
+ public void testEscaping() throws Exception {
+ LDAPSearchDetails searchDetails = helpGetSearchDetails("SELECT UserID, Name FROM LdapModel.People WHERE Name = 'R*'"); //$NON-NLS-1$
+
+ //-----------------------------------
+ // Set Expected SearchDetails Values
+ //-----------------------------------
+ String expectedContextName = "ou=people,dc=metamatrix,dc=com"; //$NON-NLS-1$
+ String expectedContextFilter = "(cn=R\\2a)"; //$NON-NLS-1$
+
+ List expectedAttrNameList = new ArrayList();
+ expectedAttrNameList.add("uid"); //$NON-NLS-1$
+ expectedAttrNameList.add("cn"); //$NON-NLS-1$
+
+ long expectedCountLimit = -1;
+ int expectedSearchScope = SearchControls.ONELEVEL_SCOPE;
+ SortKey[] expectedSortKeys = null;
+
+ helpTestSearchDetails(searchDetails, expectedContextName, expectedContextFilter, expectedAttrNameList,
+ expectedCountLimit, expectedSearchScope, expectedSortKeys);
+
+ }
+
+ public void testNot() throws Exception {
+ LDAPSearchDetails searchDetails = helpGetSearchDetails("SELECT UserID, Name FROM LdapModel.People WHERE not (Name like 'R%' or Name like 'S%')"); //$NON-NLS-1$
+
+ //-----------------------------------
+ // Set Expected SearchDetails Values
+ //-----------------------------------
+ String expectedContextName = "ou=people,dc=metamatrix,dc=com"; //$NON-NLS-1$
+ String expectedContextFilter = "(!(|(cn=R*)(cn=S*)))"; //$NON-NLS-1$
+
+ List expectedAttrNameList = new ArrayList();
+ expectedAttrNameList.add("uid"); //$NON-NLS-1$
+ expectedAttrNameList.add("cn"); //$NON-NLS-1$
+
+ long expectedCountLimit = -1;
+ int expectedSearchScope = SearchControls.ONELEVEL_SCOPE;
+ SortKey[] expectedSortKeys = null;
+
+ helpTestSearchDetails(searchDetails, expectedContextName, expectedContextFilter, expectedAttrNameList,
+ expectedCountLimit, expectedSearchScope, expectedSortKeys);
+
+ }
+
public void testGT() throws Exception {
LDAPSearchDetails searchDetails = helpGetSearchDetails("SELECT UserID, Name FROM LdapModel.People WHERE Name > 'R'"); //$NON-NLS-1$
@@ -215,7 +262,6 @@
return searchDetails;
}
-
public static FakeMetadataFacade exampleLdap() {
// Create models
FakeMetadataObject ldapModel = FakeMetadataFactory.createPhysicalModel("LdapModel"); //$NON-NLS-1$
Modified: trunk/connectors/connector-loopback/src/main/java/com/metamatrix/connector/loopback/LoopbackCapabilities.java
===================================================================
--- trunk/connectors/connector-loopback/src/main/java/com/metamatrix/connector/loopback/LoopbackCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-loopback/src/main/java/com/metamatrix/connector/loopback/LoopbackCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -42,13 +42,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsExecutionMode(int)
- */
- public boolean supportsExecutionMode(int executionMode) {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
*/
public List getSupportedFunctions() {
@@ -74,13 +67,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregates()
- */
- public boolean supportsAggregates() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesAvg()
*/
public boolean supportsAggregatesAvg() {
@@ -137,13 +123,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsBetweenCriteria()
*/
public boolean supportsBetweenCriteria() {
@@ -158,13 +137,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -172,41 +144,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThan()
- */
- public boolean supportsCompareCriteriaGreaterThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThanOrEqual()
- */
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThan()
- */
- public boolean supportsCompareCriteriaLessThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThanOrEqual()
- */
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaNotEquals()
- */
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCorrelatedSubqueries()
*/
public boolean supportsCorrelatedSubqueries() {
@@ -214,13 +151,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsExistsCriteria()
*/
public boolean supportsExistsCriteria() {
@@ -256,13 +186,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsJoins()
- */
- public boolean supportsJoins() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteria()
*/
public boolean supportsLikeCriteria() {
@@ -305,13 +228,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteria()
- */
- public boolean supportsQuantifiedCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
*/
public boolean supportsQuantifiedCompareCriteriaAll() {
@@ -319,20 +235,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAny()
- */
- public boolean supportsQuantifiedCompareCriteriaAny() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsScalarFunctions()
- */
- public boolean supportsScalarFunctions() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsScalarSubqueries()
*/
public boolean supportsScalarSubqueries() {
@@ -364,10 +266,6 @@
return true;
}
- public boolean supportsOrderByInInlineViews() {
- return true;
- }
-
public boolean supportsQuantifiedCompareCriteriaSome() {
return true;
}
@@ -377,10 +275,10 @@
}
@Override
- public boolean supportsSelectLiterals() {
+ public boolean supportsSelectExpression() {
return true;
}
-
+
@Override
public boolean supportsSetQueryOrderBy() {
return true;
@@ -390,4 +288,30 @@
public boolean supportsUnions() {
return true;
}
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInnerJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsHaving() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+
}
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-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/SalesforceCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -45,31 +45,11 @@
}
- @Override
- public boolean supportsScalarFunctions() {
- return true;
- }
-
- public boolean supportsCompareCriteria() {
+ public boolean supportsCompareCriteriaEquals() {
return true;
}
-
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- public boolean supportsCriteria() {
- return true;
- }
-
-
- public boolean supportsAndCriteria() {
- return true;
- }
-
-
public boolean supportsInCriteria() {
return true;
}
@@ -89,23 +69,24 @@
return false;
}
- public boolean supportsCompareCriteriaGreaterThan() {
+ @Override
+ public boolean supportsAggregatesCountStar() {
return true;
}
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
+ @Override
+ public boolean supportsNotCriteria() {
return true;
}
-
- public boolean supportsCompareCriteriaLessThan() {
+
+ @Override
+ public boolean supportsOrCriteria() {
return true;
}
-
- public boolean supportsCompareCriteriaLessThanOrEqual() {
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
return true;
}
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/QueryExecutionImpl.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/QueryExecutionImpl.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -24,6 +24,7 @@
import java.sql.Timestamp;
import java.text.ParseException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -37,6 +38,7 @@
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.api.ResultSetExecution;
import org.teiid.connector.basic.BasicExecution;
+import org.teiid.connector.language.IAggregate;
import org.teiid.connector.language.IQueryCommand;
import org.teiid.connector.metadata.runtime.Element;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
@@ -119,6 +121,11 @@
@Override
public List next() throws ConnectorException, DataNotAvailableException {
while (results != null) {
+ if (query.getProjectedQuery().getSelect().getSelectSymbols().get(0).getExpression() instanceof IAggregate) {
+ List<?> result = Arrays.asList(results.getSize());
+ results = null;
+ return result;
+ }
if (i < results.getSize()) {
SObject sObject = results.getRecords(i++);
org.apache.axis.message.MessageElement[] fields = sObject.get_any();
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/CriteriaVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -25,10 +25,13 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.language.ICompareCriteria;
+import org.teiid.connector.language.ICompoundCriteria;
+import org.teiid.connector.language.ICriteria;
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IFunction;
@@ -36,6 +39,7 @@
import org.teiid.connector.language.IInCriteria;
import org.teiid.connector.language.ILikeCriteria;
import org.teiid.connector.language.ILiteral;
+import org.teiid.connector.language.INotCriteria;
import org.teiid.connector.language.ICompareCriteria.Operator;
import org.teiid.connector.metadata.runtime.Element;
import org.teiid.connector.metadata.runtime.Group;
@@ -98,7 +102,6 @@
@Override
public void visit( ILikeCriteria criteria ) {
- super.visit(criteria);
try {
if (isIdColumn(criteria.getLeftExpression())) {
ConnectorException e = new ConnectorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
@@ -112,14 +115,58 @@
} catch (ConnectorException e) {
exceptions.add(e);
}
+ boolean negated = criteria.isNegated();
+ criteria.setNegated(false);
criteriaList.add(criteria.toString());
+ if (negated) {
+ addNot();
+ criteria.setNegated(true);
+ }
// don't check if it's ID, Id LIKE '123%' still requires a query
setHasCriteria(true, false);
}
+
+ @Override
+ public void visit(ICompoundCriteria obj) {
+ List<List<String>> savedCriteria = new LinkedList<List<String>>();
+ for (ICriteria crit : obj.getCriteria()) {
+ super.visitNode(crit);
+ if (!this.criteriaList.isEmpty()) {
+ savedCriteria.add(this.criteriaList);
+ }
+ this.criteriaList = new LinkedList<String>();
+ }
+ if (savedCriteria.size() == 1) {
+ this.criteriaList = savedCriteria.get(0);
+ } else if (savedCriteria.size() > 1){
+ for (Iterator<List<String>> listIter = savedCriteria.iterator(); listIter.hasNext();) {
+ this.criteriaList.add(OPEN);
+ this.criteriaList.addAll(listIter.next());
+ this.criteriaList.add(CLOSE);
+ if (listIter.hasNext()) {
+ this.criteriaList.add(SPACE);
+ this.criteriaList.add(obj.getOperator().toString());
+ this.criteriaList.add(SPACE);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void visit(INotCriteria obj) {
+ super.visit(obj);
+ addNot();
+ }
+ private void addNot() {
+ if (!criteriaList.isEmpty()) {
+ criteriaList.add(0, "NOT ("); //$NON-NLS-1$
+ criteriaList.add(CLOSE);
+ }
+ }
+
@Override
public void visit( IInCriteria criteria ) {
- super.visit(criteria);
try {
IExpression lExpr = criteria.getLeftExpression();
String columnName = lExpr.toString();
@@ -129,7 +176,7 @@
&& (column.getNativeType().equals("multipicklist") || column.getNativeType().equals("restrictedmultiselectpicklist"))) {
appendMultiselectIn(column, criteria);
} else {
- appendCriteria(criteriaList, criteria);
+ appendCriteria(criteria);
}
}
setHasCriteria(true, isIdColumn(criteria.getLeftExpression()));
@@ -139,7 +186,6 @@
}
public void parseFunction( IFunction func ) {
- super.visit(func);
String functionName = func.getName();
try {
if (functionName.equalsIgnoreCase("includes")) {
@@ -264,12 +310,14 @@
}
}
- private void appendCriteria( List criteriaList,
- IInCriteria criteria ) throws ConnectorException {
+ private void appendCriteria( IInCriteria criteria ) throws ConnectorException {
StringBuffer queryString = new StringBuffer();
queryString.append(' ');
queryString.append(getValue(criteria.getLeftExpression()));
queryString.append(' ');
+ if (criteria.isNegated()) {
+ queryString.append("NOT ");
+ }
queryString.append("IN");
queryString.append('(');
Element column = ((IElement)criteria.getLeftExpression()).getMetadataObject();
@@ -382,4 +430,14 @@
public String getTableName() throws ConnectorException {
return table.getNameInSource();
}
+
+ protected void addCriteriaString(StringBuffer result) {
+ if(hasCriteria()) {
+ result.append(WHERE).append(SPACE);
+ for (String string : criteriaList) {
+ result.append(string);
+ }
+ result.append(SPACE);
+ }
+ }
}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/DeleteVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/DeleteVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/DeleteVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -59,18 +59,7 @@
result.append("Id").append(SPACE);
result.append(FROM).append(SPACE);
result.append(table.getNameInSource()).append(SPACE);
- result.append(WHERE).append(SPACE);
- boolean first = true;
- Iterator<String> iter = criteriaList.iterator();
- while(iter.hasNext()) {
- String criterion = (String) iter.next();
- if(first) {
- result.append(criterion).append(SPACE);
- first = false;
- } else {
- result.append("AND").append(SPACE).append(criterion).append(SPACE);;
- }
- }
+ addCriteriaString(result);
return result.toString();
}
}
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/SelectVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -27,6 +27,7 @@
import java.util.Map;
import org.teiid.connector.api.ConnectorException;
+import org.teiid.connector.language.IAggregate;
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IExpression;
import org.teiid.connector.language.IFrom;
@@ -76,7 +77,7 @@
boolean firstTime = true;
int index = 0;
while (symbolIter.hasNext()) {
- ISelectSymbol symbol = (ISelectSymbol) symbolIter.next();
+ ISelectSymbol symbol = symbolIter.next();
// get the name in source
IExpression expression = symbol.getExpression();
if (expression instanceof IElement) {
@@ -99,6 +100,8 @@
firstTime = false;
}
selectSymbols.append(nameInSource);
+ } else if (expression instanceof IAggregate) {
+ selectSymbols.append("count()"); //$NON-NLS-1$
}
++index;
}
@@ -147,20 +150,7 @@
result.append(selectSymbols).append(SPACE);
result.append(FROM).append(SPACE);
result.append(table.getNameInSource()).append(SPACE);
- if(hasCriteria()) {
- result.append(WHERE).append(SPACE);
- boolean first = true;
- Iterator<String> iter = criteriaList.iterator();
- while(iter.hasNext()) {
- String criterion = iter.next();
- if(first) {
- result.append(criterion).append(SPACE);
- first = false;
- } else {
- result.append("AND").append(SPACE).append(criterion).append(SPACE);;
- }
- }
- }
+ addCriteriaString(result);
//result.append(orderByClause).append(SPACE);
result.append(limitClause);
Util.validateQueryLength(result);
Modified: trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/UpdateVisitor.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/UpdateVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-salesforce/src/main/java/com/metamatrix/connector/salesforce/execution/visitors/UpdateVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -61,18 +61,8 @@
result.append("Id").append(SPACE);
result.append(FROM).append(SPACE);
result.append(table.getNameInSource()).append(SPACE);
- result.append(WHERE).append(SPACE);
- boolean first = true;
- Iterator<String> iter = criteriaList.iterator();
- while(iter.hasNext()) {
- String criterion = iter.next();
- if(first) {
- result.append(criterion).append(SPACE);
- first = false;
- } else {
- result.append("AND").append(SPACE).append(criterion).append(SPACE);;
- }
- }
+ addCriteriaString(result);
return result.toString();
}
+
}
Added: trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/TestVisitors.java
===================================================================
--- trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/TestVisitors.java (rev 0)
+++ trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/TestVisitors.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -0,0 +1,109 @@
+/*
+ * 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.connector.salesforce.execution.visitors;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.teiid.connector.language.IQuery;
+
+import com.metamatrix.cdk.api.TranslationUtility;
+import com.metamatrix.common.types.DataTypeManager;
+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 TestVisitors {
+
+ public static FakeMetadataFacade exampleSalesforce() {
+ // Create models
+ FakeMetadataObject salesforceModel = FakeMetadataFactory.createPhysicalModel("SalesforceModel"); //$NON-NLS-1$
+
+ // Create physical groups
+ FakeMetadataObject table = FakeMetadataFactory.createPhysicalGroup("SalesforceModel.Account", salesforceModel); //$NON-NLS-1$
+ table.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, "Account"); //$NON-NLS-1$
+ table.setExtensionProp("Supports Query", Boolean.TRUE.toString()); //$NON-NLS-1$
+ // Create physical elements
+ String[] elemNames = new String[] {
+ "AccountID", "Name", "Stuff" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ };
+ String[] elemTypes = new String[] {
+ DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.STRING
+ };
+
+ List<FakeMetadataObject> cols = FakeMetadataFactory.createElements(table, elemNames, elemTypes);
+ cols.get(2).putProperty(FakeMetadataObject.Props.NATIVE_TYPE, "multipicklist"); //$NON-NLS-1$
+ cols.get(2).putProperty(FakeMetadataObject.Props.SEARCHABLE_COMPARE, false);
+ cols.get(2).putProperty(FakeMetadataObject.Props.SEARCHABLE_LIKE, true);
+ // Set name in source on each column
+ String[] nameInSource = new String[] {
+ "id", "AccountName", "Stuff" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ };
+ for(int i=0; i<2; i++) {
+ FakeMetadataObject obj = cols.get(i);
+ obj.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, nameInSource[i]);
+ }
+
+ // Add all objects to the store
+ FakeMetadataStore store = new FakeMetadataStore();
+ store.addObject(salesforceModel);
+ store.addObject(table);
+ store.addObjects(cols);
+
+ // Create the facade from the store
+ return new FakeMetadataFacade(store);
+ }
+
+ private static TranslationUtility translationUtility = new TranslationUtility(exampleSalesforce());
+
+ @Test public void testOr() throws Exception {
+ IQuery command = (IQuery)translationUtility.parseCommand("select * from Account where Name = 'foo' or Stuff = 'bar'"); //$NON-NLS-1$
+ SelectVisitor visitor = new SelectVisitor(translationUtility.createRuntimeMetadata());
+ visitor.visit(command);
+ assertEquals("SELECT id, AccountName, Stuff FROM Account WHERE (AccountName = 'foo') OR (Stuff = 'bar')", visitor.getQuery().toString().trim()); //$NON-NLS-1$
+ }
+
+ @Test public void testNot() throws Exception {
+ IQuery command = (IQuery)translationUtility.parseCommand("select * from Account where not (Name = 'foo' and Stuff = 'bar')"); //$NON-NLS-1$
+ SelectVisitor visitor = new SelectVisitor(translationUtility.createRuntimeMetadata());
+ visitor.visit(command);
+ assertEquals("SELECT id, AccountName, Stuff FROM Account WHERE NOT ((AccountName = 'foo') AND (Stuff = 'bar'))", visitor.getQuery().toString().trim()); //$NON-NLS-1$
+ }
+
+ @Test public void testCountStart() throws Exception {
+ IQuery command = (IQuery)translationUtility.parseCommand("select count(*) from Account"); //$NON-NLS-1$
+ SelectVisitor visitor = new SelectVisitor(translationUtility.createRuntimeMetadata());
+ visitor.visit(command);
+ assertEquals("SELECT count() FROM Account", visitor.getQuery().toString().trim()); //$NON-NLS-1$
+ }
+
+ @Test public void testNotLike() throws Exception {
+ IQuery command = (IQuery)translationUtility.parseCommand("select * from Account where Name not like '%foo' or Stuff = 'bar'"); //$NON-NLS-1$
+ SelectVisitor visitor = new SelectVisitor(translationUtility.createRuntimeMetadata());
+ visitor.visit(command);
+ assertEquals("SELECT id, AccountName, Stuff FROM Account WHERE (NOT (Account.AccountName LIKE '%foo')) OR (Stuff = 'bar')", visitor.getQuery().toString().trim()); //$NON-NLS-1$
+ }
+
+}
Property changes on: trunk/connectors/connector-salesforce/src/test/java/com/metamatrix/connector/salesforce/execution/visitors/TestVisitors.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLCapabilities.java
===================================================================
--- trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/XMLCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -45,26 +45,11 @@
}
- public final boolean supportsCompareCriteria() {
- return true;
- }
-
-
public final boolean supportsCompareCriteriaEquals() {
return true;
}
- public final boolean supportsCriteria() {
- return true;
- }
-
-
- public final boolean supportsAndCriteria() {
- return true;
- }
-
-
public final boolean supportsInCriteria() {
return true;
}
Modified: trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLCapabilities.java
===================================================================
--- trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/connector-xml/src/test/java/com/metamatrix/connector/xml/base/TestXMLCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -50,14 +50,6 @@
assertEquals(Integer.MAX_VALUE, m_caps.getMaxInCriteriaSize());
}
- public void testSupportsCriteria() {
- assertTrue(m_caps.supportsCriteria());
- }
-
- public void testSupportsCompareCriteria() {
- assertTrue(m_caps.supportsCompareCriteria());
- }
-
public void testSupportsCompareCriteriaEquals() {
assertTrue(m_caps.supportsCompareCriteriaEquals());
}
@@ -66,10 +58,6 @@
assertTrue(m_caps.supportsInCriteria());
}
- public void testSupportsAndCriteria() {
- assertTrue(m_caps.supportsAndCriteria());
- }
-
public void testXMLCapabilities() {
XMLCapabilities caps = new XMLCapabilities();
assertNotNull(caps);
@@ -86,16 +74,12 @@
assertFalse(m_caps.supportsSelectDistinct());
}
- public void testSupportsSelectLiterals() {
- assertFalse(m_caps.supportsSelectLiterals());
- }
-
public void testSupportsAliasedGroup() {
assertFalse(m_caps.supportsAliasedGroup());
}
public void testSupportsJoins() {
- assertFalse(m_caps.supportsJoins());
+ assertFalse(m_caps.supportsInnerJoins());
}
public void testSupportsSelfJoins() {
@@ -114,26 +98,6 @@
assertFalse(m_caps.supportsBetweenCriteria());
}
- public void testSupportsCompareCriteriaNotEquals() {
- assertFalse(m_caps.supportsCompareCriteriaNotEquals());
- }
-
- public void testSupportsCompareCriteriaLessThan() {
- assertFalse(m_caps.supportsCompareCriteriaLessThan());
- }
-
- public void testSupportsCompareCriteriaLessThanOrEqual() {
- assertFalse(m_caps.supportsCompareCriteriaLessThanOrEqual());
- }
-
- public void testSupportsCompareCriteriaGreaterThan() {
- assertFalse(m_caps.supportsCompareCriteriaGreaterThan());
- }
-
- public void testSupportsCompareCriteriaGreaterThanOrEqual() {
- assertFalse(m_caps.supportsCompareCriteriaGreaterThanOrEqual());
- }
-
public void testSupportsLikeCriteria() {
assertFalse(m_caps.supportsLikeCriteria());
}
@@ -162,10 +126,6 @@
assertFalse(m_caps.supportsExistsCriteria());
}
- public void testSupportsQuantifiedCompareCriteria() {
- assertFalse(m_caps.supportsQuantifiedCompareCriteria());
- }
-
public void testSupportsQuantifiedCompareCriteriaSome() {
assertFalse(m_caps.supportsQuantifiedCompareCriteriaSome());
}
@@ -178,10 +138,6 @@
assertFalse(m_caps.supportsOrderBy());
}
- public void testSupportsAggregates() {
- assertFalse(m_caps.supportsAggregates());
- }
-
public void testSupportsAggregatesSum() {
assertFalse(m_caps.supportsAggregatesSum());
}
@@ -226,10 +182,6 @@
assertFalse(m_caps.supportsSearchedCaseExpressions());
}
- public void testSupportsScalarFunctions() {
- assertFalse(m_caps.supportsScalarFunctions());
- }
-
public void testSupportsInlineViews() {
assertFalse(m_caps.supportsInlineViews());
}
Modified: trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecCapabilities.java
===================================================================
--- trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/sandbox/connector-exec/src/main/java/com/metamatrix/connector/exec/ExecCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -46,13 +46,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -60,13 +53,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteria()
*/
public boolean supportsInCriteria() {
Modified: trunk/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnectorCapabilities.java
===================================================================
--- trunk/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnectorCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/sandbox/connector-object/src/main/java/com/metamatrix/connector/object/ObjectConnectorCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -29,20 +29,6 @@
public class ObjectConnectorCapabilities extends BasicConnectorCapabilities {
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAndCriteria()
- */
- public boolean supportsAndCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -50,48 +36,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThan()
- */
- public boolean supportsCompareCriteriaGreaterThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaGreaterThanOrEqual()
- */
- public boolean supportsCompareCriteriaGreaterThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThan()
- */
- public boolean supportsCompareCriteriaLessThan() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaLessThanOrEqual()
- */
- public boolean supportsCompareCriteriaLessThanOrEqual() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaNotEquals()
- */
- public boolean supportsCompareCriteriaNotEquals() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteria()
*/
public boolean supportsInCriteria() {
@@ -125,5 +69,10 @@
public boolean supportsOrCriteria() {
return true;
}
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
}
Modified: trunk/connectors/sandbox/connector-yahoo/src/main/java/com/metamatrix/connector/yahoo/YahooCapabilities.java
===================================================================
--- trunk/connectors/sandbox/connector-yahoo/src/main/java/com/metamatrix/connector/yahoo/YahooCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/connectors/sandbox/connector-yahoo/src/main/java/com/metamatrix/connector/yahoo/YahooCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -57,13 +57,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteria()
- */
- public boolean supportsCompareCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
*/
public boolean supportsCompareCriteriaEquals() {
@@ -71,13 +64,6 @@
}
/*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCriteria()
- */
- public boolean supportsCriteria() {
- return true;
- }
-
- /*
* @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteria()
*/
public boolean supportsInCriteria() {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/BasicSourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/BasicSourceCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/BasicSourceCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -59,8 +59,10 @@
public void setCapabilitySupport(Capability capability, boolean supports) {
if (supports && capability == Capability.QUERY_AGGREGATES) {
capabilityMap.put(Capability.QUERY_GROUP_BY, true);
+ capabilityMap.put(Capability.QUERY_HAVING, true);
+ } else {
+ capabilityMap.put(capability, supports);
}
- capabilityMap.put(capability, supports);
}
public void setFunctionSupport(String function, boolean supports) {
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/capabilities/SourceCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -30,9 +30,9 @@
*/
QUERY_SELECT_DISTINCT,
/**
- * Support indicates connector can accept queries with literals in the SELECT
+ * Support indicates connector can accept queries non-elements in the SELECT
*/
- QUERY_SELECT_LITERALS,
+ QUERY_SELECT_EXPRESSION,
/**
* Support indicates connector can accept joins where groups have aliases (required for QUERY_FROM_JOIN_SELFJOIN)
*
@@ -44,11 +44,15 @@
*/
MAX_QUERY_FROM_GROUPS,
/**
- * Support indicates connector can accept joins
+ * @since 6.1.0
+ */
+ JOIN_CRITERIA_ALLOWED,
+ /**
+ * Support indicates connector can accept inner joins
*
* @since 3.1 SP2
*/
- QUERY_FROM_JOIN,
+ QUERY_FROM_JOIN_INNER,
/**
* Indicates that the source prefers ANSI style joins
*
@@ -74,143 +78,84 @@
*/
QUERY_FROM_INLINE_VIEWS,
/**
- * Support indicates connector can push down an ORDER BY in inline views
- *
- * @since 5.0 SP1
- */
- QUERY_FROM_INLINE_VIEWS_ORDER_BY,
- /**
* Support indicates connector can accept full outer joins
*
* @since 3.1 SP2
*/
QUERY_FROM_JOIN_OUTER_FULL,
/**
- * Support indicates connector can accept a WHERE criteria on queries
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE,
- /**
* Support indicates connector accepts criteria of form (element BETWEEN constant AND constant)
*
* @since 4.0
*/
- QUERY_WHERE_BETWEEN,
+ CRITERIA_BETWEEN,
/**
* Support indicates connector accepts criteria of form (element operator constant)
*
* @since 3.1 SP2
*/
- QUERY_WHERE_COMPARE,
+ CRITERIA_COMPARE_EQ,
+ CRITERIA_COMPARE_ORDERED,
/**
- * Support indicates connector accepts criteria of form (element,
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_EQ,
- /**
- * Support indicates connector accepts criteria of form (element <> constant)
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_NE,
- /**
- * Support indicates connector accepts criteria of form (element < constant)
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_LT,
- /**
- * Support indicates connector accepts criteria of form (element <= constant)
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_LE,
- /**
- * Support indicates connector accepts criteria of form (element > constant)
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_GT,
- /**
- * Support indicates connector accepts criteria of form (element >= constant)
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_COMPARE_GE,
- /**
* Support indicates connector accepts criteria of form (element LIKE constant)
*
* @since 3.1 SP2
*/
- QUERY_WHERE_LIKE,
+ CRITERIA_LIKE,
/**
* Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char) - CURRENTLY NOT USED
*
* @since 3.1 SP2
*/
- QUERY_WHERE_LIKE_ESCAPE,
+ CRITERIA_LIKE_ESCAPE,
/**
* Support indicates connector accepts criteria of form (element IN set)
*
* @since 3.1 SP2
*/
- QUERY_WHERE_IN,
+ CRITERIA_IN,
/**
* Support indicates connector accepts IN criteria with a subquery on the right side
*
* @since 4.0
*/
- QUERY_WHERE_IN_SUBQUERY,
+ CRITERIA_IN_SUBQUERY,
/**
* Support indicates connector accepts criteria of form (element IS NULL)
*
* @since 3.1 SP2
*/
- QUERY_WHERE_ISNULL,
+ CRITERIA_ISNULL,
/**
- * Support indicates connector accepts logical criteria connected by AND
- *
- * @since 3.1 SP2
- */
- QUERY_WHERE_AND,
- /**
* Support indicates connector accepts logical criteria connected by OR
*
* @since 3.1 SP2
*/
- QUERY_WHERE_OR,
+ CRITERIA_OR,
/**
* Support indicates connector accepts logical criteria NOT
*
* @since 3.1 SP2
*/
- QUERY_WHERE_NOT,
+ CRITERIA_NOT,
/**
* Support indicates connector accepts the EXISTS criteria
*
* @since 4.0
*/
- QUERY_WHERE_EXISTS,
+ CRITERIA_EXISTS,
/**
- * Support indicates connector accepts quantified subquery comparison criteria
- *
- * @since 4.0
- */
- QUERY_WHERE_QUANTIFIED_COMPARISON,
- /**
* Support indicates connector accepts the quantified comparison criteria that use SOME
*
* @since 4.0
*/
- QUERY_WHERE_QUANTIFIED_SOME,
+ CRITERIA_QUANTIFIED_SOME,
/**
* Support indicates connector accepts the quantified comparison criteria that use ALL
*
* @since 4.0
*/
- QUERY_WHERE_QUANTIFIED_ALL,
+ CRITERIA_QUANTIFIED_ALL,
/**
* Support indicates connector accepts ORDER BY clause
*
@@ -218,12 +163,19 @@
*/
QUERY_ORDERBY,
/**
- * Support indicates connector accepts GROUP BY and HAVING clauses
- *
- * @since 3.1 SP2
+ * Composite support for group by and having - not
+ * used by the connector layer
*/
QUERY_AGGREGATES,
/**
+ * @since 6.1.0 indicates support for GROUP BY
+ */
+ QUERY_GROUP_BY,
+ /**
+ * @since 6.1.0 indicates support for HAVING
+ */
+ QUERY_HAVING,
+ /**
* Support indicates connector can accept the SUM aggregate function
*
* @since 3.1 SP2
@@ -345,12 +297,6 @@
*/
ROW_OFFSET,
/**
- * Support indicates connector allows functions in expressions
- *
- * @since 3.1 SP2
- */
- FUNCTION,
- /**
* The Maximum number of values allowed in an IN criteria (Integer)
*
* @since 4.4
@@ -374,10 +320,6 @@
* @since 6.0.0 indicates support for where all
*/
REQUIRES_CRITERIA,
- /**
- * @since 6.1.0 indicates support for GROUP BY
- */
- QUERY_GROUP_BY
}
public enum Scope {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/plantree/NodeConstants.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/plantree/NodeConstants.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/plantree/NodeConstants.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -89,7 +89,6 @@
NON_EQUI_JOIN_CRITERIA, // List <CompareCriteria>
SORT_LEFT, // SortOption
SORT_RIGHT, // SortOption
- REMOVED_JOIN_GROUPS, //Set<GroupSymbol>
IS_OPTIONAL, // Boolean
IS_LEFT_DISTINCT, // Boolean
IS_RIGHT_DISTINCT, // Boolean
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CapabilitiesUtil.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CapabilitiesUtil.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,9 +22,13 @@
package com.metamatrix.query.optimizer.relational.rules;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import org.teiid.connector.api.ConnectorCapabilities.SupportedJoinCriteria;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.common.types.DataTypeManager;
@@ -33,6 +37,7 @@
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
+import com.metamatrix.query.sql.LanguageObject;
import com.metamatrix.query.sql.ReservedWords;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.lang.SetQuery.Operation;
@@ -41,7 +46,7 @@
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.Function;
-import com.metamatrix.query.sql.symbol.ScalarSubquery;
+import com.metamatrix.query.sql.visitor.ElementCollectorVisitor;
/**
*/
@@ -55,30 +60,9 @@
static boolean supportsInlineView(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_FROM_INLINE_VIEWS);
+ return supports(Capability.QUERY_FROM_INLINE_VIEWS, modelID, metadata, capFinder);
}
-
- public static boolean supportsJoins(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
- throws QueryMetadataException, MetaMatrixComponentException {
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_FROM_JOIN);
- }
-
public static boolean supportsSelfJoins(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
@@ -95,18 +79,10 @@
public static boolean supportsGroupAliases(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_FROM_GROUP_ALIAS);
+ return supports(Capability.QUERY_FROM_GROUP_ALIAS, modelID, metadata, capFinder);
}
- public static boolean supportsOuterJoin(Object modelID, JoinType joinType, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ public static boolean supportsJoin(Object modelID, JoinType joinType, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
if (metadata.isVirtualModel(modelID)){
@@ -116,6 +92,10 @@
// Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
+ if (!joinType.isOuter()) {
+ return caps.supportsCapability(Capability.QUERY_FROM_JOIN_INNER);
+ }
+
if(! caps.supportsCapability(Capability.QUERY_FROM_JOIN_OUTER)) {
return false;
}
@@ -133,9 +113,6 @@
// Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
- if (!caps.supportsCapability(Capability.QUERY_AGGREGATES)) {
- return false;
- }
if (groupCols != null && !groupCols.isEmpty()) {
if (!caps.supportsCapability(Capability.QUERY_GROUP_BY)) {
return false;
@@ -166,11 +143,6 @@
// Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
- // Check for basic aggregate function support
- if(! caps.supportsCapability(Capability.QUERY_AGGREGATES)) {
- return false;
- }
-
// Check particular function
String func = aggregate.getAggregateFunction();
if(func.equals(ReservedWords.COUNT)) {
@@ -202,10 +174,8 @@
}
// Check DISTINCT if necessary
- if(aggregate.isDistinct()) {
- if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_DISTINCT)) {
- return false;
- }
+ if(aggregate.isDistinct() && ! caps.supportsCapability(Capability.QUERY_AGGREGATES_DISTINCT)) {
+ return false;
}
// Passed all the checks!
@@ -224,10 +194,6 @@
// Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
- if(! caps.supportsCapability(Capability.FUNCTION)) {
- return false;
- }
-
if (!caps.supportsFunction(function.getName().toLowerCase())) {
return false;
}
@@ -253,69 +219,19 @@
public static boolean supportsSelectDistinct(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SELECT_DISTINCT);
+ return supports(Capability.QUERY_SELECT_DISTINCT, modelID, metadata, capFinder);
}
public static boolean supportsSelectLiterals(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SELECT_LITERALS);
+ return supports(Capability.QUERY_SELECT_EXPRESSION, modelID, metadata, capFinder);
}
public static boolean supportsOrderBy(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_ORDERBY);
+ return supports(Capability.QUERY_ORDERBY, modelID, metadata, capFinder);
}
- public static boolean supportsScalarSubquery(Object modelID, ScalarSubquery subquery, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
- throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SUBQUERIES_SCALAR);
- }
-
- public static boolean supportsCorrelatedSubquery(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
- throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SUBQUERIES_CORRELATED);
- }
-
public static boolean supportsSetOp(Object modelID, Operation setOp, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
@@ -340,41 +256,17 @@
public static boolean supportsSetQueryOrderBy(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SET_ORDER_BY);
+ return supports(Capability.QUERY_SET_ORDER_BY, modelID, metadata, capFinder);
}
public static boolean supportsCaseExpression(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_CASE);
+ return supports(Capability.QUERY_CASE, modelID, metadata, capFinder);
}
public static boolean supportsSearchedCaseExpression(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.QUERY_SEARCHED_CASE);
+ return supports(Capability.QUERY_SEARCHED_CASE, modelID, metadata, capFinder);
}
public static int getMaxInCriteriaSize(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
@@ -421,31 +313,26 @@
return value;
}
-
- public static boolean supportsRowLimit(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
- throws QueryMetadataException, MetaMatrixComponentException {
-
+ public static SupportedJoinCriteria getSupportedJoinCriteria(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws QueryMetadataException, MetaMatrixComponentException {
if (metadata.isVirtualModel(modelID)){
- return false;
+ return SupportedJoinCriteria.ANY;
}
-
- // Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.ROW_LIMIT);
+ SupportedJoinCriteria crits = (SupportedJoinCriteria)caps.getSourceProperty(Capability.JOIN_CRITERIA_ALLOWED);
+ if (crits == null) {
+ return SupportedJoinCriteria.ANY;
+ }
+ return crits;
}
+
+ public static boolean supportsRowLimit(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ return supports(Capability.ROW_LIMIT, modelID, metadata, capFinder);
+ }
public static boolean supportsRowOffset(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.ROW_OFFSET);
+ return supports(Capability.ROW_OFFSET, modelID, metadata, capFinder);
}
public static boolean isSameConnector(Object modelID, Object modelID1, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
@@ -478,28 +365,39 @@
public static boolean requiresCriteria(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
- return false;
- }
-
- // Find capabilities
- SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
-
- return caps.supportsCapability(Capability.REQUIRES_CRITERIA);
+ return supports(Capability.REQUIRES_CRITERIA, modelID, metadata, capFinder);
}
public static boolean useAnsiJoin(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
throws QueryMetadataException, MetaMatrixComponentException {
-
- if (metadata.isVirtualModel(modelID)){
+ return supports(Capability.QUERY_FROM_ANSI_JOIN, modelID, metadata, capFinder);
+ }
+
+ public static boolean supports(Capability cap, Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ if (metadata.isVirtualModel(modelID)){
return false;
}
// Find capabilities
SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);
- return caps.supportsCapability(Capability.QUERY_FROM_ANSI_JOIN);
- }
+ return caps.supportsCapability(cap);
+ }
+ /**
+ * Validate that the elements are searchable and can be used in a criteria against this source.
+ * TODO: this check is too general and not type based
+ */
+ static boolean checkElementsAreSearchable(List<? extends LanguageObject> objs, QueryMetadataInterface metadata, int searchableType)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ Collection<ElementSymbol> elements = new ArrayList<ElementSymbol>();
+ ElementCollectorVisitor.getElements(objs, elements);
+ for (ElementSymbol elementSymbol : elements) {
+ if (!metadata.elementSupports(elementSymbol.getMetadataID(), searchableType)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/CriteriaCapabilityValidatorVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,20 +22,27 @@
package com.metamatrix.query.optimizer.relational.rules;
+import java.util.Arrays;
import java.util.Collection;
-import java.util.Iterator;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
+import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.function.metadata.FunctionMethod;
import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.metadata.SupportConstants;
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
+import com.metamatrix.query.processor.ProcessorPlan;
+import com.metamatrix.query.processor.relational.AccessNode;
+import com.metamatrix.query.processor.relational.RelationalNode;
+import com.metamatrix.query.processor.relational.RelationalPlan;
import com.metamatrix.query.sql.LanguageObject;
import com.metamatrix.query.sql.LanguageVisitor;
-import com.metamatrix.query.sql.lang.BetweenCriteria;
+import com.metamatrix.query.sql.lang.AbstractCompareCriteria;
+import com.metamatrix.query.sql.lang.AbstractSetCriteria;
+import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.CompoundCriteria;
import com.metamatrix.query.sql.lang.DependentSetCriteria;
@@ -43,18 +50,21 @@
import com.metamatrix.query.sql.lang.IsNullCriteria;
import com.metamatrix.query.sql.lang.MatchCriteria;
import com.metamatrix.query.sql.lang.NotCriteria;
-import com.metamatrix.query.sql.lang.PredicateCriteria;
+import com.metamatrix.query.sql.lang.Query;
import com.metamatrix.query.sql.lang.SetCriteria;
import com.metamatrix.query.sql.lang.SubqueryCompareCriteria;
+import com.metamatrix.query.sql.lang.SubqueryContainer;
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.CaseExpression;
-import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Function;
+import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.sql.symbol.ScalarSubquery;
import com.metamatrix.query.sql.symbol.SearchedCaseExpression;
-import com.metamatrix.query.sql.visitor.ElementCollectorVisitor;
+import com.metamatrix.query.sql.util.SymbolMap;
import com.metamatrix.query.sql.visitor.EvaluatableVisitor;
+import com.metamatrix.query.sql.visitor.GroupCollectorVisitor;
/**
*/
@@ -74,36 +84,17 @@
/**
* @param iterator
+ * @throws MetaMatrixComponentException
+ * @throws QueryMetadataException
*/
- public CriteriaCapabilityValidatorVisitor(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) {
+ CriteriaCapabilityValidatorVisitor(Object modelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, SourceCapabilities caps) throws QueryMetadataException, MetaMatrixComponentException {
this.modelID = modelID;
this.metadata = metadata;
this.capFinder = capFinder;
- loadCapabilities();
+ this.caps = caps;
}
- /**
- * Load the capabilities and cache locally once they are loaded.
- */
- private void loadCapabilities() {
- if(capFinder != null) {
- try {
- String modelName = metadata.getFullName(modelID);
- caps = capFinder.findCapabilities(modelName);
-
- } catch(QueryMetadataException e) {
- handleException(new MetaMatrixComponentException(e));
- } catch(MetaMatrixComponentException e) {
- handleException(e);
- }
- }
- }
-
public void visit(AggregateSymbol obj) {
- if(this.caps == null) {
- return;
- }
-
try {
if(! CapabilitiesUtil.supportsAggregateFunction(modelID, obj, metadata, capFinder)) {
markInvalid();
@@ -115,83 +106,41 @@
}
}
- public void visit(BetweenCriteria obj) {
- if (this.caps == null) {
- return;
- }
-
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_BETWEEN)) {
- markInvalid();
- return;
- }
-
- // Check capabilities of the elements
- try {
- checkElementsAreSearchable(obj, SupportConstants.Element.SEARCHABLE_COMPARE);
- } catch(QueryMetadataException e) {
- handleException(new MetaMatrixComponentException(e));
- } catch(MetaMatrixComponentException e) {
- handleException(e);
- }
- }
-
public void visit(CaseExpression obj) {
- if (this.caps == null) {
- return;
- }
-
if(! this.caps.supportsCapability(Capability.QUERY_CASE)) {
markInvalid();
}
}
public void visit(CompareCriteria obj) {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
+ checkCompareCriteria(obj);
+ }
+
+ public void checkCompareCriteria(AbstractCompareCriteria obj) {
+ boolean negated = false;
+ // Check if operation is allowed
+ Capability operatorCap = null;
+ switch(obj.getOperator()) {
+ case CompareCriteria.NE:
+ negated = true;
+ case CompareCriteria.EQ:
+ operatorCap = Capability.CRITERIA_COMPARE_EQ;
+ break;
+ case CompareCriteria.LT:
+ case CompareCriteria.GT:
+ negated = true;
+ case CompareCriteria.LE:
+ case CompareCriteria.GE:
+ operatorCap = Capability.CRITERIA_COMPARE_ORDERED;
+ break;
+ }
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_COMPARE)) {
- markInvalid();
- return;
- }
-
- // Check if operation is allowed
- Capability operatorCap = null;
- switch(obj.getOperator()) {
- case CompareCriteria.EQ:
- operatorCap = Capability.QUERY_WHERE_COMPARE_EQ;
- break;
- case CompareCriteria.NE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_NE;
- break;
- case CompareCriteria.LT:
- operatorCap = Capability.QUERY_WHERE_COMPARE_LT;
- break;
- case CompareCriteria.GT:
- operatorCap = Capability.QUERY_WHERE_COMPARE_GT;
- break;
- case CompareCriteria.LE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_LE;
- break;
- case CompareCriteria.GE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_GE;
- break;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(operatorCap)) {
- markInvalid();
- }
+ // Check if compares are allowed
+ if(! this.caps.supportsCapability(operatorCap)) {
+ markInvalid();
+ }
+ if (negated && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
+ markInvalid();
}
// Check capabilities of the elements
@@ -208,21 +157,13 @@
int operator = crit.getOperator();
// Verify capabilities are supported
- if(this.caps != null) {
- if(operator == CompoundCriteria.AND) {
- // Check if AND is allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_AND)) {
- markInvalid();
- return;
- }
- } else {
- // Check if OR is allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_OR)) {
- markInvalid();
- return;
- }
- }
- }
+ if(operator == CompoundCriteria.OR) {
+ // Check if OR is allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_OR)) {
+ markInvalid();
+ return;
+ }
+ }
}
public void visit(Function obj) {
@@ -242,79 +183,54 @@
}
public void visit(IsNullCriteria obj) {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_ISNULL)) {
- markInvalid();
- return;
- }
-
- // Check capabilities of the elements
- try {
- checkElementsAreSearchable(obj, SupportConstants.Element.SEARCHABLE_COMPARE);
- } catch(QueryMetadataException e) {
- handleException(new MetaMatrixComponentException(e));
- } catch(MetaMatrixComponentException e) {
- handleException(e);
- }
+ // Check if compares are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_ISNULL)) {
+ markInvalid();
+ return;
}
+
+ if (obj.isNegated() && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
+ markInvalid();
+ return;
+ }
}
public void visit(MatchCriteria obj) {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
+ // Check if compares are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_LIKE)) {
+ markInvalid();
+ return;
+ }
+
+ // Check ESCAPE char if necessary
+ if(obj.getEscapeChar() != MatchCriteria.NULL_ESCAPE_CHAR) {
+ if(! this.caps.supportsCapability(Capability.CRITERIA_LIKE_ESCAPE)) {
markInvalid();
return;
- }
+ }
+ }
+
+ //check NOT
+ if(obj.isNegated() && ! this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
+ markInvalid();
+ return;
+ }
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_LIKE)) {
- markInvalid();
- return;
- }
-
- // Check ESCAPE char if necessary
- if(obj.getEscapeChar() != MatchCriteria.NULL_ESCAPE_CHAR) {
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_LIKE_ESCAPE)) {
- markInvalid();
- return;
- }
- }
-
- //check NOT
- if(obj.isNegated()) {
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_NOT)) {
- markInvalid();
- return;
- }
- }
-
- // Check capabilities of the elements
- try {
- checkElementsAreSearchable(obj, SupportConstants.Element.SEARCHABLE_LIKE);
- } catch(QueryMetadataException e) {
- handleException(new MetaMatrixComponentException(e));
- } catch(MetaMatrixComponentException e) {
- handleException(e);
- }
-
+ // Check capabilities of the elements
+ try {
+ checkElementsAreSearchable(obj, SupportConstants.Element.SEARCHABLE_LIKE);
+ } catch(QueryMetadataException e) {
+ handleException(new MetaMatrixComponentException(e));
+ } catch(MetaMatrixComponentException e) {
+ handleException(e);
}
}
public void visit(NotCriteria obj) {
- if(this.caps != null) {
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_NOT)) {
- markInvalid();
- return;
- }
+ // Check if compares are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
+ markInvalid();
+ return;
}
}
@@ -329,31 +245,14 @@
}
public void visit(SetCriteria crit) {
+ checkAbstractSetCriteria(crit);
try {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_IN)) {
- markInvalid();
- return;
- }
-
- int maxSize = CapabilitiesUtil.getMaxInCriteriaSize(modelID, metadata, capFinder);
-
- if (maxSize > 0 && crit.getValues().size() > maxSize) {
- markInvalid();
- return;
- }
+ int maxSize = CapabilitiesUtil.getMaxInCriteriaSize(modelID, metadata, capFinder);
+
+ if (maxSize > 0 && crit.getValues().size() > maxSize) {
+ markInvalid();
+ return;
}
-
- // Check capabilities of the elements
- checkElementsAreSearchable(crit, SupportConstants.Element.SEARCHABLE_COMPARE);
-
} catch(QueryMetadataException e) {
handleException(new MetaMatrixComponentException(e));
} catch(MetaMatrixComponentException e) {
@@ -365,94 +264,68 @@
* @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.lang.ExistsCriteria)
*/
public void visit(ExistsCriteria crit) {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if exists criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_EXISTS)) {
- markInvalid();
- return;
- }
- }
+ // Check if exists criteria are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_EXISTS)) {
+ markInvalid();
+ return;
+ }
+
+ try {
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
+ markInvalid();
+ }
+ } catch (MetaMatrixComponentException e) {
+ handleException(e);
+ }
}
/**
* @see com.metamatrix.query.sql.LanguageVisitor#visit(com.metamatrix.query.sql.lang.SubqueryCompareCriteria)
*/
public void visit(SubqueryCompareCriteria crit) {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
+ // Check if quantification operator is allowed
+ Capability capability = null;
+ switch(crit.getPredicateQuantifier()) {
+ case SubqueryCompareCriteria.ALL:
+ capability = Capability.CRITERIA_QUANTIFIED_ALL;
+ break;
+ case SubqueryCompareCriteria.ANY:
+ capability = Capability.CRITERIA_QUANTIFIED_SOME;
+ break;
+ case SubqueryCompareCriteria.SOME:
+ capability = Capability.CRITERIA_QUANTIFIED_SOME;
+ break;
+ }
+ if(! this.caps.supportsCapability(capability)) {
+ markInvalid();
+ return;
+ }
+
+ checkCompareCriteria(crit);
+
+ // Check capabilities of the elements
+ try {
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
+ markInvalid();
}
-
+ } catch(QueryMetadataException e) {
+ handleException(new MetaMatrixComponentException(e));
+ } catch(MetaMatrixComponentException e) {
+ handleException(e);
+ }
+ }
+
+ @Override
+ public void visit(ScalarSubquery obj) {
+ try {
// Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_COMPARE)) {
+ if(! this.caps.supportsCapability(Capability.QUERY_SUBQUERIES_SCALAR)) {
markInvalid();
return;
}
-
- // Check if quantified compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON)) {
- markInvalid();
- return;
+ if (validateSubqueryPushdown(obj, modelID, metadata, capFinder) == null) {
+ markInvalid();
}
-
- // Check if quantification operator is allowed
- Capability capability = null;
- switch(crit.getPredicateQuantifier()) {
- case SubqueryCompareCriteria.ALL:
- capability = Capability.QUERY_WHERE_QUANTIFIED_ALL;
- break;
- case SubqueryCompareCriteria.ANY:
- capability = Capability.QUERY_WHERE_QUANTIFIED_SOME;
- break;
- case SubqueryCompareCriteria.SOME:
- capability = Capability.QUERY_WHERE_QUANTIFIED_SOME;
- break;
- }
- if(! this.caps.supportsCapability(capability)) {
- markInvalid();
- return;
- }
-
- // Check if operation is allowed
- Capability operatorCap = null;
- switch(crit.getOperator()) {
- case CompareCriteria.EQ:
- operatorCap = Capability.QUERY_WHERE_COMPARE_EQ;
- break;
- case CompareCriteria.NE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_NE;
- break;
- case CompareCriteria.LT:
- operatorCap = Capability.QUERY_WHERE_COMPARE_LT;
- break;
- case CompareCriteria.GT:
- operatorCap = Capability.QUERY_WHERE_COMPARE_GT;
- break;
- case CompareCriteria.LE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_LE;
- break;
- case CompareCriteria.GE:
- operatorCap = Capability.QUERY_WHERE_COMPARE_GE;
- break;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(operatorCap)) {
- markInvalid();
- }
- }
-
- // Check capabilities of the elements
- try {
- checkElementsAreSearchable(crit, SupportConstants.Element.SEARCHABLE_COMPARE);
} catch(QueryMetadataException e) {
handleException(new MetaMatrixComponentException(e));
} catch(MetaMatrixComponentException e) {
@@ -461,53 +334,36 @@
}
public void visit(SubquerySetCriteria crit) {
+ checkAbstractSetCriteria(crit);
try {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_IN)) {
- markInvalid();
- return;
- }
-
- // Check if compares with subqueries are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_IN_SUBQUERY)) {
- markInvalid();
- return;
- }
+ // Check if compares with subqueries are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_IN_SUBQUERY)) {
+ markInvalid();
+ return;
}
- // Check capabilities of the elements
- checkElementsAreSearchable(crit, SupportConstants.Element.SEARCHABLE_COMPARE);
-
+ if (validateSubqueryPushdown(crit, modelID, metadata, capFinder) == null) {
+ markInvalid();
+ }
} catch(QueryMetadataException e) {
handleException(new MetaMatrixComponentException(e));
} catch(MetaMatrixComponentException e) {
handleException(e);
}
}
-
- public void visit(DependentSetCriteria crit) {
+
+ public void checkAbstractSetCriteria(AbstractSetCriteria crit) {
try {
- if(this.caps != null) {
- // Check if criteria are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE)) {
- markInvalid();
- return;
- }
-
- // Check if compares are allowed
- if(! this.caps.supportsCapability(Capability.QUERY_WHERE_IN)) {
- markInvalid();
- return;
- }
+ // Check if compares are allowed
+ if(! this.caps.supportsCapability(Capability.CRITERIA_IN)) {
+ markInvalid();
+ return;
}
-
+
+ if (crit.isNegated() && !this.caps.supportsCapability(Capability.CRITERIA_NOT)) {
+ markInvalid();
+ return;
+ }
// Check capabilities of the elements
checkElementsAreSearchable(crit, SupportConstants.Element.SEARCHABLE_COMPARE);
@@ -516,23 +372,92 @@
} catch(MetaMatrixComponentException e) {
handleException(e);
}
+
}
+ public void visit(DependentSetCriteria crit) {
+ checkAbstractSetCriteria(crit);
+ }
+
+ private void checkElementsAreSearchable(LanguageObject crit, int searchableType)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ if (!CapabilitiesUtil.checkElementsAreSearchable(Arrays.asList(crit), metadata, searchableType)) {
+ markInvalid();
+ }
+ }
+
/**
- * Validate that the elements are searchable and can be used in a criteria against this source.
+ * Return null if the subquery cannot be pushed down, otherwise the model
+ * id of the pushdown target.
+ * @param subqueryContainer
+ * @param critNodeModelID
+ * @param metadata
+ * @param capFinder
+ * @return
+ * @throws MetaMatrixComponentException
*/
- private void checkElementsAreSearchable(PredicateCriteria crit, int searchableType)
- throws QueryMetadataException, MetaMatrixComponentException {
-
- Collection elements = ElementCollectorVisitor.getElements(crit, false);
- Iterator iter = elements.iterator();
- while(iter.hasNext()) {
- ElementSymbol element = (ElementSymbol) iter.next();
- if (!metadata.elementSupports(element.getMetadataID(), searchableType)) {
- markInvalid();
- return;
- }
+ static Object validateSubqueryPushdown(SubqueryContainer subqueryContainer, Object critNodeModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws MetaMatrixComponentException {
+ ProcessorPlan plan = subqueryContainer.getCommand().getProcessorPlan();
+ if (plan != null) {
+ if(!(plan instanceof RelationalPlan)) {
+ return null;
+ }
+
+ RelationalPlan rplan = (RelationalPlan) plan;
+
+ // Check that the plan is just an access node
+ RelationalNode accessNode = rplan.getRootNode();
+ if(accessNode == null || ! (accessNode instanceof AccessNode) || accessNode.getChildren()[0] != null) {
+ return null;
+ }
+
+ // Check that command in access node is a query
+ Command command = ((AccessNode)accessNode).getCommand();
+ if(command == null || !(command instanceof Query) || ((Query)command).getIsXML()) {
+ return null;
+ }
+
+ // Check that query in access node is for the same model as current node
+ try {
+ Collection subQueryGroups = GroupCollectorVisitor.getGroupsIgnoreInlineViews(command, false);
+ if(subQueryGroups.size() == 0) {
+ // No FROM?
+ return null;
+ }
+ GroupSymbol subQueryGroup = (GroupSymbol)subQueryGroups.iterator().next();
+
+ Object modelID = metadata.getModelID(subQueryGroup.getMetadataID());
+ if (critNodeModelID == null) {
+ critNodeModelID = modelID;
+ } else if(!CapabilitiesUtil.isSameConnector(critNodeModelID, modelID, metadata, capFinder)) {
+ return null;
+ }
+ } catch(QueryMetadataException e) {
+ throw new MetaMatrixComponentException(e, QueryExecPlugin.Util.getString("RulePushSelectCriteria.Error_getting_modelID")); //$NON-NLS-1$
+ }
+ }
+ if (critNodeModelID == null) {
+ return null;
+ }
+ // Check whether source supports correlated subqueries and if not, whether criteria has them
+ SymbolMap refs = subqueryContainer.getCommand().getCorrelatedReferences();
+ try {
+ if(refs != null && !refs.asMap().isEmpty()) {
+ if(! CapabilitiesUtil.supports(Capability.QUERY_SUBQUERIES_CORRELATED, critNodeModelID, metadata, capFinder)) {
+ return null;
+ }
+ //TODO: this check sees as correlated references as coming from the containing scope
+ //but this is only an issue with deeply nested subqueries
+ if (!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(subqueryContainer.getCommand(), critNodeModelID, metadata, capFinder)) {
+ return null;
+ }
+ }
+ } catch(QueryMetadataException e) {
+ throw new MetaMatrixComponentException(e);
}
+
+ // Found no reason why this node is not eligible
+ return critNodeModelID;
}
private void handleException(MetaMatrixComponentException e) {
@@ -563,8 +488,15 @@
// Couldn't determine model ID, so give up
return false;
}
+
+ String modelName = metadata.getFullName(modelID);
+ SourceCapabilities caps = capFinder.findCapabilities(modelName);
- CriteriaCapabilityValidatorVisitor visitor = new CriteriaCapabilityValidatorVisitor(modelID, metadata, capFinder);
+ if (caps == null) {
+ return true; //this doesn't seem right, but tests were expecting it...
+ }
+
+ CriteriaCapabilityValidatorVisitor visitor = new CriteriaCapabilityValidatorVisitor(modelID, metadata, capFinder, caps);
PreOrderNavigator.doVisit(obj, visitor);
if(visitor.getException() != null) {
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/JoinRegion.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/JoinRegion.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/JoinRegion.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -40,7 +40,6 @@
import com.metamatrix.query.optimizer.relational.GenerateCanonical;
import com.metamatrix.query.optimizer.relational.plantree.NodeConstants;
import com.metamatrix.query.optimizer.relational.plantree.PlanNode;
-import com.metamatrix.query.optimizer.relational.plantree.NodeConstants.Info;
import com.metamatrix.query.resolver.util.AccessPattern;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.Criteria;
@@ -50,6 +49,7 @@
import com.metamatrix.query.sql.symbol.GroupSymbol;
import com.metamatrix.query.sql.visitor.ElementCollectorVisitor;
import com.metamatrix.query.sql.visitor.FunctionCollectorVisitor;
+import com.metamatrix.query.sql.visitor.GroupsUsedByElementsVisitor;
/**
* A join region is a set of cross and inner joins whose ordering is completely interchangable.
@@ -81,11 +81,9 @@
private List unsatisfiedAccessPatterns = new LinkedList();
- private Map dependentCriteriaElements;
+ private Map<ElementSymbol, Set<Collection<GroupSymbol>>> dependentCriteriaElements;
private Map critieriaToSourceMap;
- private Set<GroupSymbol> removedJoinGroups;
-
public PlanNode getJoinRoot() {
return joinRoot;
}
@@ -102,7 +100,7 @@
return dependentJoinSourceNodes;
}
- public List getCriteriaNodes() {
+ public List<PlanNode> getCriteriaNodes() {
return criteriaNodes;
}
@@ -110,7 +108,7 @@
return dependentCritieraNodes;
}
- public Map getDependentCriteriaElements() {
+ public Map<ElementSymbol, Set<Collection<GroupSymbol>>> getDependentCriteriaElements() {
return this.dependentCriteriaElements;
}
@@ -158,17 +156,6 @@
}
}
- public void addRemovedJoinGroups(PlanNode joinNode) {
- Set<GroupSymbol> groups = (Set<GroupSymbol>) joinNode.getProperty(Info.REMOVED_JOIN_GROUPS);
- if (groups == null) {
- return;
- }
- if (this.removedJoinGroups == null) {
- this.removedJoinGroups = new HashSet<GroupSymbol>();
- }
- this.removedJoinGroups.addAll(groups);
- }
-
/**
* This will rebuild the join tree starting at the join root.
*
@@ -428,39 +415,49 @@
}
}
- dependentCriteriaElements = new HashMap();
+ dependentCriteriaElements = new HashMap<ElementSymbol, Set<Collection<GroupSymbol>>>();
for (Iterator i = dependentCritieraNodes.iterator(); i.hasNext();) {
PlanNode critNode = (PlanNode)i.next();
Criteria crit = (Criteria)critNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
- Collection[] groups = RuleChooseDependent.isEqualityCriteria(crit);
- if (groups != null) {
- CompareCriteria compareCriteria = (CompareCriteria)crit;
- //this may be a proper dependent join criteria
- Collection[] critElements = new Collection[2];
- critElements[0] = ElementCollectorVisitor.getElements(compareCriteria.getLeftExpression(), true);
- critElements[1] = ElementCollectorVisitor.getElements(compareCriteria.getRightExpression(), true);
- for (int expr = 0; expr < critElements.length; expr++) {
- //simplifying assumption that there will be a single element on the dependent side
- if (critElements[expr].size() != 1) {
- continue;
- }
- ElementSymbol elem = (ElementSymbol)critElements[expr].iterator().next();
- if (!dependentGroupToSourceMap.containsKey(elem.getGroupSymbol())) {
- continue;
- }
- //this is also a simplifying assumption. don't consider criteria that can't be pushed
- if (containsFunctionsThatCannotBePushed(expr==0?compareCriteria.getRightExpression():compareCriteria.getLeftExpression())) {
- continue;
- }
- Set independentGroups = (HashSet)dependentCriteriaElements.get(elem);
- if (independentGroups == null) {
- independentGroups = new HashSet();
- dependentCriteriaElements.put(elem, independentGroups);
- }
- //set the other side as independent elements
- independentGroups.add(groups[(expr+1)%2]);
+ if(!(crit instanceof CompareCriteria)) {
+ continue;
+ }
+ CompareCriteria compCrit = (CompareCriteria) crit;
+ if(compCrit.getOperator() != CompareCriteria.EQ) {
+ continue;
+ }
+ CompareCriteria compareCriteria = (CompareCriteria)crit;
+ //this may be a proper dependent join criteria
+ Collection<ElementSymbol>[] critElements = new Collection[2];
+ critElements[0] = ElementCollectorVisitor.getElements(compareCriteria.getLeftExpression(), true);
+ if (critElements[0].isEmpty()) {
+ continue;
+ }
+ critElements[1] = ElementCollectorVisitor.getElements(compareCriteria.getRightExpression(), true);
+ if (critElements[1].isEmpty()) {
+ continue;
+ }
+ for (int expr = 0; expr < critElements.length; expr++) {
+ //simplifying assumption that there will be a single element on the dependent side
+ if (critElements[expr].size() != 1) {
+ continue;
}
+ ElementSymbol elem = critElements[expr].iterator().next();
+ if (!dependentGroupToSourceMap.containsKey(elem.getGroupSymbol())) {
+ continue;
+ }
+ //this is also a simplifying assumption. don't consider criteria that can't be pushed
+ if (containsFunctionsThatCannotBePushed(expr==0?compareCriteria.getRightExpression():compareCriteria.getLeftExpression())) {
+ continue;
+ }
+ Set<Collection<GroupSymbol>> independentGroups = dependentCriteriaElements.get(elem);
+ if (independentGroups == null) {
+ independentGroups = new HashSet<Collection<GroupSymbol>>();
+ dependentCriteriaElements.put(elem, independentGroups);
+ }
+ //set the other side as independent elements
+ independentGroups.add(GroupsUsedByElementsVisitor.getGroups(critElements[(expr+1)%2]));
}
}
}
@@ -515,8 +512,4 @@
}
}
- public Set<GroupSymbol> getRemovedJoinGroups() {
- return removedJoinGroups;
- }
-
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseDependent.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseDependent.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseDependent.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -23,7 +23,6 @@
package com.metamatrix.query.optimizer.relational.rules;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -43,13 +42,10 @@
import com.metamatrix.query.optimizer.relational.plantree.NodeEditor;
import com.metamatrix.query.optimizer.relational.plantree.PlanNode;
import com.metamatrix.query.processor.relational.JoinNode.JoinStrategyType;
-import com.metamatrix.query.sql.lang.CompareCriteria;
-import com.metamatrix.query.sql.lang.Criteria;
import com.metamatrix.query.sql.lang.DependentSetCriteria;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.util.SymbolMap;
-import com.metamatrix.query.sql.visitor.GroupsUsedByElementsVisitor;
import com.metamatrix.query.util.CommandContext;
import com.metamatrix.query.util.LogConstants;
@@ -229,32 +225,6 @@
return true;
}
-
- /**
- * @param foundEquality
- * @param theCrit
- * @return
- */
- static Collection[] isEqualityCriteria(Criteria theCrit) {
- if(!(theCrit instanceof CompareCriteria)) {
- return null;
- }
- CompareCriteria compCrit = (CompareCriteria) theCrit;
- if(compCrit.getOperator() != CompareCriteria.EQ) {
- return null;
- }
- Collection groups[] = new Collection[2];
- groups[0] = GroupsUsedByElementsVisitor.getGroups(compCrit.getLeftExpression());
- groups[1] = GroupsUsedByElementsVisitor.getGroups(compCrit.getRightExpression());
-
- Collection allGroups = GroupsUsedByElementsVisitor.getGroups(compCrit);
-
- if(groups[0].size() > 0 && groups[0].size() + groups[1].size() == allGroups.size()) {
- return groups;
- }
-
- return null;
- }
PlanNode chooseDepWithoutCosting(PlanNode rootNode1, PlanNode rootNode2) {
PlanNode sourceNode1 = FrameUtil.findJoinSourceNode(rootNode1);
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseJoinStrategy.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseJoinStrategy.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleChooseJoinStrategy.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -120,6 +120,10 @@
continue;
}
+ if (crit.isOptional()) {
+ continue;
+ }
+
Expression leftExpr = crit.getLeftExpression();
Expression rightExpr = crit.getRightExpression();
@@ -145,7 +149,12 @@
//make use of the one side criteria
joinNode.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.MERGE);
joinNode.setProperty(NodeConstants.Info.NON_EQUI_JOIN_CRITERIA, nonEquiJoinCriteria);
- }
+ } else if (nonEquiJoinCriteria.isEmpty()) {
+ joinNode.setProperty(NodeConstants.Info.JOIN_CRITERIA, nonEquiJoinCriteria);
+ if (joinNode.getProperty(NodeConstants.Info.JOIN_TYPE) == JoinType.JOIN_INNER) {
+ joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, JoinType.JOIN_CROSS);
+ }
+ }
}
private static AtomicInteger EXPRESSION_INDEX = new AtomicInteger(0);
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCollapseSource.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -23,7 +23,6 @@
package com.metamatrix.query.optimizer.relational.rules;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
@@ -172,10 +171,10 @@
{
replaceCorrelatedReferences(node.getSubqueryContainers());
JoinType joinType = (JoinType) node.getProperty(NodeConstants.Info.JOIN_TYPE);
- List crits = (List) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
+ List<Criteria> crits = (List<Criteria>) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
if (crits == null || crits.isEmpty()) {
- crits = new ArrayList();
+ crits = new ArrayList<Criteria>();
}
PlanNode left = node.getFirstChild();
@@ -184,23 +183,18 @@
/* special handling is needed to determine criteria placement.
*
* if the join is a left outer join, criteria from the right side will be added to the on clause
- * if the join is a right outer join, criteria from the left side will be added to the on clause
*/
Criteria savedCriteria = null;
buildQuery(accessRoot, left, query, metadata, capFinder);
if (joinType == JoinType.JOIN_LEFT_OUTER) {
savedCriteria = query.getCriteria();
query.setCriteria(null);
- } else if (joinType == JoinType.JOIN_RIGHT_OUTER || joinType == JoinType.JOIN_CROSS || joinType == JoinType.JOIN_INNER) {
- moveWhereClauseIntoOnClause(query, crits);
- }
+ }
buildQuery(accessRoot, right, query, metadata, capFinder);
if (joinType == JoinType.JOIN_LEFT_OUTER) {
moveWhereClauseIntoOnClause(query, crits);
query.setCriteria(savedCriteria);
- } else if (joinType == JoinType.JOIN_CROSS || joinType == JoinType.JOIN_INNER) {
- moveWhereClauseIntoOnClause(query, crits);
- }
+ }
// Get last two clauses added to the FROM and combine them into a JoinPredicate
From from = query.getFrom();
@@ -397,15 +391,15 @@
} else {
JoinPredicate jp = (JoinPredicate) clause;
- // Add criteria to query
- Criteria crit = query.getCriteria();
- List crits = jp.getJoinCriteria();
- if(crits != null && crits.size() > 0) {
- Iterator critIter = crits.iterator();
- while(critIter.hasNext()) {
- crit = CompoundCriteria.combineCriteria(crit, (Criteria) critIter.next());
- }
- query.setCriteria(crit);
+ List<Criteria> crits = jp.getJoinCriteria();
+ if(crits != null && crits.size() > 0) {
+ Criteria joinCrit = null;
+ if (crits.size() > 1) {
+ joinCrit = new CompoundCriteria(crits);
+ } else {
+ joinCrit = crits.get(0);
+ }
+ query.setCriteria(CompoundCriteria.combineCriteria(joinCrit, query.getCriteria()));
}
// Recurse through tree
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCopyCriteria.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCopyCriteria.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleCopyCriteria.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -43,14 +43,12 @@
import com.metamatrix.query.optimizer.relational.plantree.NodeConstants;
import com.metamatrix.query.optimizer.relational.plantree.NodeEditor;
import com.metamatrix.query.optimizer.relational.plantree.PlanNode;
-import com.metamatrix.query.optimizer.relational.plantree.NodeConstants.Info;
import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.Criteria;
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.visitor.GroupsUsedByElementsVisitor;
import com.metamatrix.query.util.CommandContext;
import com.metamatrix.query.util.LogConstants;
@@ -82,11 +80,9 @@
throws QueryPlannerException, MetaMatrixComponentException {
//do an initial check to see if an execution will be necessary
- List critNodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.SELECT);
- Iterator i = critNodes.iterator();
+ List<PlanNode> critNodes = NodeEditor.findAllNodes(plan, NodeConstants.Types.SELECT);
boolean shouldRun = false;
- while (i.hasNext()) {
- PlanNode critNode = (PlanNode)i.next();
+ for (PlanNode critNode : critNodes) {
if (!critNode.hasBooleanProperty(NodeConstants.Info.IS_COPIED)) {
shouldRun = true;
break;
@@ -104,10 +100,8 @@
}
//mark the old criteria nodes as copied. this will prevent RulePushSelectCriteria from considering them again
- i = critNodes.iterator();
- while (i.hasNext()) {
- PlanNode critNode = (PlanNode)i.next();
- critNode.setProperty(NodeConstants.Info.IS_COPIED, Boolean.TRUE);
+ for (PlanNode critNode : critNodes) {
+ critNode.setProperty(NodeConstants.Info.IS_COPIED, Boolean.TRUE);
}
return plan;
@@ -224,12 +218,7 @@
srcToTgt = buildElementMap(allCriteria);
- Set<GroupSymbol> joinGroups = (Set<GroupSymbol>) node.getProperty(Info.REMOVED_JOIN_GROUPS);
- if (joinGroups == null) {
- joinGroups = new HashSet<GroupSymbol>();
- node.setProperty(Info.REMOVED_JOIN_GROUPS, joinGroups);
- }
- changedTree = createCriteriaFromJoinCriteria(changedTree, joinCrits, combinedCriteria, srcToTgt, newJoinCrits, joinGroups);
+ changedTree = createCriteriaFromJoinCriteria(changedTree, joinCrits, combinedCriteria, srcToTgt, newJoinCrits);
joinCrits.addAll(newJoinCrits);
}
@@ -292,8 +281,7 @@
List joinCrits,
Set combinedCriteria,
Map srcToTgt,
- List newJoinCrits,
- Set<GroupSymbol> joinGroups) {
+ List newJoinCrits) {
if (srcToTgt.size() == 0) {
return changedTree;
}
@@ -302,9 +290,16 @@
Criteria crit = (Criteria)i.next();
if (copyCriteria(crit, srcToTgt, newJoinCrits, combinedCriteria, true)) {
+ changedTree = true;
+ if (crit instanceof CompareCriteria) {
+ CompareCriteria cc = (CompareCriteria)crit;
+ if (cc.getLeftExpression() instanceof ElementSymbol && cc.getRightExpression() instanceof ElementSymbol) {
+ //don't remove theta criteria, just mark it as optional
+ cc.setOptional(true);
+ continue;
+ }
+ }
i.remove();
- joinGroups.addAll(GroupsUsedByElementsVisitor.getGroups(crit));
- changedTree = true;
}
}
return changedTree;
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlanJoins.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlanJoins.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePlanJoins.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -34,6 +33,8 @@
import java.util.Map;
import java.util.Set;
+import org.teiid.connector.api.ConnectorCapabilities.SupportedJoinCriteria;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.api.exception.query.QueryPlannerException;
@@ -49,9 +50,9 @@
import com.metamatrix.query.optimizer.relational.plantree.PlanNode;
import com.metamatrix.query.processor.relational.JoinNode.JoinStrategyType;
import com.metamatrix.query.resolver.util.AccessPattern;
+import com.metamatrix.query.sql.lang.Criteria;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.symbol.ElementSymbol;
-import com.metamatrix.query.sql.symbol.GroupSymbol;
import com.metamatrix.query.util.CommandContext;
/**
@@ -104,14 +105,14 @@
- List joinRegions = new ArrayList();
+ List<JoinRegion> joinRegions = new LinkedList<JoinRegion>();
findJoinRegions(plan, null, joinRegions);
//dependency phase
- for (Iterator joinRegionIter = joinRegions.iterator(); joinRegionIter.hasNext();) {
- JoinRegion joinRegion = (JoinRegion)joinRegionIter.next();
+ for (Iterator<JoinRegion> joinRegionIter = joinRegions.iterator(); joinRegionIter.hasNext();) {
+ JoinRegion joinRegion = joinRegionIter.next();
//skip regions that have nothing to plan
if (joinRegion.getJoinSourceNodes().size() + joinRegion.getDependentJoinSourceNodes().size() < 2) {
@@ -135,15 +136,12 @@
}
//optimization phase
-
- for (Iterator joinRegionIter = joinRegions.iterator(); joinRegionIter.hasNext();) {
- JoinRegion joinRegion = (JoinRegion)joinRegionIter.next();
-
+ for (JoinRegion joinRegion : joinRegions) {
groupJoinsForPushing(metadata, capabilitiesFinder, joinRegion, context);
}
- for (Iterator joinRegionIter = joinRegions.iterator(); joinRegionIter.hasNext();) {
- JoinRegion joinRegion = (JoinRegion)joinRegionIter.next();
+ for (Iterator<JoinRegion> joinRegionIter = joinRegions.iterator(); joinRegionIter.hasNext();) {
+ JoinRegion joinRegion = joinRegionIter.next();
//move the dependent nodes back into all joinSources
joinRegion.getJoinSourceNodes().putAll(joinRegion.getDependentJoinSourceNodes());
@@ -216,24 +214,24 @@
PlanNode accessNode2 = (PlanNode)accessNodes.get(k);
- List criteriaNodes = joinRegion.getCriteriaNodes();
+ List<PlanNode> criteriaNodes = joinRegion.getCriteriaNodes();
- List joinCriteriaNodes = new LinkedList();
+ List<PlanNode> joinCriteriaNodes = new LinkedList<PlanNode>();
/* hasJoinCriteria will be true if
* 1. there is criteria between accessNode1 and accessNode2 exclusively
* 2. there is criteria between some other source (not the same logical connector) and accessNode1 or accessNode2
*
* Ideally we should be a little smarter in case 2
- * - pushing down a same source cross join can be done if we known that a dependent join will be performed
+ * - pushing down a same source cross join can be done if we know that a dependent join will be performed
*/
boolean hasJoinCriteria = false;
-
- for (Iterator critIter = criteriaNodes.iterator(); critIter.hasNext();) {
- PlanNode critNode = (PlanNode)critIter.next();
-
+ LinkedList<Criteria> joinCriteria = new LinkedList<Criteria>();
+ Object modelId = RuleRaiseAccess.getModelIDFromAccess(accessNode1, metadata);
+ SupportedJoinCriteria sjc = CapabilitiesUtil.getSupportedJoinCriteria(modelId, metadata, capFinder);
+ for (PlanNode critNode : criteriaNodes) {
Set sources = (Set)joinRegion.getCritieriaToSourceMap().get(critNode);
-
+
if (sources == null) {
continue;
}
@@ -241,13 +239,13 @@
if (sources.contains(accessNode1)) {
if (sources.contains(accessNode2) && sources.size() == 2) {
hasJoinCriteria = true;
- if (RuleRaiseAccess.canRaiseOverSelect(accessNode2, metadata, capFinder, critNode)) {
- joinCriteriaNodes.add(critNode);
- }
- } else {
- if (!accessNodes.containsAll(sources)) {
- hasJoinCriteria = true;
+ Criteria crit = (Criteria)critNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
+ if (RuleRaiseAccess.isSupportedJoinCriteria(sjc, crit, modelId, metadata, capFinder)) {
+ joinCriteriaNodes.add(critNode);
+ joinCriteria.add(crit);
}
+ } else if (!accessNodes.containsAll(sources)) {
+ hasJoinCriteria = true;
}
} else if (sources.contains(accessNode2) && !accessNodes.containsAll(sources)) {
hasJoinCriteria = true;
@@ -258,16 +256,18 @@
* If we failed to find direct criteria, but still have non-pushable or criteria to
* other groups we'll use additional checks
*/
- if (hasJoinCriteria && joinCriteriaNodes.isEmpty() && !canPushCrossJoin(joinRegion, metadata, context, accessNode1, accessNode2)) {
+ if ((!hasJoinCriteria || (hasJoinCriteria && joinCriteriaNodes.isEmpty())) && !canPushCrossJoin(metadata, context, accessNode1, accessNode2)) {
continue;
- }
+ }
List toTest = new ArrayList(2);
toTest.add(accessNode1);
toTest.add(accessNode2);
+ JoinType joinType = joinCriteria.isEmpty()?JoinType.JOIN_CROSS:JoinType.JOIN_INNER;
+
//try to push to the source
- if (RuleRaiseAccess.canRaiseOverJoin(toTest, metadata, capFinder, Collections.EMPTY_LIST, JoinType.JOIN_CROSS) == null) {
+ if (RuleRaiseAccess.canRaiseOverJoin(toTest, metadata, capFinder, joinCriteria, joinType) == null) {
continue;
}
@@ -287,16 +287,14 @@
joinNode.getGroups().addAll(accessNode2.getGroups());
joinNode.addFirstChild(accessNode2);
joinNode.addLastChild(accessNode1);
+ joinNode.setProperty(NodeConstants.Info.JOIN_TYPE, joinType);
+ joinNode.setProperty(NodeConstants.Info.JOIN_CRITERIA, joinCriteria);
- //raise access and place criteria
PlanNode newAccess = RuleRaiseAccess.raiseAccessOverJoin(joinNode, entry.getKey(), false);
for (Iterator joinCriteriaIter = joinCriteriaNodes.iterator(); joinCriteriaIter.hasNext();) {
PlanNode critNode = (PlanNode)joinCriteriaIter.next();
critNode.removeFromParent();
critNode.removeAllChildren();
- critNode.setProperty(NodeConstants.Info.IS_COPIED, Boolean.FALSE);
- critNode.setProperty(NodeConstants.Info.IS_PUSHED, Boolean.FALSE);
- newAccess.getFirstChild().addAsParent(critNode);
}
//update with the new source
@@ -323,17 +321,9 @@
}
}
- private boolean canPushCrossJoin(JoinRegion joinRegion, QueryMetadataInterface metadata,
- CommandContext context, PlanNode accessNode1, PlanNode accessNode2)
+ private boolean canPushCrossJoin(QueryMetadataInterface metadata, CommandContext context,
+ PlanNode accessNode1, PlanNode accessNode2)
throws QueryMetadataException, MetaMatrixComponentException {
- /*
- * Check for the possibility that the join criteria was removed by rule copy criteria
- */
- Set<GroupSymbol> removedGroups = joinRegion.getRemovedJoinGroups();
- if (removedGroups != null && !Collections.disjoint(removedGroups, accessNode1.getGroups()) && !Collections.disjoint(removedGroups, accessNode2.getGroups())) {
- return true;
- }
-
float cost1 = NewCalculateCostUtil.computeCostForTree(accessNode1, metadata);
float cost2 = NewCalculateCostUtil.computeCostForTree(accessNode2, metadata);
float acceptableCost = context == null? 45.0f : (float)Math.sqrt(context.getProcessorBatchSize());
@@ -361,7 +351,7 @@
}
Object accessModelID = RuleRaiseAccess.getModelIDFromAccess(node, metadata);
- if (accessModelID == null || !CapabilitiesUtil.supportsJoins(accessModelID, metadata, capFinder)) {
+ if (accessModelID == null || !CapabilitiesUtil.supportsJoin(accessModelID, JoinType.JOIN_INNER, metadata, capFinder)) {
continue;
}
@@ -461,13 +451,13 @@
/**
* Finds all regions of inner and cross joins
*
- * Join regions have boundries at source nodes, outer joins, and unsatisfied dependencies
+ * Join regions have boundaries at source nodes, outer joins, and unsatisfied dependencies
*
* @param root
* @param currentRegion
* @param joinRegions
*/
- static void findJoinRegions(PlanNode root, JoinRegion currentRegion, List joinRegions) {
+ static void findJoinRegions(PlanNode root, JoinRegion currentRegion, List<JoinRegion> joinRegions) {
switch (root.getType()) {
case NodeConstants.Types.JOIN:
{
@@ -485,10 +475,8 @@
currentRegion.addParentCriteria(root);
currentRegion.addJoinCriteriaList((List)root.getProperty(NodeConstants.Info.JOIN_CRITERIA));
}
- currentRegion.addRemovedJoinGroups(root);
- for (Iterator i = root.getChildren().iterator(); i.hasNext();) {
- PlanNode child = (PlanNode)i.next();
+ for (PlanNode child : root.getChildren()) {
findJoinRegions(child, treatJoinAsSource?null:currentRegion, joinRegions);
}
@@ -514,8 +502,7 @@
if (root.getChildCount() == 0) {
return;
}
- for (Iterator i = root.getChildren().iterator(); i.hasNext();) {
- PlanNode child = (PlanNode)i.next();
+ for (PlanNode child : root.getChildren()) {
findJoinRegions(child, root.getChildCount()==1?currentRegion:null, joinRegions);
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePushSelectCriteria.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RulePushSelectCriteria.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -49,6 +49,7 @@
import com.metamatrix.query.sql.lang.CompoundCriteria;
import com.metamatrix.query.sql.lang.Criteria;
import com.metamatrix.query.sql.lang.JoinType;
+import com.metamatrix.query.sql.lang.SubqueryContainer;
import com.metamatrix.query.sql.symbol.ElementSymbol;
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.GroupSymbol;
@@ -117,8 +118,11 @@
}
case NodeConstants.Types.JOIN:
{
- moved = handleJoinCriteria(sourceNode, critNode, metadata);
- break;
+ //pushing below a join is not necessary under an access node
+ if (NodeEditor.findParent(critNode, NodeConstants.Types.ACCESS) == null) {
+ moved = handleJoinCriteria(sourceNode, critNode, metadata);
+ break;
+ }
}
}
@@ -137,7 +141,7 @@
CapabilitiesFinder capFinder, PlanNode critNode)
throws MetaMatrixComponentException, QueryMetadataException {
if (critNode.getGroups().isEmpty()) {
- Object modelId = RuleRaiseAccess.isEligibleSubquery(critNode, null, metadata, capFinder);
+ Object modelId = getSubqueryModelId(metadata, capFinder, critNode);
if (modelId != null) {
for (PlanNode node : NodeEditor.findAllNodes(critNode, NodeConstants.Types.SOURCE)) {
GroupSymbol group = node.getGroups().iterator().next();
@@ -150,6 +154,24 @@
}
return FrameUtil.findOriginatingNode(critNode, critNode.getGroups());
}
+
+ private Object getSubqueryModelId(QueryMetadataInterface metadata,
+ CapabilitiesFinder capFinder, PlanNode critNode)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ Object modelId = null;
+ for (SubqueryContainer subqueryContainer : critNode.getSubqueryContainers()) {
+ Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder);
+ if (validId == null) {
+ return null;
+ }
+ if (modelId == null) {
+ modelId = validId;
+ } else if (!CapabilitiesUtil.isSameConnector(modelId, validId, metadata, capFinder)) {
+ return null;
+ }
+ }
+ return modelId;
+ }
/**
* Handles multi-group criteria originating at the given joinNode
@@ -267,6 +289,11 @@
throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0020, currentNode.getGroups()));
}
} else if(currentNode.getType() == NodeConstants.Types.JOIN) {
+ //pushing below a join is not necessary under an access node
+ if (NodeEditor.findParent(currentNode, NodeConstants.Types.ACCESS) != null) {
+ return currentNode;
+ }
+
// Check whether this criteria is on the inner side of an outer join.
// If so, can't push past the join
JoinType jt = JoinUtil.getJoinTypePreventingCriteriaOptimization(currentNode, critNode);
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/rules/RuleRaiseAccess.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -25,32 +25,28 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.teiid.connector.api.ConnectorCapabilities.SupportedJoinCriteria;
+
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.api.exception.query.QueryPlannerException;
import com.metamatrix.query.analysis.AnalysisRecord;
-import com.metamatrix.query.execution.QueryExecPlugin;
import com.metamatrix.query.metadata.QueryMetadataInterface;
+import com.metamatrix.query.metadata.SupportConstants;
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
+import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
import com.metamatrix.query.optimizer.relational.OptimizerRule;
import com.metamatrix.query.optimizer.relational.RuleStack;
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.processor.ProcessorPlan;
-import com.metamatrix.query.processor.relational.AccessNode;
-import com.metamatrix.query.processor.relational.RelationalNode;
-import com.metamatrix.query.processor.relational.RelationalPlan;
-import com.metamatrix.query.sql.lang.Command;
+import com.metamatrix.query.sql.lang.CompareCriteria;
import com.metamatrix.query.sql.lang.Criteria;
import com.metamatrix.query.sql.lang.JoinType;
-import com.metamatrix.query.sql.lang.Query;
-import com.metamatrix.query.sql.lang.SubqueryContainer;
import com.metamatrix.query.sql.lang.SetQuery.Operation;
import com.metamatrix.query.sql.symbol.AggregateSymbol;
import com.metamatrix.query.sql.symbol.Constant;
@@ -60,8 +56,6 @@
import com.metamatrix.query.sql.symbol.SingleElementSymbol;
import com.metamatrix.query.sql.util.SymbolMap;
import com.metamatrix.query.sql.visitor.EvaluateExpressionVisitor;
-import com.metamatrix.query.sql.visitor.GroupCollectorVisitor;
-import com.metamatrix.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import com.metamatrix.query.util.CommandContext;
public final class RuleRaiseAccess implements OptimizerRule {
@@ -107,7 +101,7 @@
switch(parentNode.getType()) {
case NodeConstants.Types.JOIN:
{
- modelID = canRaiseOverJoin(parentNode, metadata, capFinder, afterJoinPlanning);
+ modelID = canRaiseOverJoin(modelID, parentNode, metadata, capFinder, afterJoinPlanning);
if(modelID != null) {
raiseAccessOverJoin(parentNode, modelID, true);
return rootNode;
@@ -119,10 +113,6 @@
// Check that the PROJECT contains only functions that can be pushed
List projectCols = (List) parentNode.getProperty(NodeConstants.Info.PROJECT_COLS);
- if(isEligibleSubquery(parentNode, modelID, metadata, capFinder) == null){
- return null;
- }
-
for (int i = 0; i < projectCols.size(); i++) {
SingleElementSymbol symbol = (SingleElementSymbol)projectCols.get(i);
if(! canPushSymbol(symbol, true, modelID, metadata, capFinder)) {
@@ -135,10 +125,15 @@
case NodeConstants.Types.DUP_REMOVE:
{
// If model supports the support constant parameter, then move access node
- if(CapabilitiesUtil.supportsSelectDistinct(modelID, metadata, capFinder)) {
- return performRaise(rootNode, accessNode, parentNode);
+ if(!CapabilitiesUtil.supportsSelectDistinct(modelID, metadata, capFinder)) {
+ return null;
}
- return null;
+
+ if (!CapabilitiesUtil.checkElementsAreSearchable((List)NodeEditor.findNodePreOrder(parentNode, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) {
+ return null;
+ }
+
+ return performRaise(rootNode, accessNode, parentNode);
}
case NodeConstants.Types.SORT:
{
@@ -245,7 +240,7 @@
}
}
}
- return true;
+ return CapabilitiesUtil.checkElementsAreSearchable(groupCols, metadata, SupportConstants.Element.SEARCHABLE_COMPARE);
}
static boolean canRaiseOverSort(PlanNode accessNode,
@@ -279,11 +274,12 @@
}
}
+ if (!CapabilitiesUtil.checkElementsAreSearchable(sortCols, metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) {
+ return false;
+ }
+
// If model supports the support constant parameter, then move access node
- if(CapabilitiesUtil.supportsOrderBy(modelID, metadata, capFinder)) {
- return true;
- }
- return false;
+ return CapabilitiesUtil.supportsOrderBy(modelID, metadata, capFinder);
}
/**
@@ -313,6 +309,10 @@
return false;
}
+ if (parentNode.hasBooleanProperty(NodeConstants.Info.IS_HAVING) && !CapabilitiesUtil.supports(Capability.QUERY_HAVING, modelID, metadata, capFinder)) {
+ return false;
+ }
+
//don't push criteria into an invalid location above an ordered limit - shouldn't happen
PlanNode limitNode = NodeEditor.findNodePreOrder(accessNode, NodeConstants.Types.TUPLE_LIMIT, NodeConstants.Types.SOURCE);
if (limitNode != null && NodeEditor.findNodePreOrder(limitNode, NodeConstants.Types.SORT, NodeConstants.Types.SOURCE) != null) {
@@ -321,10 +321,6 @@
Criteria crit = (Criteria) parentNode.getProperty(NodeConstants.Info.SELECT_CRITERIA);
- if(isEligibleSubquery(parentNode, modelID, metadata, capFinder) == null){
- return false;
- }
-
if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, modelID, metadata, capFinder) ) {
return false;
}
@@ -332,81 +328,10 @@
if (accessNode.getFirstChild() != null && accessNode.getFirstChild().getType() == NodeConstants.Types.SET_OP) {
return false; //inconsistent select position - RulePushSelectCriteria is too greedy
}
-
- //TODO: check for "and" support
-
+
return true;
}
-
- /**
- * Check whether the subquery in the node is eligible to be pushed.
- */
- static Object isEligibleSubquery(PlanNode critNode, Object critNodeModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws MetaMatrixComponentException {
- return isEligibleSubquery(critNode.getSubqueryContainers(), critNodeModelID, metadata, capFinder);
- }
-
- static Object isEligibleSubquery(List<SubqueryContainer> plans, Object critNodeModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder) throws MetaMatrixComponentException {
- for (SubqueryContainer subqueryContainer : plans) {
- ProcessorPlan plan = subqueryContainer.getCommand().getProcessorPlan();
- if(!(plan instanceof RelationalPlan)) {
- return null;
- }
- RelationalPlan rplan = (RelationalPlan) plan;
-
- // Check that the plan is just an access node
- RelationalNode accessNode = rplan.getRootNode();
- if(accessNode == null || ! (accessNode instanceof AccessNode) || accessNode.getChildren()[0] != null) {
- return null;
- }
-
- // Check that command in access node is a query
- Command command = ((AccessNode)accessNode).getCommand();
- if(command == null || !(command instanceof Query) || ((Query)command).getIsXML()) {
- return null;
- }
-
- // Check that query in access node is for the same model as current node
- try {
- Collection subQueryGroups = GroupCollectorVisitor.getGroupsIgnoreInlineViews(command, false);
- if(subQueryGroups.size() == 0) {
- // No FROM?
- return null;
- }
- GroupSymbol subQueryGroup = (GroupSymbol)subQueryGroups.iterator().next();
-
- Object modelID = metadata.getModelID(subQueryGroup.getMetadataID());
- if (critNodeModelID == null) {
- critNodeModelID = modelID;
- } else if(!CapabilitiesUtil.isSameConnector(critNodeModelID, modelID, metadata, capFinder)) {
- return null;
- }
- } catch(QueryMetadataException e) {
- throw new MetaMatrixComponentException(e, QueryExecPlugin.Util.getString("RulePushSelectCriteria.Error_getting_modelID")); //$NON-NLS-1$
- }
-
- // Check whether source supports correlated subqueries and if not, whether criteria has them
- SymbolMap refs = subqueryContainer.getCommand().getCorrelatedReferences();
- try {
- if(refs != null && !refs.asMap().isEmpty()) {
- if(! CapabilitiesUtil.supportsCorrelatedSubquery(critNodeModelID, metadata, capFinder)) {
- return null;
- }
- //TODO: this check sees as correlated references as coming from the containing scope
- //but this is only an issue with deeply nested subqueries
- if (!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(command, critNodeModelID, metadata, capFinder)) {
- return null;
- }
- }
- } catch(QueryMetadataException e) {
- throw new MetaMatrixComponentException(e);
- }
- }
-
- // Found no reason why this node is not eligible
- return critNodeModelID;
- }
-
/**
*
* @param symbol Symbol to check
@@ -429,9 +354,11 @@
return false;
}
- if(inSelectClause && !(expr instanceof ElementSymbol) && !CapabilitiesUtil.supportsSelectLiterals(modelID, metadata, capFinder)
+ if(inSelectClause && !(expr instanceof ElementSymbol)) {
+ if (!CapabilitiesUtil.supportsSelectLiterals(modelID, metadata, capFinder)
&& (expr instanceof Constant || EvaluateExpressionVisitor.willBecomeConstant(expr))) {
- return false;
+ return false;
+ }
}
// By default, no reason we can't push
@@ -462,7 +389,7 @@
* @return The modelID if the raise can proceed and what common model these combined
* nodes will be sent to
*/
- private static Object canRaiseOverJoin(PlanNode joinNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, boolean afterJoinPlanning)
+ private static Object canRaiseOverJoin(Object modelId, PlanNode joinNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, boolean afterJoinPlanning)
throws QueryMetadataException, MetaMatrixComponentException {
List crits = (List) joinNode.getProperty(NodeConstants.Info.JOIN_CRITERIA);
@@ -485,28 +412,41 @@
return null;
}
+ //if I'm on the inner side of an outer join, then and we have a criteria restriction, then I can't be pushed
+ if (type.isOuter() && CapabilitiesUtil.getSupportedJoinCriteria(modelId, metadata, capFinder) != SupportedJoinCriteria.ANY) {
+ PlanNode critNode = NodeEditor.findNodePreOrder(joinNode.getLastChild(), NodeConstants.Types.SELECT, NodeConstants.Types.SOURCE);
+ if (critNode != null) {
+ return null;
+ }
+ if (type == JoinType.JOIN_FULL_OUTER) {
+ critNode = NodeEditor.findNodePreOrder(joinNode.getFirstChild(), NodeConstants.Types.SELECT, NodeConstants.Types.SOURCE);
+ if (critNode != null) {
+ return null;
+ }
+ }
+ }
+
return canRaiseOverJoin(joinNode.getChildren(), metadata, capFinder, crits, type);
}
- static Object canRaiseOverJoin(List children,
+ static Object canRaiseOverJoin(List<PlanNode> children,
QueryMetadataInterface metadata,
CapabilitiesFinder capFinder,
List<Criteria> crits,
JoinType type) throws QueryMetadataException,
MetaMatrixComponentException {
- Object modelID = null;
- Set groupIDs = new HashSet();
+ //we only want to consider binary joins
+ if (children.size() != 2) {
+ return null;
+ }
+
+ Object modelID = null;
+ Set<Object> groupIDs = new HashSet<Object>();
int groupCount = 0;
- // Walk through each of the join node children - all of them should be access nodes
- // if the raise can occur.
- Iterator childIter = children.iterator();
- while(childIter.hasNext()) {
- PlanNode childNode = (PlanNode) childIter.next();
-
- if(childNode.getType() != NodeConstants.Types.ACCESS) {
- // If one of the children is not an access node (or, in a rare case, a join node),
- // then we can't raise the access nodes
+ for (PlanNode childNode : children) {
+ if(childNode.getType() != NodeConstants.Types.ACCESS
+ || childNode.hasCollectionProperty(NodeConstants.Info.ACCESS_PATTERNS)) {
return null;
}
Object accessModelID = getModelIDFromAccess(childNode, metadata);
@@ -531,30 +471,67 @@
}
}
}
-
+
+ //check the join criteria now that we know the model
if(modelID == null) {
- // Check that model supports join
- if(!CapabilitiesUtil.supportsJoins(accessModelID, metadata, capFinder)) {
- return null;
- }
- // Check that if join is outer, model supports it
+ if (!CapabilitiesUtil.supportsJoin(accessModelID, type, metadata, capFinder)) {
+ return null;
+ }
+ SupportedJoinCriteria sjc = CapabilitiesUtil.getSupportedJoinCriteria(accessModelID, metadata, capFinder);
- if(type.isOuter() && !CapabilitiesUtil.supportsOuterJoin(accessModelID, type, metadata, capFinder)) {
- //join is outer and model does not support
- return null;
- }
-
- // Check that model supports join expressions
+ /*
+ * Key joins must be left linear
+ */
+ if (sjc == SupportedJoinCriteria.KEY && children.get(1).getGroups().size() != 1) {
+ return null;
+ }
+
if(crits != null && !crits.isEmpty()) {
+ List<Object> leftIds = null;
+ List<Object> rightIds = null;
+ GroupSymbol leftGroup = null;
for (Criteria crit : crits) {
- if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, accessModelID, metadata, capFinder) ) {
- return null;
- }
+ if (!isSupportedJoinCriteria(sjc, crit, accessModelID, metadata, capFinder)) {
+ return null;
+ }
+ if (sjc != SupportedJoinCriteria.KEY) {
+ continue;
+ }
+ //key join
+ //TODO: this would be much simpler if we could rely on rulechoosejoinstrategy running first
+ if (leftIds == null) {
+ leftIds = new ArrayList<Object>();
+ rightIds = new ArrayList<Object>();
+ }
+ ElementSymbol leftSymbol = (ElementSymbol)((CompareCriteria)crit).getLeftExpression();
+ ElementSymbol rightSymbol = (ElementSymbol)((CompareCriteria)crit).getRightExpression();
+ if ((children.get(0).getGroups().contains(leftSymbol.getGroupSymbol()) && children.get(1).getGroups().contains(rightSymbol.getGroupSymbol()))
+ || (children.get(1).getGroups().contains(leftSymbol.getGroupSymbol()) && children.get(0).getGroups().contains(rightSymbol.getGroupSymbol()))) {
+ boolean left = children.get(0).getGroups().contains(leftSymbol.getGroupSymbol());
+ if (leftGroup == null) {
+ leftGroup = left?leftSymbol.getGroupSymbol():rightSymbol.getGroupSymbol();
+ } else if (!leftGroup.equals(left?leftSymbol.getGroupSymbol():rightSymbol.getGroupSymbol())) {
+ return null;
+ }
+ if (left) {
+ leftIds.add(leftSymbol.getMetadataID());
+ rightIds.add(rightSymbol.getMetadataID());
+ } else {
+ rightIds.add(leftSymbol.getMetadataID());
+ leftIds.add(rightSymbol.getMetadataID());
+ }
+ } else {
+ return null;
+ }
}
- if(isEligibleSubquery(ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(crits), accessModelID, metadata, capFinder) == null){
- return null;
- }
+ if (leftIds != null &&
+ !matchesForeignKey(metadata, leftIds, rightIds, leftGroup)
+ && !matchesForeignKey(metadata, rightIds, leftIds, children.get(1).getGroups().iterator().next())) {
+ return null;
+ }
+ } else if (sjc != SupportedJoinCriteria.ANY) {
+ return null; //cross join not supported
}
modelID = accessModelID;
@@ -562,13 +539,6 @@
} else if(!CapabilitiesUtil.isSameConnector(modelID, accessModelID, metadata, capFinder)) {
return null;
}
-
- if (childNode.hasCollectionProperty(NodeConstants.Info.ACCESS_PATTERNS)) {
- return null;
- }
-
- //check the group count
-
} // end walking through join node's children
int maxGroups = CapabilitiesUtil.getMaxFromGroups(modelID, metadata, capFinder);
@@ -579,7 +549,60 @@
return modelID;
}
-
+
+ /**
+ * Checks criteria one predicate at a time. Only tests up to the equi restriction.
+ */
+ static boolean isSupportedJoinCriteria(SupportedJoinCriteria sjc, Criteria crit, Object accessModelID, QueryMetadataInterface metadata, CapabilitiesFinder capFinder)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ if(!CriteriaCapabilityValidatorVisitor.canPushLanguageObject(crit, accessModelID, metadata, capFinder) ) {
+ return false;
+ }
+ if (sjc == SupportedJoinCriteria.ANY) {
+ return true;
+ }
+ //theta join must be between elements with a compare predicate
+ if (!(crit instanceof CompareCriteria)) {
+ return false;
+ }
+ CompareCriteria cc = (CompareCriteria)crit;
+ if (!(cc.getLeftExpression() instanceof ElementSymbol)) {
+ return false;
+ }
+ if (!(cc.getRightExpression() instanceof ElementSymbol)) {
+ return false;
+ }
+ if (sjc == SupportedJoinCriteria.THETA) {
+ return true;
+ }
+ //equi must use the equality operator
+ if (cc.getOperator() != CompareCriteria.EQ) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * TODO: gracefully handle too much criteria
+ */
+ private static boolean matchesForeignKey(QueryMetadataInterface metadata,
+ List<Object> leftIds, List<Object> rightIds, GroupSymbol leftGroup)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ Collection fks = metadata.getForeignKeysInGroup(leftGroup.getMetadataID());
+ for (Object fk : fks) {
+ List fkColumns = metadata.getElementIDsInKey(fk);
+ if (!leftIds.containsAll(fkColumns) || leftIds.size() != fkColumns.size()) {
+ continue;
+ }
+ Object pk = metadata.getPrimaryKeyIDForForeignKeyID(fk);
+ List pkColumns = metadata.getElementIDsInKey(pk);
+ if (rightIds.containsAll(pkColumns) && rightIds.size() == pkColumns.size()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
static PlanNode raiseAccessOverJoin(PlanNode joinNode, Object modelID, boolean insert) {
PlanNode leftAccess = joinNode.getFirstChild();
PlanNode rightAccess = joinNode.getLastChild();
@@ -676,6 +699,11 @@
} else if(!CapabilitiesUtil.isSameConnector(modelID, accessModelID, metadata, capFinder)) {
return false;
}
+ if (!setOpNode.hasBooleanProperty(NodeConstants.Info.USE_ALL)
+ && !CapabilitiesUtil.checkElementsAreSearchable((List)NodeEditor.findNodePreOrder(childNode, NodeConstants.Types.PROJECT).getProperty(NodeConstants.Info.PROJECT_COLS), metadata, SupportConstants.Element.SEARCHABLE_COMPARE)) {
+ return false;
+ }
+
}
return true;
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/CompareCriteria.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/CompareCriteria.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/CompareCriteria.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -44,6 +44,7 @@
/** The right-hand expression. */
private Expression rightExpression;
+ private boolean isOptional;
/**
* Constructs a default instance of this class.
@@ -94,6 +95,24 @@
setOperator(operator);
setRightExpression(rightExpression);
}
+
+ /**
+ * Set during planning to indicate that this criteria is no longer needed
+ * to correctly process a join
+ * @param isOptional
+ */
+ public void setOptional(boolean isOptional) {
+ this.isOptional = isOptional;
+ }
+
+ /**
+ * Returns true if the compare criteria is used as join criteria, but not needed
+ * during processing.
+ * @return
+ */
+ public boolean isOptional() {
+ return isOptional;
+ }
public void acceptVisitor(LanguageVisitor visitor) {
visitor.visit(this);
@@ -148,7 +167,9 @@
rightCopy = (Expression) getRightExpression().clone();
}
- return new CompareCriteria(leftCopy, getOperator(), rightCopy);
+ CompareCriteria result = new CompareCriteria(leftCopy, getOperator(), rightCopy);
+ result.isOptional = isOptional;
+ return result;
}
} // END CLASS
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Criteria.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Criteria.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/lang/Criteria.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -128,18 +128,23 @@
public static Criteria combineCriteria(Criteria primaryCrit, Criteria additionalCrit, boolean disjunctively) {
if(primaryCrit == null) {
return additionalCrit;
- } else if(additionalCrit == null) {
+ }
+ if(additionalCrit == null) {
return primaryCrit;
- } else if((primaryCrit instanceof CompoundCriteria) && ((CompoundCriteria)primaryCrit).getOperator() == (disjunctively?CompoundCriteria.OR:CompoundCriteria.AND)) {
- ((CompoundCriteria)primaryCrit).addCriteria(additionalCrit);
- return primaryCrit;
+ }
+ CompoundCriteria compCrit = new CompoundCriteria();
+ compCrit.setOperator((disjunctively?CompoundCriteria.OR:CompoundCriteria.AND));
+ if ((primaryCrit instanceof CompoundCriteria) && ((CompoundCriteria)primaryCrit).getOperator() == (disjunctively?CompoundCriteria.OR:CompoundCriteria.AND)) {
+ compCrit.getCriteria().addAll(((CompoundCriteria)primaryCrit).getCriteria());
} else {
- CompoundCriteria compCrit = new CompoundCriteria();
- compCrit.setOperator((disjunctively?CompoundCriteria.OR:CompoundCriteria.AND));
compCrit.addCriteria(primaryCrit);
+ }
+ if ((additionalCrit instanceof CompoundCriteria) && ((CompoundCriteria)additionalCrit).getOperator() == (disjunctively?CompoundCriteria.OR:CompoundCriteria.AND)) {
+ compCrit.getCriteria().addAll(((CompoundCriteria)additionalCrit).getCriteria());
+ } else {
compCrit.addCriteria(additionalCrit);
- return compCrit;
- }
+ }
+ return compCrit;
}
public static Criteria toDisjunctiveNormalForm(Criteria input) {
Modified: trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/ElementCollectorVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/ElementCollectorVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/sql/visitor/ElementCollectorVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -117,7 +117,7 @@
PreOrderNavigator.doVisit(obj, visitor);
}
- public static final void getElements(Collection<LanguageObject> objs, Collection<ElementSymbol> elements) {
+ public static final void getElements(Collection<? extends LanguageObject> objs, Collection<ElementSymbol> elements) {
if(objs == null) {
return;
}
Modified: trunk/engine/src/main/java/com/metamatrix/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/validator/ValidationVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/com/metamatrix/query/validator/ValidationVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -41,7 +41,6 @@
import com.metamatrix.query.function.FunctionLibrary;
import com.metamatrix.query.metadata.SupportConstants;
import com.metamatrix.query.resolver.util.ResolverUtil;
-import com.metamatrix.query.resolver.util.ResolverUtil.ResolvedLookup;
import com.metamatrix.query.sql.LanguageObject;
import com.metamatrix.query.sql.LanguageVisitor;
import com.metamatrix.query.sql.ProcedureReservedWords;
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,7 +22,8 @@
package org.teiid.dqp.internal.datamgr;
-import java.util.*;
+import java.util.Iterator;
+import java.util.List;
import org.teiid.connector.api.ConnectorCapabilities;
@@ -46,37 +47,27 @@
public static BasicSourceCapabilities convertCapabilities(ConnectorCapabilities srcCaps, String connectorID, boolean isXa) {
BasicSourceCapabilities tgtCaps = new BasicSourceCapabilities();
+ tgtCaps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, srcCaps.supportsSelectExpression());
tgtCaps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, srcCaps.supportsSelectDistinct());
- tgtCaps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, srcCaps.supportsSelectLiterals());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, srcCaps.supportsAliasedGroup());
- tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, srcCaps.supportsJoins());
+ tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, srcCaps.supportsInnerJoins());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, srcCaps.supportsSelfJoins());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, srcCaps.supportsOuterJoins());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, srcCaps.supportsFullOuterJoins());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, srcCaps.supportsInlineViews());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE, srcCaps.supportsCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_BETWEEN, srcCaps.supportsBetweenCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, srcCaps.supportsCompareCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, srcCaps.supportsCompareCriteriaEquals());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, srcCaps.supportsCompareCriteriaNotEquals());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LT, srcCaps.supportsCompareCriteriaLessThan());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LE, srcCaps.supportsCompareCriteriaLessThanOrEqual());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, srcCaps.supportsCompareCriteriaGreaterThan());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, srcCaps.supportsCompareCriteriaGreaterThanOrEqual());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, srcCaps.supportsLikeCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, srcCaps.supportsLikeCriteriaEscapeCharacter());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_IN, srcCaps.supportsInCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, srcCaps.supportsInCriteriaSubquery());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, srcCaps.supportsIsNullCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_AND, srcCaps.supportsAndCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_OR, srcCaps.supportsOrCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, srcCaps.supportsNotCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, srcCaps.supportsExistsCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, srcCaps.supportsQuantifiedCompareCriteria());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, srcCaps.supportsQuantifiedCompareCriteriaSome());
- tgtCaps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, srcCaps.supportsQuantifiedCompareCriteriaAll());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, srcCaps.supportsCompareCriteriaEquals());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, srcCaps.supportsCompareCriteriaOrdered());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_LIKE, srcCaps.supportsLikeCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, srcCaps.supportsLikeCriteriaEscapeCharacter());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_IN, srcCaps.supportsInCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, srcCaps.supportsInCriteriaSubquery());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_ISNULL, srcCaps.supportsIsNullCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_OR, srcCaps.supportsOrCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_NOT, srcCaps.supportsNotCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_EXISTS, srcCaps.supportsExistsCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, srcCaps.supportsQuantifiedCompareCriteriaSome());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, srcCaps.supportsQuantifiedCompareCriteriaAll());
tgtCaps.setCapabilitySupport(Capability.QUERY_ORDERBY, srcCaps.supportsOrderBy());
- tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES, srcCaps.supportsAggregates());
tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, srcCaps.supportsAggregatesSum());
tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES_AVG, srcCaps.supportsAggregatesAvg());
tgtCaps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MIN, srcCaps.supportsAggregatesMin());
@@ -94,14 +85,14 @@
tgtCaps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, srcCaps.supportsSetQueryOrderBy());
tgtCaps.setCapabilitySupport(Capability.BULK_INSERT , srcCaps.supportsBulkInsert());
tgtCaps.setCapabilitySupport(Capability.BATCHED_UPDATES, srcCaps.supportsBatchedUpdates());
- tgtCaps.setCapabilitySupport(Capability.FUNCTION, srcCaps.supportsScalarFunctions());
tgtCaps.setCapabilitySupport(Capability.QUERY_FUNCTIONS_IN_GROUP_BY, srcCaps.supportsFunctionsInGroupBy());
tgtCaps.setCapabilitySupport(Capability.ROW_LIMIT, srcCaps.supportsRowLimit());
tgtCaps.setCapabilitySupport(Capability.ROW_OFFSET, srcCaps.supportsRowOffset());
tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_ANSI_JOIN, srcCaps.useAnsiJoin());
tgtCaps.setCapabilitySupport(Capability.REQUIRES_CRITERIA, srcCaps.requiresCriteria());
tgtCaps.setCapabilitySupport(Capability.QUERY_GROUP_BY, srcCaps.supportsGroupBy());
-
+ tgtCaps.setCapabilitySupport(Capability.QUERY_HAVING, srcCaps.supportsHaving());
+
List functions = srcCaps.getSupportedFunctions();
if(functions != null && functions.size() > 0) {
Iterator iter = functions.iterator();
@@ -115,6 +106,7 @@
tgtCaps.setSourceProperty(Capability.CONNECTOR_ID, connectorID);
tgtCaps.setSourceProperty(Capability.MAX_QUERY_FROM_GROUPS, new Integer(srcCaps.getMaxFromGroups()));
tgtCaps.setSourceProperty(Capability.TRANSACTIONS_XA, isXa);
+ tgtCaps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, srcCaps.getSupportedJoinCriteria());
return tgtCaps;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceCapabilitiesFinder.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceCapabilitiesFinder.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceCapabilitiesFinder.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -88,7 +88,15 @@
Capability.QUERY_UNION,
Capability.QUERY_EXCEPT,
Capability.QUERY_INTERSECT,
- Capability.QUERY_AGGREGATES,
+ Capability.QUERY_AGGREGATES_AVG,
+ Capability.QUERY_AGGREGATES_COUNT,
+ Capability.QUERY_AGGREGATES_COUNT_STAR,
+ Capability.QUERY_AGGREGATES_DISTINCT,
+ Capability.QUERY_AGGREGATES_MAX,
+ Capability.QUERY_AGGREGATES_MIN,
+ Capability.QUERY_AGGREGATES_SUM,
+ Capability.QUERY_GROUP_BY,
+ Capability.QUERY_HAVING,
Capability.QUERY_ORDERBY,
Capability.QUERY_SELECT_DISTINCT,
Capability.ROW_LIMIT,
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAggregatePushdown.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAggregatePushdown.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAggregatePushdown.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,8 +22,9 @@
package com.metamatrix.query.optimizer;
-import junit.framework.TestCase;
+import org.junit.Test;
+import com.metamatrix.query.optimizer.TestOptimizer.ComparisonMode;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
@@ -31,7 +32,7 @@
import com.metamatrix.query.unittest.FakeMetadataFacade;
import com.metamatrix.query.unittest.FakeMetadataFactory;
-public class TestAggregatePushdown extends TestCase {
+public class TestAggregatePushdown {
private FakeCapabilitiesFinder getAggregatesFinder() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
@@ -45,7 +46,7 @@
return capFinder;
}
- public void testCase6327() {
+ @Test public void testCase6327() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -85,7 +86,7 @@
*
* Note also that this test shows that the max aggregate is not placed on the bqt2 query since it would be on one of the group by expressions
*/
- public void testAggregateOfJoinExpression() throws Exception {
+ @Test public void testAggregateOfJoinExpression() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -124,7 +125,7 @@
* Note that even though this grouping is join invariant, we still do not remove the top level group by
* since we are not checking the uniqueness of the x side join expressions
*/
- public void testInvariantAggregate() throws Exception {
+ @Test public void testInvariantAggregate() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -158,7 +159,7 @@
/**
* Test of an aggregate nested in an expression symbol
*/
- public void testCase6211() throws Exception {
+ @Test public void testCase6211() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -195,7 +196,7 @@
/**
* Note that until we can test the other side cardinality, we cannot fully push the group node
*/
- public void testAggregatePushdown1() throws Exception {
+ @Test public void testAggregatePushdown1() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleAggregatesCached();
String sql = "SELECT o_dealerid, o_productid, sum(o_amount) FROM m1.order, m1.dealer, m2.product " + //$NON-NLS-1$
"WHERE o_dealerid=d_dealerid AND o_productid=p_productid AND d_state = 'CA' AND p_divid = 100 " + //$NON-NLS-1$
@@ -204,7 +205,7 @@
ProcessorPlan plan = TestOptimizer.helpPlan(sql,
metadata,
null, getAggregatesFinder(),
- new String[] {"SELECT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, SUM(g_0.o_amount) AS c_2 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_productid IN (<dependent values>)) AND (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, SUM(g_0.o_amount) AS c_2 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING );
TestOptimizer.checkNodeTypes(plan, new int[] {
@@ -225,7 +226,7 @@
});
}
- public void testAggregatePushdown2() throws Exception {
+ @Test public void testAggregatePushdown2() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleAggregatesCached();
String sql = "SELECT o_dealerid, o_productid, sum(o_amount) FROM m1.order, m1.dealer, m2.product " + //$NON-NLS-1$
"WHERE o_dealerid=d_dealerid AND o_productid=p_productid AND d_state = 'CA' AND p_divid = 100 " + //$NON-NLS-1$
@@ -234,7 +235,7 @@
ProcessorPlan plan = TestOptimizer.helpPlan(sql,
metadata,
null, getAggregatesFinder(),
- new String[] {"SELECT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, MAX(g_0.o_amount) AS c_2, SUM(g_0.o_amount) AS c_3 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_productid IN (<dependent values>)) AND (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT g_0.p_productid AS c_0 FROM m2.product AS g_0 WHERE g_0.p_divid = 100 ORDER BY c_0", "SELECT g_0.o_productid AS c_0, g_0.o_dealerid AS c_1, MAX(g_0.o_amount) AS c_2, SUM(g_0.o_amount) AS c_3 FROM m1.\"order\" AS g_0, m1.dealer AS g_1 WHERE (g_0.o_dealerid = g_1.d_dealerid) AND (g_1.d_state = 'CA') AND (g_0.o_productid IN (<dependent values>)) GROUP BY g_0.o_productid, g_0.o_dealerid ORDER BY c_0"}, //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING );
TestOptimizer.checkNodeTypes(plan, new int[] {
@@ -258,7 +259,7 @@
/**
* Average requires the creation of staged sum and count aggregates
*/
- public void testAvgAggregate() throws Exception {
+ @Test public void testAvgAggregate() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -290,7 +291,7 @@
});
}
- public void testCountAggregate() throws Exception {
+ @Test public void testCountAggregate() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -322,7 +323,7 @@
});
}
- public void testOuterJoinPreventsPushdown() throws Exception {
+ @Test public void testOuterJoinPreventsPushdown() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -358,7 +359,7 @@
* Test to ensure count(*) isn't mistakenly pushed to either side, but that
* grouping can still be.
*/
- public void testCase5724() {
+ @Test public void testCase5724() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -394,7 +395,7 @@
});
}
- public void testCase6210() throws Exception {
+ @Test public void testCase6210() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -431,10 +432,11 @@
});
}
- public void testNoGroupAggregatePushdown() {
+ @Test public void testNoGroupAggregatePushdown() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, false);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -450,4 +452,64 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
+ @Test public void testNoHavingAggregate() throws Exception {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
+ caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
+ capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
+ FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
+
+ ProcessorPlan plan = TestOptimizer.helpPlan(
+ "select stringkey, max(intkey) from bqt1.smalla group by stringkey having count(intkey) = 1", //$NON-NLS-1$
+ metadata, null, capFinder,
+ new String[] {
+ "SELECT COUNT(g_0.intkey), g_0.stringkey, MAX(g_0.intkey) FROM bqt1.smalla AS g_0 GROUP BY g_0.stringkey"}, //$NON-NLS-1$
+ ComparisonMode.EXACT_COMMAND_STRING);
+
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 0, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
+ @Test public void testHavingCriteriaPushDown() {
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, false);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ ProcessorPlan plan = TestOptimizer.helpPlan("select X.e1 FROM vm1.g1 X group by X.e1 having X.e1 = 1 and sum(X.e2) = 2", FakeMetadataFactory.example1Cached(), null, capFinder, //$NON-NLS-1$
+ new String[]{"SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1 WHERE pm1.g1.e1 = '1'"}, true); //$NON-NLS-1$
+ TestOptimizer.checkNodeTypes(plan, new int[] {
+ 1, // Access
+ 0, // DependentAccess
+ 0, // DependentSelect
+ 0, // DependentProject
+ 0, // DupRemove
+ 1, // Grouping
+ 0, // NestedLoopJoinStrategy
+ 0, // MergeJoinStrategy
+ 0, // Null
+ 0, // PlanExecution
+ 1, // Project
+ 1, // Select
+ 0, // Sort
+ 0 // UnionAll
+ });
+ }
+
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAnsiJoinPushdown.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAnsiJoinPushdown.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestAnsiJoinPushdown.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,22 +22,23 @@
package com.metamatrix.query.optimizer;
-import junit.framework.TestCase;
+import org.junit.Test;
import com.metamatrix.query.optimizer.TestOptimizer.ComparisonMode;
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.ProcessorPlan;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
-public class TestAnsiJoinPushdown extends TestCase {
+public class TestAnsiJoinPushdown {
/**
* See {@link TestOptimizer.testPushMultiGroupCriteria}
*
* Notice that the non-join criteria is still in the on clause.
*/
- public void testAnsiInnerJoin() throws Exception {
+ @Test public void testAnsiInnerJoin() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_ANSI_JOIN, true);
@@ -45,10 +46,10 @@
ProcessorPlan plan = TestOptimizer.helpPlan(
"select pm2.g1.e1 from pm2.g1, pm2.g2 where pm2.g1.e1 = pm2.g2.e1 and (pm2.g1.e2 = 1 OR pm2.g2.e2 = 2) and pm2.g2.e3 = 1", //$NON-NLS-1$
- TestOptimizer.example1(),
+ FakeMetadataFactory.example1Cached(),
null,
capFinder,
- new String[] { "SELECT g_0.e1 FROM pm2.g1 AS g_0 INNER JOIN pm2.g2 AS g_1 ON g_0.e1 = g_1.e1 AND ((g_0.e2 = 1) OR (g_1.e2 = 2)) AND g_1.e3 = TRUE" }, //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1 FROM pm2.g1 AS g_0 INNER JOIN pm2.g2 AS g_1 ON g_0.e1 = g_1.e1 AND ((g_0.e2 = 1) OR (g_1.e2 = 2)) WHERE g_1.e3 = TRUE" }, //$NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING);
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
Added: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestComparableMetadataPushdown.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestComparableMetadataPushdown.java (rev 0)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestComparableMetadataPushdown.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -0,0 +1,78 @@
+/*
+ * 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.optimizer;
+
+import org.junit.Test;
+
+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.validator.TestValidator;
+
+public class TestComparableMetadataPushdown {
+
+ @Test public void testCantPushSort() throws Exception {
+ String sql = "select e3, e2 from test.group order by e3, e2"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ capFinder.addCapabilities("test", TestOptimizer.getTypicalCapabilities()); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, TestValidator.exampleMetadata(),
+ new String[] {"SELECT g_0.e3, g_0.e2 FROM test.\"group\" AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testCantPushGroupBy() throws Exception {
+ String sql = "select e3, e2 from test.group group by e3, e2"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
+ capFinder.addCapabilities("test", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, TestValidator.exampleMetadata(),
+ new String[] {"SELECT g_0.e3, g_0.e2 FROM test.\"group\" AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testCantPushDup() throws Exception {
+ String sql = "select distinct e3, e2 from test.group"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ capFinder.addCapabilities("test", TestOptimizer.getTypicalCapabilities()); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, TestValidator.exampleMetadata(),
+ new String[] {"SELECT g_0.e3, g_0.e2 FROM test.\"group\" AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testCantPushSetOp() throws Exception {
+ String sql = "select e3, e2 from test.group union select e0, e1 from test.group2"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_UNION, true);
+ capFinder.addCapabilities("test", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, TestValidator.exampleMetadata(),
+ new String[] {"SELECT test.\"group\".e3, test.\"group\".e2 FROM test.\"group\"", "SELECT test.group2.e0, test.group2.e1 FROM test.group2"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
Property changes on: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestComparableMetadataPushdown.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestDependentJoins.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestDependentJoins.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestDependentJoins.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -487,13 +487,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(10));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -530,10 +526,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -569,13 +562,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -614,13 +603,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -665,14 +650,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -711,14 +692,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -754,13 +731,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
caps.setFunctionSupport("||", true); //$NON-NLS-1$
@@ -803,13 +777,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
caps.setFunctionSupport("||", true); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestExpressionsInGroupBy.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestExpressionsInGroupBy.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestExpressionsInGroupBy.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -46,12 +46,10 @@
// Create capabilities
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_FUNCTIONS_IN_GROUP_BY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -72,12 +70,10 @@
// Create capabilities
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_FUNCTIONS_IN_GROUP_BY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -125,13 +121,10 @@
// Create capabilities
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
// Plan query
@@ -166,11 +159,9 @@
// Create capabilities
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -233,12 +224,9 @@
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_CASE, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan(sql,
@@ -278,12 +266,9 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_CASE, false);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -326,12 +311,9 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_CASE, false);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -371,12 +353,9 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_CASE, false);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -441,7 +420,7 @@
public void testDontPushGroupByUnsupportedFunction() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan(
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinOptimization.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,17 +22,19 @@
package com.metamatrix.query.optimizer;
+import static org.junit.Assert.*;
+
import java.util.ArrayList;
import java.util.List;
+import org.junit.Test;
import org.teiid.connector.api.SourceSystemFunctions;
-import junit.framework.TestCase;
-
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.api.exception.query.QueryParserException;
import com.metamatrix.api.exception.query.QueryResolverException;
+import com.metamatrix.query.optimizer.TestOptimizer.ComparisonMode;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
@@ -49,17 +51,12 @@
import com.metamatrix.query.unittest.FakeMetadataObject;
import com.metamatrix.query.unittest.FakeMetadataStore;
-
-public class TestJoinOptimization extends TestCase {
+public class TestJoinOptimization {
- public TestJoinOptimization(String name) {
- super(name);
- }
-
/**
* Single group criteria should get pushed and be eligible for copy criteria
*/
- public void testInnerJoinPushAndCopyNonJoinCriteria() {
+ @Test public void testInnerJoinPushAndCopyNonJoinCriteria() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla inner join bqt2.smalla on (bqt1.smalla.intkey = bqt2.smalla.intkey and bqt2.smalla.intkey = 1)"; //$NON-NLS-1$
// Plan query
@@ -86,7 +83,7 @@
/**
* Single group criteria should get pushed when it is on the inner side
*/
- public void testOuterJoinPushNonJoinCriteria() {
+ @Test public void testOuterJoinPushNonJoinCriteria() {
String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (bqt1.smalla.intkey = bqt2.smalla.intkey and bqt2.smalla.stringkey = 1)"; //$NON-NLS-1$
// Plan query
@@ -113,7 +110,7 @@
/**
* Single group criteria should not be pushed when it is on the outer side
*/
- public void testOuterJoinPushNonJoinCriteriaA() {
+ @Test public void testOuterJoinPushNonJoinCriteriaA() {
String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (bqt1.smalla.intkey = bqt2.smalla.intkey and bqt1.smalla.stringkey = 1)"; //$NON-NLS-1$
// Plan query
@@ -137,7 +134,7 @@
});
}
- public void testOuterJoinPushNonJoinCriteria_Case5547() {
+ @Test public void testOuterJoinPushNonJoinCriteria_Case5547() {
String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (1=1) option debug"; //$NON-NLS-1$
String BQT1 = "BQT1"; //$NON-NLS-1$
String BQT2 = "BQT2"; //$NON-NLS-1$
@@ -182,7 +179,7 @@
* Single group criteria should not be pushed when it is used in a full outer join
* Note that the join has also degraded into a cross join rather than an outer join
*/
- public void testFullOuterJoinPushNonJoinCriteria() {
+ @Test public void testFullOuterJoinPushNonJoinCriteria() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla full outer join bqt2.smalla on (bqt1.smalla.intkey = bqt2.smalla.intkey and bqt1.smalla.stringkey = 1 and bqt2.smalla.stringkey = 1)"; //$NON-NLS-1$
// Plan query
@@ -210,7 +207,7 @@
* Copy criteria should still work here even though the join criteria has an implicit type conversion because
* the equality operation on the select criteria can be used.
*/
- public void testCopyCriteriaWithFunction1() {
+ @Test public void testCopyCriteriaWithFunction1() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla, bqt2.smalla where bqt1.smalla.stringkey = bqt2.smalla.intkey and bqt2.smalla.intkey = 1"; //$NON-NLS-1$
// Plan query
@@ -237,7 +234,7 @@
/**
* Copy criteria should not work here as the join criteria has an implicit convert and the where criteria is a non-equality predicate
*/
- public void testCopyCriteriaWithFunction2() {
+ @Test public void testCopyCriteriaWithFunction2() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla, bqt2.smalla where bqt1.smalla.stringkey = bqt2.smalla.intkey and bqt2.smalla.intkey <> 1"; //$NON-NLS-1$
// Plan query
@@ -264,7 +261,7 @@
/**
* The intkey criteria should not be copied above to bqt1.smalla since the criteria is comming from the inner side in the join below
*/
- public void testInvalidCopyCriteria() {
+ @Test public void testInvalidCopyCriteria() {
String sql = "select bqt1.smalla.intkey from bqt1.smalla inner join (select bqt3.smalla.intkey from bqt2.smalla left outer join bqt3.smalla on bqt2.smalla.intkey = bqt3.smalla.intkey and bqt3.smalla.intkey = 1) foo on bqt1.smalla.intkey = foo.intkey"; //$NON-NLS-1$
// Plan query
@@ -291,11 +288,11 @@
/*
* Note that the criteria does not get copied to the outer side.
*/
- public void testCopyCriteriaFromInnerSide() {
+ @Test public void testCopyCriteriaFromInnerSide() throws Exception {
String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join (select bqt3.smalla.intkey from bqt3.smalla where bqt3.smalla.intkey = 1) foo on bqt1.smalla.intkey = foo.intkey"; //$NON-NLS-1$
// Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT bqt1.smalla.intkey FROM bqt1.smalla", "SELECT BQT3.SmallA.IntKey FROM bqt3.smalla WHERE bqt3.smalla.intkey = 1"}); //$NON-NLS-1$ //$NON-NLS-2$
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey FROM bqt3.smalla AS g_0 WHERE g_0.intkey = 1", "SELECT g_0.intkey FROM bqt1.smalla AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.checkNodeTypes(plan, new int[] {
2, // Access
@@ -318,7 +315,7 @@
/**
* Check to ensure that the full outer join does not get merged since the where criteria cannot be moved
*/
- public void testFullOuterJoinPreservation() {
+ @Test public void testFullOuterJoinPreservation() {
String sql = "select bqt2.mediumb.intkey from bqt2.mediumb full outer join (select bqt2.smallb.intkey from bqt2.smalla left outer join bqt2.smallb on bqt2.smalla.intkey = bqt2.smallb.intkey where bqt2.smalla.stringkey = 1) foo on bqt2.mediumb.intkey = foo.intkey"; //$NON-NLS-1$
// Plan query
@@ -346,11 +343,11 @@
/**
* Same as above but with a 0 group criteria
*/
- public void testFullOuterJoinPreservation1() {
+ @Test public void testFullOuterJoinPreservation1() {
String sql = "select bqt2.mediumb.intkey from bqt2.mediumb full outer join (select bqt2.smallb.intkey from bqt2.smalla inner join bqt2.smallb on bqt2.smalla.intkey = bqt2.smallb.intkey where ? = 1) foo on bqt2.mediumb.intkey = foo.intkey"; //$NON-NLS-1$
// Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey AS c_0 FROM bqt2.mediumb AS g_0 ORDER BY c_0", "SELECT g_1.intkey FROM bqt2.smalla AS g_0, bqt2.smallb AS g_1 WHERE (? = 1) AND (g_0.intkey = g_1.intkey)"}); //$NON-NLS-1$ //$NON-NLS-2$
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey AS c_0 FROM bqt2.mediumb AS g_0 ORDER BY c_0", "SELECT g_1.intkey FROM bqt2.smalla AS g_0, bqt2.smallb AS g_1 WHERE (g_0.intkey = g_1.intkey) AND (? = 1)"}); //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.checkNodeTypes(plan, new int[] {
2, // Access
@@ -373,11 +370,11 @@
/**
* Same as above but with a left outer join
*/
- public void testOuterJoinPreservation() {
+ @Test public void testOuterJoinPreservation() {
String sql = "select bqt2.mediumb.intkey from bqt2.mediumb left outer join (select bqt2.smallb.intkey from bqt2.smalla inner join bqt2.smallb on bqt2.smalla.intkey = bqt2.smallb.intkey where ? = 1) foo on bqt2.mediumb.intkey = foo.intkey"; //$NON-NLS-1$
// Plan query
- ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey AS c_0 FROM bqt2.mediumb AS g_0 ORDER BY c_0", "SELECT g_1.intkey FROM bqt2.smalla AS g_0, bqt2.smallb AS g_1 WHERE (? = 1) AND (g_0.intkey = g_1.intkey)"}); //$NON-NLS-1$ //$NON-NLS-2$
+ ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), new String[] {"SELECT g_0.intkey AS c_0 FROM bqt2.mediumb AS g_0 ORDER BY c_0", "SELECT g_1.intkey FROM bqt2.smalla AS g_0, bqt2.smallb AS g_1 WHERE (g_0.intkey = g_1.intkey) AND (? = 1)"}); //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.checkNodeTypes(plan, new int[] {
2, // Access
@@ -397,7 +394,7 @@
});
}
- public void testCopyCriteriaCreatesFalseCriteria() {
+ @Test public void testCopyCriteriaCreatesFalseCriteria() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla, bqt2.smalla where bqt1.smalla.stringkey = bqt2.smalla.intkey and bqt2.smalla.intkey = 1 and bqt1.smalla.stringkey = '2'"; //$NON-NLS-1$
// Plan query
@@ -406,7 +403,7 @@
TestOptimizer.checkNodeTypes(plan, TestRuleRaiseNull.FULLY_NULL);
}
- public void testPushNonJoinCriteriaWithFalse() {
+ @Test public void testPushNonJoinCriteriaWithFalse() {
String sql = "select bqt1.smalla.intkey, bqt2.smalla.intkey from bqt1.smalla left outer join bqt2.smalla on (bqt1.smalla.stringkey = bqt2.smalla.intkey and bqt2.smalla.intkey = null)"; //$NON-NLS-1$
// Plan query
@@ -430,20 +427,18 @@
});
}
- public void testPushMultiGroupJoinCriteria() {
+ @Test public void testPushMultiGroupJoinCriteria() throws Exception {
String sql = "select bqt1.smalla.intkey, bqt1.smallb.intkey from bqt1.smalla right outer join (bqt1.smallb cross join (bqt1.mediuma cross join bqt1.mediumb)) on bqt1.smalla.stringkey = bqt1.smallb.stringkey" //$NON-NLS-1$
+" where bqt1.smallb.intkey + bqt1.mediuma.intkey + bqt1.mediumb.intkey = 1"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
// Plan query
ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), null, capFinder,
- new String[] {"SELECT g_3.intkey, g_0.intkey FROM (bqt1.smallb AS g_0 INNER JOIN (bqt1.mediuma AS g_1 CROSS JOIN bqt1.mediumb AS g_2) ON ((g_0.intkey + g_1.intkey) + g_2.intkey) = 1) LEFT OUTER JOIN bqt1.smalla AS g_3 ON g_3.stringkey = g_0.stringkey"}, true); //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT g_3.intkey, g_0.intkey FROM ((bqt1.smallb AS g_0 CROSS JOIN bqt1.mediuma AS g_1) INNER JOIN bqt1.mediumb AS g_2 ON ((g_0.intkey + g_1.intkey) + g_2.intkey) = 1) LEFT OUTER JOIN bqt1.smalla AS g_3 ON g_3.stringkey = g_0.stringkey"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
@@ -451,20 +446,18 @@
/**
* Since the multigroup criteria spans the inner side, it should not be pushed.
*/
- public void testPushMultiGroupJoinCriteria1() {
+ @Test public void testPushMultiGroupJoinCriteria1() {
String sql = "select bqt1.smalla.intkey, bqt1.smallb.intkey from bqt1.smalla right outer join (bqt1.smallb cross join (bqt1.mediuma cross join bqt1.mediumb)) on bqt1.smalla.stringkey = bqt1.smallb.stringkey" //$NON-NLS-1$
+" where bqt1.smalla.intkey + bqt1.mediuma.intkey + bqt1.mediumb.intkey is null"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
// Plan query
ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), null, capFinder,
- new String[] {"SELECT g_3.intkey, g_0.intkey FROM (bqt1.smallb AS g_0 CROSS JOIN (bqt1.mediuma AS g_1 CROSS JOIN bqt1.mediumb AS g_2)) LEFT OUTER JOIN bqt1.smalla AS g_3 ON g_3.stringkey = g_0.stringkey WHERE ((g_3.intkey + g_1.intkey) + g_2.intkey) IS NULL"}, true); //$NON-NLS-1$
+ new String[] {"SELECT g_3.intkey, g_0.intkey FROM ((bqt1.smallb AS g_0 CROSS JOIN bqt1.mediuma AS g_1) CROSS JOIN bqt1.mediumb AS g_2) LEFT OUTER JOIN bqt1.smalla AS g_3 ON g_3.stringkey = g_0.stringkey WHERE ((g_3.intkey + g_1.intkey) + g_2.intkey) IS NULL"}, true); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
@@ -472,20 +465,18 @@
/**
* Since the multigroup criteria is not null dependent, it should get pushed.
*/
- public void testPushMultiGroupJoinCriteria2() {
+ @Test public void testPushMultiGroupJoinCriteria2() {
String sql = "select bqt1.smalla.intkey, bqt1.smallb.intkey from bqt1.smalla right outer join (bqt1.smallb cross join (bqt1.mediuma cross join bqt1.mediumb)) on bqt1.smalla.stringkey = bqt1.smallb.stringkey" //$NON-NLS-1$
+" where bqt1.smalla.intkey + bqt1.mediuma.intkey + bqt1.mediumb.intkey = 1"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
// Plan query
ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.exampleBQTCached(), null, capFinder,
- new String[] {"SELECT bqt1.smalla.intkey, bqt1.smallb.intkey FROM bqt1.mediuma, bqt1.smallb, bqt1.mediumb, bqt1.smalla WHERE (((bqt1.smalla.intkey + bqt1.mediuma.intkey) + bqt1.mediumb.intkey) = 1) AND (bqt1.smalla.stringkey = bqt1.smallb.stringkey)"}, true); //$NON-NLS-1$
+ new String[] {"SELECT g_3.intkey, g_2.intkey FROM bqt1.mediuma AS g_0, bqt1.mediumb AS g_1, bqt1.smallb AS g_2, bqt1.smalla AS g_3 WHERE (g_3.stringkey = g_2.stringkey) AND (((g_3.intkey + g_0.intkey) + g_1.intkey) = 1)"}, true); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
@@ -494,14 +485,13 @@
/**
* Having criteria should not be considered as regular criteria (unless it contains no aggregate expressions).
*/
- public void testHavingCriteriaNotUsedAsJoinCriteria() {
+ @Test public void testHavingCriteriaNotUsedAsJoinCriteria() {
String sql = "select bqt1.smalla.intkey, max(bqt1.smallb.intkey) from bqt1.smalla, bqt1.smallb where bqt1.smalla.intkey = bqt1.smallb.intnum group by bqt1.smallb.intkey, bqt1.smalla.intkey having max(bqt1.smallb.intkey) = bqt1.smalla.intkey"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_HAVING, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -515,12 +505,12 @@
/**
* Ensure that subqueries not initially pushable to the source still get replaced
*/
- public void testSubqueryReplacement() {
+ @Test public void testSubqueryReplacement() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -534,7 +524,7 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
- public void testRulePushNonJoinCriteriaPreservesOuterJoin() throws Exception {
+ @Test public void testRulePushNonJoinCriteriaPreservesOuterJoin() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select b.intkey from (select intkey from bqt1.smalla) a left outer join (select intkey from bqt1.smallb) b on (1 = 1)"; //$NON-NLS-1$
@@ -544,7 +534,7 @@
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
- public void testOuterToInnerJoinConversion() {
+ @Test public void testOuterToInnerJoinConversion() {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select bqt1.smalla.intkey from bqt1.smalla left outer join bqt1.smallb on (bqt1.smalla.intkey = bqt1.smallb.intkey) where bqt1.smallb.intnum = 1"; //$NON-NLS-1$
@@ -552,21 +542,21 @@
}
//same as above, but with a right outer join
- public void testOuterToInnerJoinConversion1() {
+ @Test public void testOuterToInnerJoinConversion1() {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select bqt1.smalla.intkey from bqt1.smalla right outer join bqt1.smallb on (bqt1.smalla.intkey = bqt1.smallb.intkey) where bqt1.smalla.intnum = 1"; //$NON-NLS-1$
TestOptimizer.helpPlan(sql, metadata, new String[]{"SELECT bqt1.smalla.intkey FROM bqt1.smallb, bqt1.smalla WHERE (bqt1.smalla.intkey = bqt1.smallb.intkey) AND (bqt1.smalla.intnum = 1)"}); //$NON-NLS-1$
}
- public void testOuterToInnerJoinConversion2() {
+ @Test public void testOuterToInnerJoinConversion2() {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select bqt1.smalla.intkey from bqt1.smalla full outer join bqt1.smallb on (bqt1.smalla.intkey = bqt1.smallb.intkey) where bqt1.smallb.intnum = 1"; //$NON-NLS-1$
TestOptimizer.helpPlan(sql, metadata, new String[]{"SELECT bqt1.smalla.intkey FROM bqt1.smallb LEFT OUTER JOIN bqt1.smalla ON bqt1.smalla.intkey = bqt1.smallb.intkey WHERE bqt1.smallb.intnum = 1"}); //$NON-NLS-1$
}
- public void testOuterToInnerJoinConversion3() {
+ @Test public void testOuterToInnerJoinConversion3() {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select bqt1.smalla.intkey from bqt1.smalla full outer join bqt1.smallb on (bqt1.smalla.intkey = bqt1.smallb.intkey) where bqt1.smalla.intnum = 1"; //$NON-NLS-1$
@@ -576,7 +566,7 @@
/**
* non-depenent criteria on each side of a full outer creates an inner join
*/
- public void testOuterToInnerJoinConversion4() {
+ @Test public void testOuterToInnerJoinConversion4() {
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
String sql = "select bqt1.smalla.intkey from bqt1.smalla full outer join bqt1.smallb on (bqt1.smalla.intkey = bqt1.smallb.intkey) where bqt1.smalla.intnum = bqt1.smallb.intnum"; //$NON-NLS-1$
@@ -586,10 +576,10 @@
/**
* Since concat2 is null dependent the join will not be changed
*/
- public void testOuterToInnerJoinConversionNullDependent() {
+ @Test public void testOuterToInnerJoinConversionNullDependent() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -602,10 +592,11 @@
TestOptimizer.helpPlan(sql, metadata, null, capFinder, new String[]{"SELECT bqt1.smallb.intnum, bqt1.smalla.intkey FROM bqt1.smalla LEFT OUTER JOIN bqt1.smallb ON bqt1.smalla.intkey = bqt1.smallb.intkey"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
}
- public void testInlineViewToHaving() {
+ @Test public void testInlineViewToHaving() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_HAVING, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -642,7 +633,7 @@
*
* This tests now passes with RulePlanJoins
*/
- public void testPathologicalAccessPatternCaseCase2976Defect19018() throws Exception{
+ @Test public void testPathologicalAccessPatternCaseCase2976Defect19018() throws Exception{
FakeMetadataFacade metadata = FakeMetadataFactory.example2();
// add single access pattern to pm1.g4 containing elements e1, e2, and e3
@@ -681,54 +672,25 @@
0 // UnionAll
});
}
-
- public void testHavingCriteriaPushDown() {
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- ProcessorPlan plan = TestOptimizer.helpPlan("select X.e1 FROM vm1.g1 X group by X.e1 having X.e1 = 1 and sum(X.e2) = 2", FakeMetadataFactory.example1Cached(), null, capFinder, //$NON-NLS-1$
- new String[]{"SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1 WHERE pm1.g1.e1 = '1'"}, true); //$NON-NLS-1$
- TestOptimizer.checkNodeTypes(plan, new int[] {
- 1, // Access
- 0, // DependentAccess
- 0, // DependentSelect
- 0, // DependentProject
- 0, // DupRemove
- 1, // Grouping
- 0, // NestedLoopJoinStrategy
- 0, // MergeJoinStrategy
- 0, // Null
- 0, // PlanExecution
- 1, // Project
- 1, // Select
- 0, // Sort
- 0 // UnionAll
- });
- }
/**
* non-null dependent criteria should get pushed down
*/
- public void testPushMultiGroupCriteriaOuterJoin() {
+ @Test public void testPushMultiGroupCriteriaOuterJoin() {
String sql = "select m.intkey, m.intnum, s.intkey, s.intnum from BQT2.mediuma m left outer join BQT2.smalla s on m.intkey = s.intkey where not (m.intkey + s.intnum = 26)"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, true); //TODO is this being enforced?!
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -775,60 +737,60 @@
assertEquals(dependent, JoinUtil.isNullDependent(FakeMetadataFactory.example1Cached(), innerGroups, expr));
}
- public void testNullDependentVisitor() throws Exception {
+ @Test public void testNullDependentVisitor() throws Exception {
helpTestNullDependentVisitor("nvl(pm1.g1.e1, 1) = 1", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor1() throws Exception {
+ @Test public void testNullDependentVisitor1() throws Exception {
helpTestNullDependentVisitor("ifnull(pm1.g1.e1, 1) = 1", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor2() throws Exception {
+ @Test public void testNullDependentVisitor2() throws Exception {
helpTestNullDependentVisitor("rand(pm1.g1.e2) = 1", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor3() throws Exception {
+ @Test public void testNullDependentVisitor3() throws Exception {
helpTestNullDependentVisitor("concat2(pm1.g1.e1, pm1.g1.e2) = '1'", false); //$NON-NLS-1$
}
- public void testNullDependentVisitor4() throws Exception {
+ @Test public void testNullDependentVisitor4() throws Exception {
helpTestNullDependentVisitor("nvl(pm1.g2.e1, 1) = 1", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor5() throws Exception {
+ @Test public void testNullDependentVisitor5() throws Exception {
helpTestNullDependentVisitor("pm1.g1.e1 is null", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor6() throws Exception {
+ @Test public void testNullDependentVisitor6() throws Exception {
helpTestNullDependentVisitor("pm1.g1.e1 is not null", false); //$NON-NLS-1$
}
- public void testNullDependentVisitor7() throws Exception {
+ @Test public void testNullDependentVisitor7() throws Exception {
helpTestNullDependentVisitor("pm1.g2.e1 is not null", true); //$NON-NLS-1$
}
//this is an important test, the or causes this criteria to be null dependent
- public void testNullDependentVisitor8() throws Exception {
+ @Test public void testNullDependentVisitor8() throws Exception {
helpTestNullDependentVisitor("pm1.g1.e1 = 1 or pm1.g2.e1 = 1", true); //$NON-NLS-1$
}
- public void testNullDependentVisitor9() throws Exception {
+ @Test public void testNullDependentVisitor9() throws Exception {
helpTestNullDependentVisitor("pm1.g1.e1 = 1 or pm1.g1.e2 = 2", false); //$NON-NLS-1$
}
- public void testNullDependentVisitor10() throws Exception {
+ @Test public void testNullDependentVisitor10() throws Exception {
helpTestNullDependentVisitor("pm1.g1.e1 in (1, pm1.g2.e1)", false); //$NON-NLS-1$
}
- public void testNullDependentVisitor11() throws Exception {
+ @Test public void testNullDependentVisitor11() throws Exception {
helpTestNullDependentVisitor("pm1.g2.e1 in (1, pm1.g1.e1)", true); //$NON-NLS-1$
}
- public void testIsNullDependent() throws Exception {
+ @Test public void testIsNullDependent() throws Exception {
helpTestNullDependent("pm1.g1.e2 + 1", false); //$NON-NLS-1$
}
- public void testIsNullDependent1() throws Exception {
+ @Test public void testIsNullDependent1() throws Exception {
helpTestNullDependent("pm1.g2.e2 + 1", true); //$NON-NLS-1$
}
@@ -836,17 +798,14 @@
* The criteria will still get pushed to appropriate location, and
* the other side of the join will be removed
*/
- public void testCriteriaPushedWithUnionJoin() throws Exception {
+ @Test public void testCriteriaPushedWithUnionJoin() throws Exception {
String sql = "select * from pm1.g1 union join pm1.g2 where g1.e1 = 1"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
@@ -877,20 +836,17 @@
/**
* union joins allow RuleRemoveVirtual to still take effect
*/
- public void testCriteriaPushedWithUnionJoin1() throws Exception {
+ @Test public void testCriteriaPushedWithUnionJoin1() throws Exception {
String sql = "select vm1.g1.e1 from vm1.g1 union join vm1.g2 where g2.e1 = 1"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -898,8 +854,8 @@
ProcessorPlan plan = TestOptimizer.helpPlan(sql, metadata,
null, capFinder,
new String[] {
- "SELECT g1__1.e1 FROM pm1.g1 AS g1__1, pm1.g2 WHERE (g1__1.e1 = '1') AND (pm1.g2.e1 = '1')" }, //$NON-NLS-1$
- TestOptimizer.SHOULD_SUCCEED);
+ "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = '1') AND (g_1.e1 = '1')" }, //$NON-NLS-1$
+ ComparisonMode.EXACT_COMMAND_STRING);
TestOptimizer.checkNodeTypes(plan, new int[] {
1, // Access
@@ -923,22 +879,19 @@
/**
* null-dependent expressions should prevent merging of virtual layers
*/
- public void testNullDependentPreventsMerge() throws Exception {
+ @Test public void testNullDependentPreventsMerge() throws Exception {
String sql = "select x from pm1.g1 left outer join (select nvl(e2, 1) x from pm1.g2) y on e2 = x"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- caps.setFunctionSupport(SourceSystemFunctions.IFNULL, true); //$NON-NLS-1$
+ caps.setFunctionSupport(SourceSystemFunctions.IFNULL, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -957,13 +910,13 @@
* RuleCopyCriteria will remove the first join criteria and the source doesn't support the * function. However we still
* want the join to be pushed since it originally contained proper criteria.
*/
- public void testCopyCriteriaJoinPushed() throws Exception {
- String sql = "select pm1.g1.e1 from pm1.g1, pm1.g2 where pm1.g1.e1 = pm1.g2.e1 and pm1.g1.e1 = 5 and pm1.g1.e2 * 5 = pm1.g2.e2";
+ @Test public void testCopyCriteriaJoinPushed() throws Exception {
+ String sql = "select pm1.g1.e1 from pm1.g1, pm1.g2 where pm1.g1.e1 = pm1.g2.e1 and pm1.g1.e1 = 5 and pm1.g1.e2 * 5 = pm1.g2.e2"; //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
ProcessorPlan plan = TestOptimizer.helpPlan(sql,metadata,
- new String[] { "SELECT g_0.e2, g_1.e2, g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e1 = '5') AND (g_1.e1 = '5')" }); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e2, g_1.e2, g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = '5') AND (g_1.e1 = '5')" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, new int[] {
1, // Access
Added: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinPushdownRestrictions.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinPushdownRestrictions.java (rev 0)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinPushdownRestrictions.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -0,0 +1,143 @@
+/*
+ * 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.optimizer;
+
+import org.junit.Test;
+import org.teiid.connector.api.ConnectorCapabilities.SupportedJoinCriteria;
+
+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.unittest.FakeMetadataFactory;
+
+public class TestJoinPushdownRestrictions {
+
+ @Test public void testThetaRestriction() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1 inner join pm1.g2 on (pm1.g1.e2 + pm1.g2.e2 = 5)"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.THETA);
+ caps.setFunctionSupport("+", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 FROM pm1.g2 AS g_0", "SELECT g_0.e2 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.ANY);
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2, g_1.e2 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e2 + g_1.e2) = 5"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testEquiRestriction() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1 inner join pm1.g2 on (pm1.g1.e2 < pm1.g2.e2)"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.EQUI);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 FROM pm1.g2 AS g_0", "SELECT g_0.e2 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.THETA);
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2, g_1.e2 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE g_0.e2 < g_1.e2"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testKeyRestriction() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1 inner join pm1.g2 on (pm1.g1.e2 = pm1.g2.e2)"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.KEY);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", "SELECT g_0.e2 AS c_0 FROM pm1.g2 AS g_0 ORDER BY c_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.EQUI);
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2, g_1.e2 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE g_0.e2 = g_1.e2"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testKeyPasses() throws Exception {
+ String sql = "select a.e1, b.e1 from pm4.g1 a, pm4.g2 b where a.e1 = b.e1 and a.e2 = b.e2"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.KEY);
+ capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example4(),
+ new String[] {"SELECT g_0.e1, g_1.e1 FROM pm4.g1 AS g_0, pm4.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e2 = g_1.e2)"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ }
+
+ @Test public void testCrossJoinWithRestriction() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1, pm1.g2"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.THETA);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 FROM pm1.g2 AS g_0", "SELECT g_0.e2 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testOuterRestriction() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1 inner join pm1.g2 on (pm1.g1.e2 + pm1.g2.e2 = 5)"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, false);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.ANY);
+ caps.setFunctionSupport("+", true); //$NON-NLS-1$
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 FROM pm1.g2 AS g_0", "SELECT g_0.e2 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testCriteriaRestrictionWithNonJoinCriteria() throws Exception {
+ String sql = "select pm1.g1.e2, pm1.g2.e2 from pm1.g1 left outer join pm1.g2 on (pm1.g1.e2 = pm1.g2.e2 and pm1.g2.e1 = 'hello')"; //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
+ caps.setSourceProperty(Capability.JOIN_CRITERIA_ALLOWED, SupportedJoinCriteria.THETA);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
+ new String[] {"SELECT g_0.e2 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0", "SELECT g_0.e2 AS c_0 FROM pm1.g2 AS g_0 WHERE g_0.e1 = 'hello' ORDER BY c_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
Property changes on: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestJoinPushdownRestrictions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestLimit.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestLimit.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestLimit.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -698,9 +698,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
// pm3 model supports order by
capFinder.addCapabilities("pm3", caps); //$NON-NLS-1$
@@ -850,11 +848,10 @@
String sql = "select a from (SELECT MAX(e2) as a FROM pm1.g1 GROUP BY e2 LIMIT 1) x where a = 0"; //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.ROW_LIMIT, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
+ caps.setCapabilitySupport(Capability.QUERY_GROUP_BY, true);
+ caps.setCapabilitySupport(Capability.QUERY_HAVING, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptimizer.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -130,36 +130,20 @@
public static BasicSourceCapabilities getTypicalCapabilities() {
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_BETWEEN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_OR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_BETWEEN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_OR, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, false);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
// set typical max set size
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
@@ -169,7 +153,7 @@
public static CapabilitiesFinder getGenericFinder(boolean supportsJoins) {
final BasicSourceCapabilities caps = getTypicalCapabilities();
if (!supportsJoins) {
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, false);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, false);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, false);
}
CapabilitiesFinder finder = new CapabilitiesFinder() {
@@ -492,8 +476,8 @@
public static void checkSubPlanCount(ProcessorPlan plan, int expectedCount) {
assertEquals("Checking plan count", expectedCount, plan.getChildPlans().size()); //$NON-NLS-1$
}
-
- public static FakeMetadataFacade example1() {
+
+ public static FakeMetadataFacade example1() {
// Create models
FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
FakeMetadataObject pm2 = FakeMetadataFactory.createPhysicalModel("pm2"); //$NON-NLS-1$
@@ -810,9 +794,9 @@
checkNodeTypes(plan, FULL_PUSHDOWN);
}
- public void testPhysicalVirtualJoinWithCriteria() {
+ public void testPhysicalVirtualJoinWithCriteria() throws Exception {
ProcessorPlan plan = helpPlan("SELECT vm1.g2.e1 from vm1.g2, pm1.g3 where vm1.g2.e1=pm1.g3.e1 and vm1.g2.e2 > 0", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
- new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g3 AS g_2 WHERE (g_0.e1 = g_2.e1) AND (g_0.e1 = g_1.e1) AND (g_0.e2 > 0)" } ); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g3 AS g_2 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = g_2.e1) AND (g_0.e2 > 0)" }, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -1840,7 +1824,7 @@
public void testPushSelfJoin1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -1861,7 +1845,7 @@
public void testPushSelfJoin2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -1897,7 +1881,7 @@
public void testPushOuterJoin1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -1917,8 +1901,7 @@
public void testPushOuterJoin2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Add join capability to pm1
@@ -1953,10 +1936,9 @@
public void testPushOuterJoin3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Add join capability to pm1
@@ -2091,9 +2073,7 @@
public void testPushHaving1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2225,9 +2205,7 @@
public void testPushAggregate4() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -2249,9 +2227,7 @@
public void testPushAggregate5() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, false);
@@ -2358,13 +2334,10 @@
public void testPushAggregate8() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
@@ -2388,11 +2361,11 @@
checkNodeTypes(plan, FULL_PUSHDOWN);
}
- public void testQueryManyJoin() {
+ public void testQueryManyJoin() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
ProcessorPlan plan = helpPlan("SELECT pm1.g1.e1 FROM pm1.g1 JOIN ((pm1.g2 JOIN pm1.g3 ON pm1.g2.e1=pm1.g3.e1) JOIN pm1.g4 ON pm1.g3.e1=pm1.g4.e1) ON pm1.g1.e1=pm1.g4.e1", //$NON-NLS-1$
metadata,
- new String[] { "SELECT pm1.g1.e1 FROM pm1.g1, pm1.g2, pm1.g3, pm1.g4 WHERE (pm1.g1.e1 = pm1.g4.e1) AND (pm1.g3.e1 = pm1.g4.e1) AND (pm1.g2.e1 = pm1.g3.e1)"} ); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g3 AS g_2, pm1.g4 AS g_3 WHERE (g_1.e1 = g_2.e1) AND (g_2.e1 = g_3.e1) AND (g_0.e1 = g_3.e1)"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -2407,10 +2380,7 @@
public void testPushFunctionInCriteria1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2430,10 +2400,7 @@
public void testPushFunctionInSelect1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2454,10 +2421,7 @@
public void testPushFunctionInSelect2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2478,10 +2442,7 @@
public void testPushFunctionInSelect3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, false); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2517,10 +2478,7 @@
public void testPushFunctionInSelect4() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2541,10 +2499,7 @@
public void testPushFunctionInSelect5() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2565,7 +2520,6 @@
public void testPushFunctionInSelect6_defect_10081() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("upper", true); //$NON-NLS-1$
caps.setFunctionSupport("lower", false); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2601,10 +2555,7 @@
public void testPushFunctionInSelectWithOrderBy1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
@@ -2627,10 +2578,7 @@
public void testPushFunctionInSelectWithOrderBy1a() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
@@ -2653,10 +2601,7 @@
public void testPushFunctionInSelectWithOrderBy2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport(SourceSystemFunctions.LCASE, true); //$NON-NLS-1$
@@ -2678,11 +2623,8 @@
public void testPushFunctionInJoin1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2703,11 +2645,8 @@
public void testPushFunctionInJoin2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2744,11 +2683,8 @@
public void testPushFunctionInJoin3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport(SourceSystemFunctions.UCASE, true); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -2785,11 +2721,8 @@
public void testUnionOverFunctions() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -2903,8 +2836,8 @@
public void testCrossJoinNoElementCriteriaOptimization4() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan("select Y.e1, Y.e2 FROM vm1.g1 X, vm1.g1 Y where {b'true'} in (select e3 FROM vm1.g1)", example1(), null, capFinder, //$NON-NLS-1$
@@ -2943,7 +2876,7 @@
public void testCopyCriteriaWithOuterJoin2_defect10050(){
ProcessorPlan plan = helpPlan("select pm2.g1.e1, pm2.g2.e1 from pm2.g1 left outer join pm2.g2 on pm2.g1.e1=pm2.g2.e1 and pm2.g1.e2=pm2.g2.e2 where pm2.g1.e1 = 'a' and pm2.g1.e2 = 1", example1(), //$NON-NLS-1$
- new String[] { "SELECT pm2.g1.e1, pm2.g2.e1 FROM pm2.g1 LEFT OUTER JOIN pm2.g2 ON pm2.g2.e2 = 1 AND pm2.g2.e1 = 'a' WHERE (pm2.g1.e1 = 'a') AND (pm2.g1.e2 = 1)" }); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1, g_1.e1 FROM pm2.g1 AS g_0 LEFT OUTER JOIN pm2.g2 AS g_1 ON g_0.e1 = g_1.e1 AND g_0.e2 = g_1.e2 AND g_1.e2 = 1 AND g_1.e1 = 'a' WHERE (g_0.e1 = 'a') AND (g_0.e2 = 1)" }); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -2954,7 +2887,7 @@
ProcessorPlan plan = helpPlan(
"select pm2.g1.e1, pm2.g2.e1, pm2.g3.e1 from ( (pm2.g1 right outer join pm2.g2 on pm2.g1.e1=pm2.g2.e1) right outer join pm2.g3 on pm2.g2.e1=pm2.g3.e1) where pm2.g3.e1 = 'a'", example1(), //$NON-NLS-1$
- new String[] { "SELECT pm2.g1.e1, pm2.g2.e1, pm2.g3.e1 FROM pm2.g3 LEFT OUTER JOIN (pm2.g2 LEFT OUTER JOIN pm2.g1 ON pm2.g1.e1 = 'a') ON pm2.g2.e1 = 'a' WHERE pm2.g3.e1 = 'a'" }); //$NON-NLS-1$
+ new String[] { "SELECT g_2.e1, g_1.e1, g_0.e1 FROM pm2.g3 AS g_0 LEFT OUTER JOIN (pm2.g2 AS g_1 LEFT OUTER JOIN pm2.g1 AS g_2 ON g_2.e1 = g_1.e1 AND g_2.e1 = 'a') ON g_1.e1 = g_0.e1 AND g_1.e1 = 'a' WHERE g_0.e1 = 'a'" }); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -2988,14 +2921,14 @@
public void testCleanCriteria2(){
ProcessorPlan plan = helpPlan("select pm2.g1.e1, pm2.g2.e1 from pm2.g1, pm2.g2 where pm2.g1.e1=pm2.g2.e1 and pm2.g1.e1 = 'a'", example1(), //$NON-NLS-1$
- new String[] { "SELECT pm2.g1.e1, pm2.g2.e1 FROM pm2.g1, pm2.g2 WHERE (pm2.g1.e1 = 'a') AND (pm2.g2.e1 = 'a')" }); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1, g_1.e1 FROM pm2.g1 AS g_0, pm2.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = 'a') AND (g_1.e1 = 'a')" }); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
public void testCleanCriteria3(){
ProcessorPlan plan = helpPlan("select pm2.g1.e1, pm2.g2.e1 from pm2.g1 inner join pm2.g2 on pm2.g1.e1=pm2.g2.e1 where pm2.g1.e1 = 'a'", example1(), //$NON-NLS-1$
- new String[] { "SELECT pm2.g1.e1, pm2.g2.e1 FROM pm2.g1, pm2.g2 WHERE (pm2.g1.e1 = 'a') AND (pm2.g2.e1 = 'a')" }); //$NON-NLS-1$
+ new String[] { "SELECT g_0.e1, g_1.e1 FROM pm2.g1 AS g_0, pm2.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = 'a') AND (g_1.e1 = 'a')" }); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -3003,7 +2936,7 @@
public void testPushSubqueryInWhereClause1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan("Select e1 from pm1.g1 where e1 in (select e1 FROM pm1.g2)", example1(), //$NON-NLS-1$
@@ -3015,7 +2948,7 @@
public void testPushSubqueryInWhereClause2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3032,10 +2965,8 @@
public void testPushSubqueryInWhereClause3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setFunctionSupport("ltrim", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -3052,10 +2983,8 @@
public void testPushSubqueryInWhereClause4() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setFunctionSupport("ltrim", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -3074,13 +3003,11 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
@@ -3099,14 +3026,11 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
@@ -3127,16 +3051,12 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
@@ -3157,10 +3077,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3197,10 +3114,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3239,10 +3153,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3276,15 +3187,11 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
@@ -3321,14 +3228,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
@@ -3366,12 +3269,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3413,12 +3313,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -3458,10 +3355,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -3502,8 +3396,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -3537,12 +3430,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -3599,11 +3489,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, false);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -3751,18 +3638,16 @@
});
}
- public void testDefect12298(){
+ public void testDefect12298() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
capFinder.addCapabilities("SystemPhysical", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan(
@@ -3771,9 +3656,9 @@
FakeMetadataFactory.exampleSystemPhysical(),
null, capFinder,
new String[] {
- "SELECT RT_VIRTUAL_DBS__1.VDB_NM, RT_GRPS__1.PATH_1, RT_ELMNTS__1.ELMNT_NM, RT_GRPS.PATH_1, RT_ELMNTS.ELMNT_NM, RT_KY_IDX_ELMNTS.POSITION, RT_KY_IDXES.KEY_NM, RT_KY_IDXES__1.KEY_NM FROM ((((SystemPhysical.RT_KY_IDXES AS RT_KY_IDXES__1 INNER JOIN ((SystemPhysical.RT_GRPS AS RT_GRPS__1 INNER JOIN ((SystemPhysical.RT_VIRTUAL_DBS AS RT_VIRTUAL_DBS__1 INNER JOIN SystemPhysical.RT_VDB_MDLS AS RT_VDB_MDLS__1 ON RT_VIRTUAL_DBS__1.VDB_UID = RT_VDB_MDLS__1.VDB_UID AND RT_VDB_MDLS__1.VISIBILITY = 0) INNER JOIN SystemPhysical.RT_MDLS AS RT_MDLS__1 ON RT_VDB_MDLS__1.MDL_UID = RT_MDLS__1.MDL_UID) ON RT_GRPS__1.MDL_UID = RT_MDLS__1.MDL_UID AND RT_GRPS__1.TABLE_TYPE <> 5) INNER JOIN SystemPhysical.RT_TABLE_TYPES AS RT_TABLE_TYPES__1 ON RT_GRPS__1.TABLE_TYPE = RT_TABLE_TYPES__1.TABLE_TYPE_CODE AND RT_TABLE_TYPES__1.TABLE_TYPE_CODE <> 5) ON RT_KY_IDXES__1.GRP_UID = RT_GRPS__1.GRP_UID) INNER JOIN SystemPhysical.RT_KEY_TYPES AS RT_KEY_TYPES__1 ON RT_KY_IDXES__1.KEY_!
TYPE = RT_KEY_TYPES__1.KEY_TYPE_CODE AND RT_KEY_TYPES__1.KEY_TYPE_NM = 'Primary') LEFT OUTER JOIN SystemPhysical.RT_KY_IDX_ELMNTS AS RT_KY_IDX_ELMNTS__1 ON RT_KY_IDX_ELMNTS__1.KEY_UID = RT_KY_IDXES__1.KEY_UID) INNER JOIN SystemPhysical.RT_ELMNTS AS RT_ELMNTS__1 ON RT_KY_IDX_ELMNTS__1.ELMNT_UID = RT_ELMNTS__1.ELMNT_UID) INNER JOIN ((((SystemPhysical.RT_KY_IDXES AS RT_KY_IDXES INNER JOIN ((SystemPhysical.RT_GRPS AS RT_GRPS INNER JOIN ((SystemPhysical.RT_VIRTUAL_DBS AS RT_VIRTUAL_DBS INNER JOIN SystemPhysical.RT_VDB_MDLS AS RT_VDB_MDLS ON RT_VIRTUAL_DBS.VDB_UID = RT_VDB_MDLS.VDB_UID AND RT_VDB_MDLS.VISIBILITY = 0) INNER JOIN SystemPhysical.RT_MDLS AS RT_MDLS ON RT_VDB_MDLS.MDL_UID = RT_MDLS.MDL_UID) ON RT_GRPS.MDL_UID = RT_MDLS.MDL_UID AND RT_GRPS.TABLE_TYPE <> 5 AND RT_GRPS.PATH_1 = 'PartsOracle.SUPPLIER_PARTS') INNER JOIN SystemPhysical.RT_TABLE_TYPES AS RT_TABLE_TYPES ON RT_GRPS.TABLE_TYPE = RT_TABLE_TYPES.TABLE_TYPE_CODE AND RT_TABLE_TYPES.TABLE_TYPE_CODE <> 5) ON RT_KY_ID!
XES.GRP_UID = RT_GRPS.GRP_UID) INNER JOIN SystemPhysical.RT_KEY_TYPES
AS RT_KEY_TYPES ON RT_KY_IDXES.KEY_TYPE = RT_KEY_TYPES.KEY_TYPE_CODE AND RT_KEY_TYPES.KEY_TYPE_NM = 'Foreign') LEFT OUTER JOIN SystemPhysical.RT_KY_IDX_ELMNTS AS RT_KY_IDX_ELMNTS ON RT_KY_IDX_ELMNTS.KEY_UID = RT_KY_IDXES.KEY_UID) INNER JOIN SystemPhysical.RT_ELMNTS AS RT_ELMNTS ON RT_KY_IDX_ELMNTS.ELMNT_UID = RT_ELMNTS.ELMNT_UID) ON RT_KY_IDXES__1.KEY_UID = RT_KY_IDXES.REF_KEY_UID AND RT_KY_IDX_ELMNTS__1.POSITION = RT_KY_IDX_ELMNTS.POSITION" //$NON-NLS-1$
+ "SELECT g_2.VDB_NM, g_1.PATH_1, g_8.ELMNT_NM, g_10.PATH_1, g_17.ELMNT_NM, g_16.POSITION, g_9.KEY_NM, g_0.KEY_NM FROM ((((SystemPhysical.RT_KY_IDXES AS g_0 INNER JOIN ((SystemPhysical.RT_GRPS AS g_1 INNER JOIN ((SystemPhysical.RT_VIRTUAL_DBS AS g_2 INNER JOIN SystemPhysical.RT_VDB_MDLS AS g_3 ON g_2.VDB_UID = g_3.VDB_UID) INNER JOIN SystemPhysical.RT_MDLS AS g_4 ON g_3.MDL_UID = g_4.MDL_UID) ON g_1.MDL_UID = g_4.MDL_UID) INNER JOIN SystemPhysical.RT_TABLE_TYPES AS g_5 ON g_1.TABLE_TYPE = g_5.TABLE_TYPE_CODE) ON g_0.GRP_UID = g_1.GRP_UID) INNER JOIN SystemPhysical.RT_KEY_TYPES AS g_6 ON g_0.KEY_TYPE = g_6.KEY_TYPE_CODE) LEFT OUTER JOIN SystemPhysical.RT_KY_IDX_ELMNTS AS g_7 ON g_7.KEY_UID = g_0.KEY_UID) INNER JOIN SystemPhysical.RT_ELMNTS AS g_8 ON g_7.ELMNT_UID = g_8.ELMNT_UID) INNER JOIN ((((SystemPhysical.RT_KY_IDXES AS g_9 INNER JOIN ((SystemPhysical.RT_GRPS AS g_10 INNER JOIN ((SystemPhysical.RT_VIRTUAL_DBS AS g_11 INNER JOIN SystemPhysical.RT!
_VDB_MDLS AS g_12 ON g_11.VDB_UID = g_12.VDB_UID) INNER JOIN SystemPhysical.RT_MDLS AS g_13 ON g_12.MDL_UID = g_13.MDL_UID) ON g_10.MDL_UID = g_13.MDL_UID) INNER JOIN SystemPhysical.RT_TABLE_TYPES AS g_14 ON g_10.TABLE_TYPE = g_14.TABLE_TYPE_CODE) ON g_9.GRP_UID = g_10.GRP_UID) INNER JOIN SystemPhysical.RT_KEY_TYPES AS g_15 ON g_9.KEY_TYPE = g_15.KEY_TYPE_CODE) LEFT OUTER JOIN SystemPhysical.RT_KY_IDX_ELMNTS AS g_16 ON g_16.KEY_UID = g_9.KEY_UID) INNER JOIN SystemPhysical.RT_ELMNTS AS g_17 ON g_16.ELMNT_UID = g_17.ELMNT_UID) ON g_0.KEY_UID = g_9.REF_KEY_UID AND g_7.POSITION = g_16.POSITION WHERE (g_1.TABLE_TYPE <> 5) AND (g_3.VISIBILITY = 0) AND (g_5.TABLE_TYPE_CODE <> 5) AND (g_6.KEY_TYPE_NM = 'Primary') AND (g_10.TABLE_TYPE <> 5) AND (g_10.PATH_1 = 'PartsOracle.SUPPLIER_PARTS') AND (g_12.VISIBILITY = 0) AND (g_14.TABLE_TYPE_CODE <> 5) AND (g_15.KEY_TYPE_NM = 'Foreign')" //$NON-NLS-1$
},
- SHOULD_SUCCEED);
+ ComparisonMode.EXACT_COMMAND_STRING);
checkNodeTypes(plan, new int[] {
1, // Access
0, // DependentAccess
@@ -3903,7 +3788,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, hasUnionCapability);
caps.setCapabilitySupport((Capability.QUERY_ORDERBY), hasUnionOrderByCapability);
caps.setCapabilitySupport((Capability.QUERY_SET_ORDER_BY), hasUnionOrderByCapability);
@@ -4001,7 +3886,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4031,7 +3916,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4061,7 +3946,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4091,7 +3976,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4108,7 +3993,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4141,7 +4026,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4158,7 +4043,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4190,10 +4075,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4209,11 +4093,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4229,7 +4112,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, true);
@@ -4250,10 +4133,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4284,10 +4166,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4303,10 +4184,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -4322,7 +4202,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
capFinder.addCapabilities("pm3", caps); //$NON-NLS-1$
@@ -4339,7 +4219,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4373,10 +4253,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan("SELECT * FROM (SELECT intkey, 5 FROM BQT1.SmallA UNION ALL SELECT intnum, 10 FROM bqt1.smalla) AS x", //$NON-NLS-1$
@@ -4391,9 +4271,7 @@
public void testPushCaseInSelect() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_CASE, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -4414,11 +4292,8 @@
public void testCantPushCaseInSelectWithFunction() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Add join capability to pm1
@@ -4452,9 +4327,7 @@
public void testPushSearchedCaseInSelect() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -4474,11 +4347,8 @@
public void testCantPushSearchedCaseInSelectWithFunction() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Add join capability to pm1
@@ -4514,11 +4384,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
caps.setFunctionSupport("xyz", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -4562,13 +4430,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4608,13 +4473,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4655,13 +4517,10 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4697,23 +4556,21 @@
});
}
- public void testCase2125() {
+ public void testCase2125() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_AVG, false);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -4726,8 +4583,8 @@
ProcessorPlan plan = helpPlan(sql,
FakeMetadataFactory.exampleBQTCached(),
null, capFinder,
- new String[] {"SELECT P.longnum, O.datevalue, OD.IntKEy, P.IntKEy, O.IntKey FROM bqt1.smalla AS OD, bqt1.smallb AS P, bqt1.mediuma AS O WHERE (O.IntKey = OD.IntKey) AND (OD.StringKey = P.StringKey) AND (OD.IntNum > (SELECT SUM(IntNum) FROM bqt1.smalla))"}, //$NON-NLS-1$
- SHOULD_SUCCEED );
+ new String[] {"SELECT g_1.longnum, g_2.datevalue, g_0.IntKEy, g_1.IntKEy, g_2.IntKey FROM bqt1.smalla AS g_0, bqt1.smallb AS g_1, bqt1.mediuma AS g_2 WHERE (g_0.StringKey = g_1.StringKey) AND (g_2.IntKey = g_0.IntKey) AND (g_0.IntNum > (SELECT SUM(g_3.IntNum) FROM bqt1.smalla AS g_3))"}, //$NON-NLS-1$
+ ComparisonMode.EXACT_COMMAND_STRING );
checkNodeTypes(plan, new int[] {
1, // Access
@@ -4754,8 +4611,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -4793,8 +4650,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -4832,8 +4689,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -4872,12 +4729,10 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan(sql,
@@ -4892,10 +4747,8 @@
public void testUpdateWithElement() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
String sql = "UPDATE BQT1.SmallA SET IntKey = IntKey + 1"; //$NON-NLS-1$
@@ -4912,12 +4765,10 @@
public void testCase2187() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -4941,7 +4792,7 @@
public void testBusObjQuestion1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -4988,7 +4839,7 @@
public void testBusObjQuestion2() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -5036,7 +4887,7 @@
public void testBusObjQuestion2Hint() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -5084,7 +4935,7 @@
public void testBusObjQuestion2HintVariation() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -5106,7 +4957,7 @@
ProcessorPlan plan = helpPlan(sql,
metadata,
null, capFinder,
- new String[] {"SELECT g_0.MONTH AS c_0, g_1.REGION AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0, db2model.GEOGRAPHY2 AS g_1 WHERE (g_0.MONTH IN (<dependent values>)) AND (g_0.CITY = g_1.CITY) AND (g_1.REGION IN ('BORDEAUX', 'POLINESIA')) GROUP BY g_0.MONTH, g_1.REGION ORDER BY c_0", //$NON-NLS-1$
+ new String[] {"SELECT g_0.MONTH AS c_0, g_1.REGION AS c_1, SUM(g_0.SALES) AS c_2 FROM db2model.SALES AS g_0, db2model.GEOGRAPHY2 AS g_1 WHERE (g_0.CITY = g_1.CITY) AND (g_1.REGION IN ('BORDEAUX', 'POLINESIA')) AND (g_0.MONTH IN (<dependent values>)) GROUP BY g_0.MONTH, g_1.REGION ORDER BY c_0", //$NON-NLS-1$
"SELECT g_0.MONTH AS c_0, g_0.YEAR AS c_1 FROM msModel.\"TIME\" AS g_0 WHERE g_0.YEAR = '1999' ORDER BY c_0"}, //$NON-NLS-1$
ComparisonMode.EXACT_COMMAND_STRING );
@@ -5131,7 +4982,7 @@
public void testBusObjQuestion3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -5182,8 +5033,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5203,10 +5054,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan(sql,
@@ -5270,7 +5119,6 @@
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5352,14 +5200,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, false);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5396,16 +5241,13 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5434,7 +5276,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589a ON MediumA.IntKey = SmallA_2589a.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.IntKey = BQT1.SmallB.IntKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10'"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5442,7 +5284,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10'"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5451,7 +5293,7 @@
"VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey " + //$NON-NLS-1$
"WHERE BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB INNER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB INNER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5460,7 +5302,7 @@
"(BQT1.MediumA LEFT OUTER JOIN VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey) " + //$NON-NLS-1$
"ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB INNER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB INNER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5469,7 +5311,7 @@
"(BQT1.MediumA LEFT OUTER JOIN VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey) " + //$NON-NLS-1$
"ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB LEFT OUTER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB LEFT OUTER JOIN (BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5478,7 +5320,7 @@
"(BQT1.MediumA INNER JOIN VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey) " + //$NON-NLS-1$
"ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB LEFT OUTER JOIN (BQT1.MediumA INNER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey";//$NON-NLS-1$";
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumB LEFT OUTER JOIN (BQT1.MediumA INNER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) ON BQT1.MediumB.IntKey = BQT1.MediumA.IntKey AND BQT1.SmallA.StringNum = '10'";//$NON-NLS-1$";
helpTestCase2589(sql, expected);
}
@@ -5507,7 +5349,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN VQT.SmallA_2589d " + //$NON-NLS-1$
"ON MediumA.IntKey = SmallA_2589d.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10' AND BQT1.SmallA.IntNum = 10) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10' AND BQT1.SmallA.IntNum = 10"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5530,7 +5372,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA INNER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589b ON MediumA.IntKey = SmallA_2589b.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA, BQT1.SmallA, BQT1.SmallB WHERE (BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) AND (BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) AND (BQT1.SmallA.StringNum = '10')"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA, BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) AND (BQT1.MediumA.IntKey = BQT1.SmallA.IntKey) AND (BQT1.SmallA.StringNum = '10')"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
@@ -5598,7 +5440,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589g ON MediumA.IntKey = SmallA_2589g.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10'"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5610,7 +5452,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589h ON MediumA.IntKey = SmallA_2589h.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10'"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5622,7 +5464,7 @@
String sql = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN " + //$NON-NLS-1$
"VQT.SmallA_2589i ON MediumA.IntKey = SmallA_2589i.IntKey"; //$NON-NLS-1$
- String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey AND BQT1.SmallA.StringNum = '10' AND BQT1.SmallB.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey"; //$NON-NLS-1$
+ String expected = "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.StringKey = BQT1.SmallB.StringKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10' AND BQT1.SmallB.StringNum = '10'"; //$NON-NLS-1$
helpTestCase2589(sql, expected);
}
@@ -5684,14 +5526,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, false);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5738,14 +5577,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, false);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5800,14 +5636,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5909,21 +5742,18 @@
String expected[] = new String[] {
"SELECT BQT2.SmallA.IntKey FROM BQT2.SmallA", //$NON-NLS-1$
- "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.IntKey = BQT1.SmallB.IntKey AND BQT1.SmallA.StringNum = '10') ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey" //$NON-NLS-1$
+ "SELECT BQT1.MediumA.IntKey FROM BQT1.MediumA LEFT OUTER JOIN (BQT1.SmallA INNER JOIN BQT1.SmallB ON BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) ON BQT1.MediumA.IntKey = BQT1.SmallA.IntKey AND BQT1.SmallA.StringNum = '10'" //$NON-NLS-1$
};
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5978,12 +5808,10 @@
public void testOrderByDuplicates() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -6008,18 +5836,15 @@
public void testCase2507() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("||", true); //$NON-NLS-1$
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6040,18 +5865,15 @@
public void testCase2507A() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6071,18 +5893,15 @@
public void testCase2507B() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6099,15 +5918,17 @@
checkNodeTypes(plan, FULL_PUSHDOWN);
}
- public void testPushCrossJoins() {
+ /**
+ * RulePlanJoins does not initially allow the cross join push.
+ * The subsequent RuleRaiseAccess does since we believe it was the intent of the user
+ */
+ public void testPushCrossJoins() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -6122,8 +5943,8 @@
ProcessorPlan plan = helpPlan(sql,
metadata,
null, capFinder,
- new String[] {"SELECT b1.intkey FROM (bqt1.SmallA AS a1 CROSS JOIN (bqt1.smalla AS a2 CROSS JOIN bqt1.mediuma AS b1)) LEFT OUTER JOIN bqt1.mediumb AS b2 ON b1.intkey = b2.intkey"}, //$NON-NLS-1$
- SHOULD_SUCCEED );
+ new String[] {"SELECT g_2.intkey FROM ((bqt1.SmallA AS g_0 CROSS JOIN bqt1.smalla AS g_1) CROSS JOIN bqt1.mediuma AS g_2) LEFT OUTER JOIN bqt1.mediumb AS g_3 ON g_2.intkey = g_3.intkey"}, //$NON-NLS-1$
+ ComparisonMode.EXACT_COMMAND_STRING );
checkNodeTypes(plan, FULL_PUSHDOWN);
}
@@ -6131,18 +5952,15 @@
public void testCase3023() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6163,9 +5981,8 @@
FakeMetadataFacade metadata = example1();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -6183,19 +6000,19 @@
* of a virtual table containing a join in it's transformation. All virtual
* models use the same physical model pm1.
*/
- public void testCase3778() {
+ public void testCase3778() throws Exception {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
BasicSourceCapabilities caps = getTypicalCapabilities();
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = helpPlan(
"select a.e1, b.e1 from vm2.g1 a, vm2.g1 b where a.e1 = b.e1 and a.e2 in (select e2 from vm1.g1)", //$NON-NLS-1$
- metadata, null, capFinder, new String[] {"SELECT g_1.e1, g_3.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g1 AS g_2, pm1.g2 AS g_3 WHERE (g_1.e1 = g_3.e1) AND (g_0.e2 = g_1.e2) AND (g_1.e2 IN (SELECT g_4.e2 FROM pm1.g1 AS g_4)) AND (g_2.e2 = g_3.e2)"}, true); //$NON-NLS-1$
+ metadata, null, capFinder, new String[] {"SELECT g_1.e1, g_3.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1, pm1.g1 AS g_2, pm1.g2 AS g_3 WHERE (g_2.e2 = g_3.e2) AND (g_0.e2 = g_1.e2) AND (g_1.e1 = g_3.e1) AND (g_1.e2 IN (SELECT g_4.e2 FROM pm1.g1 AS g_4))"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
@@ -6208,14 +6025,11 @@
public void testCase3832() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -6241,11 +6055,8 @@
public void testDefect21972() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -6264,13 +6075,11 @@
public void testExpressionSymbolPreservation() throws Exception {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -6355,7 +6164,6 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
String sql = "select convert(e2+1,string) from pm1.g1 union all select e1 from pm1.g2";//$NON-NLS-1$
@@ -6422,13 +6230,13 @@
* Test of RuleCopyCriteria. Criteria should NOT be copied across a join if the join has any other operator
* other than an equality operator, but if the single group criteria is equality, then we can copy into a join criteria
*/
- public void testCase4265() {
+ public void testCase4265() throws Exception {
String sql = "SELECT X.intkey, Y.intkey FROM BQT1.SmallA X, BQT1.SmallA Y WHERE X.IntKey <> Y.IntKey and Y.IntKey = 1"; //$NON-NLS-1$
ProcessorPlan plan = helpPlan(sql, FakeMetadataFactory.exampleBQTCached(),
new String[] {
- "SELECT X.intkey FROM BQT1.SmallA AS X WHERE X.IntKey <> 1", //$NON-NLS-1$
- "SELECT Y.intkey FROM BQT1.SmallA AS Y WHERE Y.IntKey = 1" }); //$NON-NLS-1$
+ "SELECT g_0.IntKey FROM BQT1.SmallA AS g_0 WHERE g_0.IntKey <> 1", //$NON-NLS-1$
+ "SELECT g_0.IntKey FROM BQT1.SmallA AS g_0 WHERE g_0.IntKey = 1" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
checkNodeTypes(plan, new int[] {
2, // Access
@@ -6453,13 +6261,12 @@
* Test of RuleCopyCriteria. Criteria should be copied across a join only for an equality operator in
* the join criteria.
*/
- public void testCase4265ControlTest() {
+ public void testCase4265ControlTest() throws Exception {
String sql = "SELECT X.intkey, Y.intkey FROM BQT1.SmallA X, BQT1.SmallA Y WHERE X.IntKey = Y.IntKey and Y.IntKey = 1"; //$NON-NLS-1$
ProcessorPlan plan = helpPlan(sql, FakeMetadataFactory.exampleBQTCached(),
new String[] {
- "SELECT X.intkey FROM BQT1.SmallA AS X WHERE X.IntKey = 1", //$NON-NLS-1$
- "SELECT Y.intkey FROM BQT1.SmallA AS Y WHERE Y.IntKey = 1" }); //$NON-NLS-1$
+ "SELECT g_0.intkey FROM BQT1.SmallA AS g_0 WHERE g_0.IntKey = 1" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
checkNodeTypes(plan, new int[] {
2, // Access
@@ -6543,8 +6350,8 @@
FakeMetadataFacade metadata = example1();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
+ caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
@@ -6564,7 +6371,6 @@
FakeMetadataFacade metadata = example1();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
@@ -6601,7 +6407,6 @@
FakeMetadataFacade metadata = example1();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
@@ -6613,7 +6418,7 @@
ProcessorPlan plan = helpPlan("select * from (select v1.e1, v2.e1 as e1_1, v1.e2, v2.e2 as e2_2 from (select * from vm1.g7 where vm1.g7.e2 = 1) v1 left outer join (select * from vm1.g7 where vm1.g7.e2 = 1) v2 on v1.e2 = v2.e2) as v3 where v3.e2 = 1", metadata, //$NON-NLS-1$
null, capFinder,
- new String[] { "SELECT CASE WHEN g_0.e1 = 'S' THEN 'Pay' WHEN g_0.e1 = 'P' THEN 'Rec' ELSE g_0.e1 END, CASE WHEN g_1.e1 = 'S' THEN 'Pay' WHEN g_1.e1 = 'P' THEN 'Rec' ELSE g_1.e1 END, g_0.e2, g_1.e2 FROM pm1.g1 AS g_0 LEFT OUTER JOIN pm1.g1 AS g_1 ON g_1.e2 = 1 WHERE g_0.e2 = 1" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
+ new String[] { "SELECT CASE WHEN g_0.e1 = 'S' THEN 'Pay' WHEN g_0.e1 = 'P' THEN 'Rec' ELSE g_0.e1 END, CASE WHEN g_1.e1 = 'S' THEN 'Pay' WHEN g_1.e1 = 'P' THEN 'Rec' ELSE g_1.e1 END, g_0.e2, g_1.e2 FROM pm1.g1 AS g_0 LEFT OUTER JOIN pm1.g1 AS g_1 ON g_0.e2 = g_1.e2 AND g_1.e2 = 1 WHERE g_0.e2 = 1" }, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
checkNodeTypes(plan, FULL_PUSHDOWN);
checkSubPlanCount(plan, 0);
@@ -6622,9 +6427,7 @@
public void testCase4312() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -6645,14 +6448,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6673,18 +6473,15 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
caps.setFunctionSupport("+", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6742,11 +6539,8 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6768,14 +6562,11 @@
public void testDefect23614() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -6812,8 +6603,7 @@
public void testSameConnector() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
@@ -6850,7 +6640,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -6902,7 +6692,7 @@
public void testCase5067() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6920,10 +6710,7 @@
public void testDontPushConvertObject() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6958,10 +6745,7 @@
public void testDontPushConvertClobToString() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("LOB", caps); //$NON-NLS-1$
@@ -7011,12 +6795,10 @@
public void testCorrelatedSubqueryOverJoin() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -7075,7 +6857,7 @@
caps.setCapabilitySupport(Capability.QUERY_CASE, true);
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -7159,8 +6941,8 @@
public void testCase6597() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
// Create query
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptionalJoins.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptionalJoins.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestOptionalJoins.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -24,6 +24,7 @@
import junit.framework.TestCase;
+import com.metamatrix.query.optimizer.TestOptimizer.ComparisonMode;
import com.metamatrix.query.processor.ProcessorPlan;
import com.metamatrix.query.unittest.FakeMetadataFactory;
@@ -277,9 +278,9 @@
TestOptimizer.checkSubPlanCount(plan, 0);
}
- public void testOptionalJoinWithIntersection() {
+ public void testOptionalJoinWithIntersection() throws Exception {
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT pm1.g3.e1 FROM pm1.g3 inner join (select pm1.g1.e2 as y from /* optional */ pm1.g1 inner join pm1.g2 on pm1.g1.e1 = pm1.g2.e1) AS x on pm1.g3.e2=x.y", FakeMetadataFactory.example1Cached(), //$NON-NLS-1$
- new String[] {"SELECT g_0.e1 FROM pm1.g3 AS g_0, pm1.g1 AS g_1, pm1.g2 AS g_2 WHERE (g_0.e2 = g_1.e2) AND (g_1.e1 = g_2.e1)"} ); //$NON-NLS-1$
+ new String[] {"SELECT g_0.e1 FROM pm1.g3 AS g_0, pm1.g1 AS g_1, pm1.g2 AS g_2 WHERE (g_1.e1 = g_2.e1) AND (g_0.e2 = g_1.e2)"}, ComparisonMode.EXACT_COMMAND_STRING ); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestPartitionedJoinPlanning.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestPartitionedJoinPlanning.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestPartitionedJoinPlanning.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -44,10 +44,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleMergeVirtual.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleMergeVirtual.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleMergeVirtual.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -155,9 +155,7 @@
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z where z.x = 1", //$NON-NLS-1$
@@ -174,9 +172,7 @@
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_SELECT_DISTINCT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT e1, max(e2) as x FROM pm1.g1 GROUP BY e1) AS z where z.x = 1", //$NON-NLS-1$
@@ -208,7 +204,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (select '1' as x, e2 from pm1.g1 union all select e1, 1 from pm1.g2) x", //$NON-NLS-1$
@@ -223,7 +219,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x FROM (select '1' as x, e2 from pm1.g1 union all select e1, 1 from pm1.g2) x", //$NON-NLS-1$
@@ -241,7 +237,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT distinct x || 'b' FROM (select '1' as x, e2 from pm1.g1 union all select e1, 1 from pm1.g2) x", //$NON-NLS-1$
@@ -271,7 +267,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("select * from (SELECT distinct x FROM (select '1' as x, e2 from pm1.g1 union all select e1, 1 from pm1.g2) x) y, pm1.g2", //$NON-NLS-1$
@@ -359,9 +355,8 @@
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT_STAR, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -384,10 +379,10 @@
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
RelationalPlan plan = (RelationalPlan)TestOptimizer.helpPlan(sql, FakeMetadataFactory.example1Cached(),
- new String[] {"SELECT g_0.e1 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] {"SELECT g_0.e1 FROM pm1.g1 AS g_0"}, capFinder, TestOptimizer.ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
SortNode node = (SortNode)plan.getRootNode();
- assertTrue("Alias was not accounted for in sort node", node.getElements().containsAll(node.getSortElements()));
+ assertTrue("Alias was not accounted for in sort node", node.getElements().containsAll(node.getSortElements())); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleRaiseNull.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleRaiseNull.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestRuleRaiseNull.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -146,7 +146,7 @@
public void testRaiseNullWithOuterJoin1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
String sql = "select smallb.intkey, smalla.intkey from bqt1.smalla left outer join bqt1.smallb on (1 = 2)"; //$NON-NLS-1$
@@ -272,7 +272,7 @@
public void testRaiseNullWithOuterJoinAndHaving() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
String sql = "select smallb.intkey, smalla.intkey from bqt1.smalla left outer join bqt1.smallb on (1 = 2) group by smalla.intkey, smallb.intkey having max(smallb.intkey) = 1"; //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestStoredProcedurePlanning.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestStoredProcedurePlanning.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestStoredProcedurePlanning.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -298,7 +298,7 @@
public void testStoredQuery22() {
ProcessorPlan plan = TestOptimizer.helpPlan("select e1 from (EXEC pm1.sq1()) as x where e1='a' union (select e1 from vm1.g2 where e1='b')", new TempMetadataAdapter(FakeMetadataFactory.example1Cached(), new TempMetadataStore()), //$NON-NLS-1$
- new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 = 'a'", "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e1 = 'b') AND (g_1.e1 = 'b')" }); //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "SELECT g_0.e1 FROM pm1.g1 AS g_0 WHERE g_0.e1 = 'a'", "SELECT g_0.e1 FROM pm1.g1 AS g_0, pm1.g2 AS g_1 WHERE (g_0.e1 = g_1.e1) AND (g_0.e1 = 'b') AND (g_1.e1 = 'b')" }); //$NON-NLS-1$ //$NON-NLS-2$
TestOptimizer.checkNodeTypes(plan, new int[] {
2, // Access
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestSubqueryPushdown.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestSubqueryPushdown.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestSubqueryPushdown.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -43,7 +43,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -83,7 +83,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -115,14 +115,11 @@
@Test public void testPushCorrelatedSubquery1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -139,24 +136,19 @@
@Test public void testPushCorrelatedSubquery2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport(SourceSystemFunctions.CONCAT, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -184,24 +176,19 @@
@Test public void testPushCorrelatedSubquery3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("||", true); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -230,9 +217,7 @@
public void DEFER_testPushSubqueryInSelectClause1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
@@ -395,7 +380,7 @@
@Test public void testNoPushSubqueryInWhereClause1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -427,7 +412,7 @@
@Test public void testNoPushSubqueryInWhereClause2() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", getTypicalCapabilities()); //$NON-NLS-1$
@@ -459,9 +444,8 @@
public void defer_testNoPushSubqueryInWhereClause3() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -493,9 +477,8 @@
@Test public void testNoPushSubqueryInWhereClause4() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -526,9 +509,8 @@
@Test public void testNoPushSubqueryInWhereClause5() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -559,9 +541,8 @@
@Test public void testNoPushSubqueryInWhereClause6() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -593,10 +574,8 @@
@Test public void testNoPushSubqueryInWhereClause7() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setFunctionSupport("ltrim", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -631,9 +610,8 @@
@Test public void testNoPushSubqueryInWhereClause8() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", new BasicSourceCapabilities()); //$NON-NLS-1$
@@ -664,9 +642,8 @@
@Test public void testNoPushSubqueryInWhereClause9() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -694,15 +671,12 @@
@Test public void testPushMultipleCorrelatedSubquery1() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_OR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_OR, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -725,12 +699,10 @@
FakeMetadataFacade metadata = example1();
BasicSourceCapabilities caps = getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", true); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestUnionPlanning.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestUnionPlanning.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/TestUnionPlanning.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -36,7 +36,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -68,7 +68,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -97,7 +97,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
BasicSourceCapabilities caps1 = TestOptimizer.getTypicalCapabilities();
@@ -128,7 +128,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
BasicSourceCapabilities caps1 = TestOptimizer.getTypicalCapabilities();
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/capabilities/TestBasicSourceCapabilities.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/capabilities/TestBasicSourceCapabilities.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/capabilities/TestBasicSourceCapabilities.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -38,13 +38,13 @@
BasicSourceCapabilities caps = new BasicSourceCapabilities();
// Check initial state
- assertEquals("Default value for capability should be false", false, caps.supportsCapability(Capability.QUERY_FROM_JOIN)); //$NON-NLS-1$
+ assertEquals("Default value for capability should be false", false, caps.supportsCapability(Capability.QUERY_FROM_JOIN_INNER)); //$NON-NLS-1$
// Change state
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
// Check current state
- assertEquals("Changed value for capability should be true", true, caps.supportsCapability(Capability.QUERY_FROM_JOIN)); //$NON-NLS-1$
+ assertEquals("Changed value for capability should be true", true, caps.supportsCapability(Capability.QUERY_FROM_JOIN_INNER)); //$NON-NLS-1$
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCapabilitiesUtil.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCapabilitiesUtil.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCapabilitiesUtil.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -28,17 +28,13 @@
import junit.framework.TestCase;
import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.MetaMatrixException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.DefaultCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
-import com.metamatrix.query.parser.QueryParser;
-import com.metamatrix.query.resolver.QueryResolver;
import com.metamatrix.query.sql.ReservedWords;
-import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.JoinType;
import com.metamatrix.query.sql.lang.SetQuery.Operation;
import com.metamatrix.query.sql.symbol.AggregateSymbol;
@@ -47,7 +43,6 @@
import com.metamatrix.query.sql.symbol.Expression;
import com.metamatrix.query.sql.symbol.ExpressionSymbol;
import com.metamatrix.query.sql.symbol.Function;
-import com.metamatrix.query.sql.symbol.ScalarSubquery;
import com.metamatrix.query.unittest.FakeMetadataFacade;
import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.unittest.FakeMetadataObject;
@@ -117,7 +112,7 @@
finder.addCapabilities("pm1", sourceCaps); //$NON-NLS-1$
// Test capabilities util
- boolean actual = CapabilitiesUtil.supportsOuterJoin(modelID, joinType, metadata, finder);
+ boolean actual = CapabilitiesUtil.supportsJoin(modelID, joinType, metadata, finder);
assertEquals("Got wrong answer for supports", expectedValue, actual); //$NON-NLS-1$
}
@@ -162,23 +157,7 @@
public void testSupportsAggregates1() throws Exception {
helpTestSupportsAggregates(true, true, null);
}
-
- // Test where capabilities don't support aggregates
- public void testSupportsAggregates2() throws Exception {
- helpTestSupportsAggregates(false, true, null);
- }
-
- // Test where no capabilities exist
- public void testSupportsAggregates3() throws Exception {
- // Set up metadata
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
- // Test capabilities util
- boolean actual = CapabilitiesUtil.supportsAggregates(null, modelID, metadata, new DefaultCapabilitiesFinder());
- assertEquals("Got wrong answer for supports", false, actual); //$NON-NLS-1$
- }
-
/**
* Supports functions in group by is misleading. It should actually
* be called supports expression in group by. Thus the example below
@@ -405,7 +384,6 @@
// Test where capabilities don't support scalar functions
public void testSupportsScalar1() throws Exception {
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.FUNCTION, false);
Function func = new Function("+", new Expression[] { new ElementSymbol("x"), new ElementSymbol("y") }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
helpTestSupportsScalar(caps, func, false);
@@ -414,7 +392,6 @@
// Test where capabilities doesn't support function
public void testSupportsScalar3() throws Exception {
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("now", false); //$NON-NLS-1$
Function func = new Function("NOW", new Expression[] { }); //$NON-NLS-1$
@@ -424,7 +401,6 @@
// Test where capabilities do support function
public void testSupportsScalar4() throws Exception {
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("now", true); //$NON-NLS-1$
Function func = new Function("NOW", new Expression[] { }); //$NON-NLS-1$
@@ -434,7 +410,6 @@
// Test where function is unknown
public void testSupportsScalar5() throws Exception {
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.FUNCTION, true);
Function func = new Function("sasquatch", new Expression[] { }); //$NON-NLS-1$
helpTestSupportsScalar(caps, func, false);
@@ -502,57 +477,6 @@
assertEquals("Got wrong answer for supports", false, actual); //$NON-NLS-1$
}
- public void helpTestSupportsScalarSubquery(boolean supportsScalarSubquery, ScalarSubquery subquery, FakeMetadataFacade metadata, boolean expectedValue) throws QueryMetadataException, MetaMatrixComponentException {
- // Set up metadata
- FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- // Set up capabilities
- FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
- sourceCaps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, supportsScalarSubquery);
- finder.addCapabilities("pm1", sourceCaps); //$NON-NLS-1$
-
- // Test capabilities util
- boolean actual = CapabilitiesUtil.supportsScalarSubquery(modelID, subquery, metadata, finder);
- assertEquals("Got wrong answer for supports", expectedValue, actual); //$NON-NLS-1$
- }
-
- private ScalarSubquery exampleSubquery1(FakeMetadataFacade metadata) {
- try {
- QueryParser parser = new QueryParser();
- Command command = parser.parseCommand("SELECT e1 FROM pm1.g1"); //$NON-NLS-1$
- QueryResolver.resolveCommand(command, metadata);
- ScalarSubquery ss = new ScalarSubquery(command);
- return ss;
- } catch(MetaMatrixException e) {
- e.printStackTrace();
- fail(e.getMessage());
- return null;
- }
- }
-
- public void testSupportsScalarSubquery1() throws Exception {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- ScalarSubquery ss = exampleSubquery1(metadata);
- helpTestSupportsScalarSubquery(false, ss, metadata, false);
- }
-
- public void testSupportsScalarSubquery2() throws Exception {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- ScalarSubquery ss = exampleSubquery1(metadata);
- helpTestSupportsScalarSubquery(true, ss, metadata, true);
- }
-
- public void testSupportsScalarSubquery3() throws Exception {
- // Set up metadata
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- // Test capabilities util
- boolean actual = CapabilitiesUtil.supportsScalarSubquery(modelID, exampleSubquery1(metadata), metadata, new DefaultCapabilitiesFinder());
- assertEquals("Got wrong answer for supports", false, actual); //$NON-NLS-1$
- }
-
public void helpTestSupportsUnion(boolean supports) throws QueryMetadataException, MetaMatrixComponentException {
// Set up metadata
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
@@ -585,7 +509,7 @@
// Set up capabilities
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
BasicSourceCapabilities sourceCaps = new BasicSourceCapabilities();
- sourceCaps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, supports);
+ sourceCaps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, supports);
finder.addCapabilities("pm1", sourceCaps); //$NON-NLS-1$
// Test capabilities util
Modified: trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCriteriaCapabilityValidatorVisitor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCriteriaCapabilityValidatorVisitor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/optimizer/relational/rules/TestCriteriaCapabilityValidatorVisitor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,208 +22,167 @@
package com.metamatrix.query.optimizer.relational.rules;
-import junit.framework.TestCase;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
import com.metamatrix.api.exception.MetaMatrixException;
+import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities.Capability;
import com.metamatrix.query.parser.QueryParser;
import com.metamatrix.query.resolver.QueryResolver;
+import com.metamatrix.query.sql.lang.Command;
import com.metamatrix.query.sql.lang.Criteria;
-import com.metamatrix.query.sql.lang.Query;
-import com.metamatrix.query.sql.navigator.PreOrderNavigator;
import com.metamatrix.query.unittest.FakeMetadataFacade;
import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.unittest.FakeMetadataObject;
/**
*/
-public class TestCriteriaCapabilityValidatorVisitor extends TestCase {
+public class TestCriteriaCapabilityValidatorVisitor {
- /**
- * Constructor for TestCriteriaCapabilityValidatorVisitor.
- * @param name
- */
- public TestCriteriaCapabilityValidatorVisitor(String name) {
- super(name);
- }
-
-
public void helpTestVisitor(String sql, Object modelID, FakeMetadataFacade metadata, CapabilitiesFinder capFinder, boolean isValid, boolean expectException) {
try {
Criteria criteria = QueryParser.getQueryParser().parseCriteria(sql);
QueryResolver.resolveCriteria(criteria, metadata);
- CriteriaCapabilityValidatorVisitor visitor = new CriteriaCapabilityValidatorVisitor(modelID, metadata, capFinder);
- PreOrderNavigator.doVisit(criteria, visitor);
-
- assertEquals("Got incorrect isValid flag", isValid, visitor.isValid()); //$NON-NLS-1$
- assertEquals("Got incorrect exception", expectException, visitor.getException() != null); //$NON-NLS-1$
-
+ assertEquals("Got incorrect isValid flag", isValid, CriteriaCapabilityValidatorVisitor.canPushLanguageObject(criteria, modelID, metadata, capFinder)); //$NON-NLS-1$
+ } catch(QueryMetadataException e) {
+ if (!expectException) {
+ throw new RuntimeException(e);
+ }
} catch(MetaMatrixException e) {
- fail(e.getMessage());
+ throw new RuntimeException(e);
}
}
// Assume there is a wrapped command - this will allow subqueries to be properly resolved
public void helpTestVisitorWithCommand(String sql, Object modelID, FakeMetadataFacade metadata, CapabilitiesFinder capFinder, boolean isValid, boolean expectException) {
try {
- QueryParser parser = new QueryParser();
- Query query = (Query) parser.parseCommand(sql);
+ Command command = QueryParser.getQueryParser().parseCommand(sql);
- QueryResolver.resolveCommand(query, metadata);
+ QueryResolver.resolveCommand(command, metadata);
- CriteriaCapabilityValidatorVisitor visitor = new CriteriaCapabilityValidatorVisitor(modelID, metadata, capFinder);
- PreOrderNavigator.doVisit(query.getCriteria(), visitor);
-
- assertEquals("Got incorrect isValid flag", isValid, visitor.isValid()); //$NON-NLS-1$
- assertEquals("Got incorrect exception", expectException, visitor.getException() != null); //$NON-NLS-1$
-
+ assertEquals("Got incorrect isValid flag", isValid, CriteriaCapabilityValidatorVisitor.canPushLanguageObject(command, modelID, metadata, capFinder)); //$NON-NLS-1$
+ } catch(QueryMetadataException e) {
+ if (!expectException) {
+ throw new RuntimeException(e);
+ }
} catch(MetaMatrixException e) {
- fail(e.getMessage());
+ throw new RuntimeException(e);
}
}
// has all capabilities
- public void testCompareCriteriaSuccess() {
+ @Test public void testCompareCriteriaSuccess() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
// does not have where capability
- public void testCompareCriteriaCapFail1() {
+ @Test public void testCompareCriteriaCapFail1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- // does not have compare capability
- public void testCompareCriteriaCapFail2() {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
- }
-
// does not have = capability
- public void testCompareCriteriaOpCapFail1() {
+ @Test public void testCompareCriteriaOpCapFail1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have <> capability
- public void testCompareCriteriaOpCapFail2() {
+ @Test public void testCompareCriteriaOpCapFail2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 <> 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have < capability
- public void testCompareCriteriaOpCapFail3() {
+ @Test public void testCompareCriteriaOpCapFail3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 < 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have <= capability
- public void testCompareCriteriaOpCapFail4() {
+ @Test public void testCompareCriteriaOpCapFail4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 <= 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have > capability
- public void testCompareCriteriaOpCapFail5() {
+ @Test public void testCompareCriteriaOpCapFail5() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 > 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have >= capability
- public void testCompareCriteriaOpCapFail6() {
+ @Test public void testCompareCriteriaOpCapFail6() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 >= 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// element not searchable
- public void testCompareCriteriaSearchableFail() {
+ @Test public void testCompareCriteriaSearchableFail() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
@@ -231,16 +190,14 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// no caps
- public void testCompareCriteriaNoCaps() {
+ @Test public void testCompareCriteriaNoCaps() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
@@ -249,76 +206,54 @@
helpTestVisitor("pm1.g1.e1 = 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testCompoundCriteriaAnd1() {
+ @Test public void testCompoundCriteriaAnd1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x' AND 0 = 1", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testCompoundCriteriaAnd2() {
+ @Test public void testCompoundCriteriaAnd4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, false);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 = 'x' AND 0 = 1", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
- }
-
- public void testCompoundCriteriaAnd4() {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
-
helpTestVisitor("pm1.g1.e1 = 'x' AND 0 = 1", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testCompoundCriteriaOr1() {
+ @Test public void testCompoundCriteriaOr1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_OR, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_OR, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x' OR 0 = 1", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testCompoundCriteriaOr2() {
+ @Test public void testCompoundCriteriaOr2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_OR, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_OR, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 = 'x' OR 0 = 1", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testCompoundCriteriaOr4() {
+ @Test public void testCompoundCriteriaOr4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
@@ -327,16 +262,13 @@
helpTestVisitor("pm1.g1.e1 = 'x' OR 0 = 1", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testScalarFunction1() {
+ @Test public void testScalarFunction1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("curtime", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -347,16 +279,13 @@
* Since this will always get pre-evaluated, this should also be true
*
*/
- public void testScalarFunction2() {
+ @Test public void testScalarFunction2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("+", false); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -366,16 +295,13 @@
/**
* since curtime is command deterministic and not supported, it will be evaluated
*/
- public void testScalarFunction2a() {
+ @Test public void testScalarFunction2a() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("curtime", false); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -385,16 +311,13 @@
/**
* since rand is non-deterministic and not supported, it will be evaluated for every row
*/
- public void testScalarFunction2b() {
+ @Test public void testScalarFunction2b() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("rand", false); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -402,33 +325,31 @@
}
- public void testIsNull1() {
+ @Test public void testIsNull1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testIsNull2() {
+ @Test public void testIsNull2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testIsNull3() {
+ @Test public void testIsNull3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
@@ -437,7 +358,10 @@
helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testIsNull4() {
+ /**
+ * Is null is not a comparison operation
+ */
+ @Test public void testIsNull4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
@@ -445,116 +369,119 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
+ helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testIsNull5() {
+ @Test public void testIsNull6() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 IS NULL", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
+ helpTestVisitor("pm1.g1.e1 IS NOT NULL", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
-
- public void testIsNull6() {
+
+ @Test public void testIsNull6fails() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_ISNULL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_ISNULL, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 IS NOT NULL", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
+ helpTestVisitor("pm1.g1.e1 IS NOT NULL", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// has all capabilities
- public void testMatchCriteriaSuccess() {
+ @Test public void testMatchCriteriaSuccess() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 LIKE 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- // does not have escape char capability
- public void testMatchCriteriaSuccess2() {
+ @Test public void testMatchCriteriaSuccess2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 LIKE 'x' ESCAPE '#'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
// Test for NOT LIKE
- public void testMatchCriteriaSuccess3() {
+ @Test public void testMatchCriteriaSuccess3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 NOT LIKE 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
+
+ @Test public void testMatchCriteriaSuccess3fails() {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+ Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ helpTestVisitor("pm1.g1.e1 NOT LIKE 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
+ }
// does not have compare capability
- public void testMatchCriteriaCapFail1() {
+ @Test public void testMatchCriteriaCapFail1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 LIKE 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have escape char capability
- public void testMatchCriteriaCapFail2() {
+ @Test public void testMatchCriteriaCapFail2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 LIKE 'x' ESCAPE '#'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// element not searchable
- public void testMatchCriteriaMatchableFail() {
+ @Test public void testMatchCriteriaMatchableFail() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
@@ -562,16 +489,15 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_LIKE_ESCAPE, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 LIKE 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// no caps
- public void testMatchCriteriaNoCaps() {
+ @Test public void testMatchCriteriaNoCaps() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
@@ -580,77 +506,57 @@
helpTestVisitor("pm1.g1.e1 LIKE 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testMatchCriteriaNoCrit() {
+ @Test public void testNotCriteria1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_LIKE_ESCAPE, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
- helpTestVisitor("pm1.g1.e1 LIKE 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
- }
-
- public void testNotCriteria1() {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("NOT pm1.g1.e1 = 'x'", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testNotCriteria2() {
+ @Test public void testNotCriteria2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("NOT pm1.g1.e1 = 'x'", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testSetCriteria1() {
+ @Test public void testSetCriteria1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testSetCriteria2() {
+ @Test public void testSetCriteria2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testSetCriteria3() {
+ @Test public void testSetCriteria3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
@@ -659,7 +565,7 @@
helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testSetCriteria5() {
+ @Test public void testSetCriteria5() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
FakeMetadataObject modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeMetadataObject elementID = metadata.getStore().findObject("pm1.g1.e1" , FakeMetadataObject.ELEMENT); //$NON-NLS-1$
@@ -667,296 +573,269 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testSetCriteria6() {
+ //Test for success NOT IN
+ @Test public void testSetCriteria7() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 IN ('x')", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
+ helpTestVisitor("pm1.g1.e1 NOT IN ('x')", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- //Test for success NOT IN
- public void testSetCriteria7() {
+ @Test public void testSetCriteria7fails() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitor("pm1.g1.e1 NOT IN ('x')", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
+ helpTestVisitor("pm1.g1.e1 NOT IN ('x')", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testSetCriteria8() {
+ @Test public void testSetCriteria8() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(2));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN ('x', 'y', 'z')", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testSetCriteria9() {
+ @Test public void testSetCriteria9() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(2));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN ('x', 'y')", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testSubquerySetCriteria() {
+ @Test public void testSubquerySetCriteria() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitor("pm1.g1.e1 IN (SELECT 'xyz' FROM pm1.g1)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
+ @Test public void testSearchCase() {
+ FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
+ Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
+
+ FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
+ BasicSourceCapabilities caps = new BasicSourceCapabilities();
+ caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
+
+ helpTestVisitor("pm1.g1.e1 = case when pm1.g1.e2 = 1 then 1 else 2 end", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
+ }
// has all capabilities
- public void testSubqueryCompareCriteriaSuccess() {
+ @Test public void testSubqueryCompareCriteriaSuccess() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
// does not have where capability
- public void testSubqueryCompareCriteriaCapFail1() {
+ @Test public void testSubqueryCompareCriteriaCapFail1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have compare capability
- public void testSubqueryCompareCriteriaCapFail2() {
+ @Test public void testSubqueryCompareCriteriaCapFail2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have subquery capability
- public void testSubqueryCompareCriteriaFail3() {
+ @Test public void testSubqueryCompareCriteriaFail3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have quantified subquery comparison capability
- public void testSubqueryCompareCriteriaFail4() {
+ @Test public void testSubqueryCompareCriteriaFail4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have quantified subquery comparison capability for ANY
- public void testSubqueryCompareCriteriaFail5() {
+ @Test public void testSubqueryCompareCriteriaFail5() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have quantified subquery comparison capability for ALL
- public void testSubqueryCompareCriteriaFail6() {
+ @Test public void testSubqueryCompareCriteriaFail6() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_SOME, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_SOME, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ALL (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have = capability
- public void testSubqueryCompareCriteriaOpCapFail1() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have <> capability
- public void testSubqueryCompareCriteriaOpCapFail2() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 <> ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have < capability
- public void testSubqueryCompareCriteriaOpCapFail3() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail3() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 < ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have <= capability
- public void testSubqueryCompareCriteriaOpCapFail4() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail4() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 <= ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have > capability
- public void testSubqueryCompareCriteriaOpCapFail5() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail5() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 > ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// does not have >= capability
- public void testSubqueryCompareCriteriaOpCapFail6() {
+ @Test public void testSubqueryCompareCriteriaOpCapFail6() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 >= ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
// element not searchable
- public void testSubqueryCompareCriteriaSearchableFail() {
+ @Test public void testSubqueryCompareCriteriaSearchableFail() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
@@ -964,63 +843,45 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE pm1.g1.e1 = ANY (SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testExistsCriteria1() {
+ @Test public void testExistsCriteria1() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE EXISTS(SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
- public void testExistsCriteria2() {
+ @Test public void testExistsCriteria2() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE EXISTS(SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
}
- public void testExistsCriteria4() {
+ @Test public void testExistsCriteria5() {
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_EXISTS, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE EXISTS(SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, false, false); //$NON-NLS-1$
- }
-
- public void testExistsCriteria5() {
- FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
- Object modelID = metadata.getStore().findObject("pm1", FakeMetadataObject.MODEL); //$NON-NLS-1$
-
- FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
- BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_EXISTS, true);
- capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
-
helpTestVisitorWithCommand("SELECT e1 FROM pm1.g1 WHERE EXISTS(SELECT e1 FROM pm1.g2)", modelID, metadata, capFinder, true, false); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestDependentJoins.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestDependentJoins.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestDependentJoins.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -422,16 +422,13 @@
BasicSourceCapabilities depcaps = new BasicSourceCapabilities();
depcaps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
depcaps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ depcaps.setCapabilitySupport(Capability.CRITERIA_IN, true);
if(accessNodeHandlesAliases) {
depcaps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
}
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm4", depcaps); //$NON-NLS-1$
@@ -597,14 +594,12 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities depcaps = new BasicSourceCapabilities();
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ depcaps.setCapabilitySupport(Capability.CRITERIA_IN, true);
depcaps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
depcaps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm6", depcaps); //$NON-NLS-1$
@@ -634,14 +629,11 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities depcaps = new BasicSourceCapabilities();
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ depcaps.setCapabilitySupport(Capability.CRITERIA_IN, true);
depcaps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", depcaps); //$NON-NLS-1$
@@ -692,13 +684,10 @@
BasicSourceCapabilities depcaps = new BasicSourceCapabilities();
depcaps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
depcaps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- depcaps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
+ depcaps.setCapabilitySupport(Capability.CRITERIA_IN, true);
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
capFinder.addCapabilities("pm4", depcaps); //$NON-NLS-1$
@@ -766,8 +755,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestProcessor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -2567,15 +2567,11 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_LT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_COMPARISON, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_QUANTIFIED_ALL, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_QUANTIFIED_ALL, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
@@ -2623,11 +2619,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
@@ -2663,11 +2657,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
@@ -4643,7 +4635,6 @@
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, false);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, false);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
// Parse query
@@ -4888,7 +4879,7 @@
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, pushDown);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, pushDown);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, pushDown);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(2));
caps.setFunctionSupport("+", pushDown); //$NON-NLS-1$
@@ -5312,8 +5303,7 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
@@ -5342,11 +5332,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_AND, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_NE, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, false);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Command command = helpParse("SELECT e5, e2, e3, e4 FROM vm1.g1c WHERE e5 >= {ts'2004-08-01 00:00:00.0'}"); //$NON-NLS-1$
@@ -5393,10 +5380,8 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
caps.setFunctionSupport("||", true); //$NON-NLS-1$
caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
@@ -5439,10 +5424,8 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1));
caps.setFunctionSupport("||", true); //$NON-NLS-1$
caps.setFunctionSupport("rtrim", true); //$NON-NLS-1$
@@ -5516,8 +5499,8 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_COUNT, true);
@@ -5554,12 +5537,10 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
caps.setCapabilitySupport(Capability.QUERY_SET_ORDER_BY, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5588,10 +5569,7 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
@@ -5629,10 +5607,7 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
@@ -5661,11 +5636,9 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5676,7 +5649,7 @@
Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
assertEquals("Expected one query to get pushed down", 1, atomicQueries.size()); //$NON-NLS-1$
String atomicSql = atomicQueries.iterator().next().toString();
- String expectedSql = "SELECT BQT1.SmallA.IntKey, BQT1.SmallB.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
+ String expectedSql = "SELECT BQT1.SmallA.IntKey, BQT1.SmallB.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
assertEquals(expectedSql, atomicSql);
List[] expected = new List[] {
@@ -5695,9 +5668,8 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, false);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5742,11 +5714,9 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, false);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -5758,7 +5728,7 @@
Set atomicQueries = TestOptimizer.getAtomicQueries(plan);
assertEquals("Expected 2 queries to get pushed down", 2, atomicQueries.size()); //$NON-NLS-1$
- String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
+ String expectedSql = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT1.SmallB WHERE (BQT1.SmallA.IntKey = BQT1.SmallB.IntKey) AND (BQT1.SmallA.IntKey = 5) AND (BQT1.SmallB.IntKey = 5)"; //$NON-NLS-1$
String expectedSql2 = "SELECT BQT2.SmallA.IntKey FROM BQT2.SmallA WHERE BQT2.SmallA.IntKey = 5"; //$NON-NLS-1$
Set expectedQueries = new HashSet();
@@ -5792,9 +5762,7 @@
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -5831,9 +5799,7 @@
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5872,9 +5838,6 @@
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5914,9 +5877,6 @@
caps.setCapabilitySupport(Capability.QUERY_SEARCHED_CASE, false); // Can't push GROUP BY
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_SUM, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GE, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.exampleBQTCached();
@@ -5987,7 +5947,7 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6083,11 +6043,8 @@
// Plan query
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
@@ -6555,7 +6512,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("p1", caps); //$NON-NLS-1$
Command command = helpParse(sql);
@@ -6665,7 +6622,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_UNION, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$
@@ -7273,9 +7230,9 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
caps.setCapabilitySupport(Capability.QUERY_FROM_INLINE_VIEWS, true);
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN_SUBQUERY, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Command command = helpParse(sql);
@@ -7290,9 +7247,7 @@
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
// Plan query
@@ -7984,7 +7939,7 @@
public void testPushdownNonAliasedSelectLiteral() {
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_SELECT_LITERALS, true);
+ caps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, true);
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
FakeMetadataFacade metadata = FakeMetadataFactory.example1Cached();
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/TestVirtualDepJoin.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -248,8 +248,8 @@
Command command = TestProcessor.helpParse(sql);
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, false);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, setPushdown);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, false);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, setPushdown);
finder.addCapabilities("US", caps); //$NON-NLS-1$
finder.addCapabilities("Europe", caps);//$NON-NLS-1$
finder.addCapabilities("CustomerMaster", caps);//$NON-NLS-1$
@@ -315,7 +315,7 @@
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps1 = TestOptimizer.getTypicalCapabilities();
BasicSourceCapabilities caps2 = TestOptimizer.getTypicalCapabilities();
- caps2.setCapabilitySupport(Capability.QUERY_WHERE_IN, false);
+ caps2.setCapabilitySupport(Capability.CRITERIA_IN, false);
finder.addCapabilities("US", caps1); //$NON-NLS-1$
finder.addCapabilities("Europe", caps2);//$NON-NLS-1$
finder.addCapabilities("CustomerMaster", caps1);//$NON-NLS-1$
@@ -530,7 +530,7 @@
Command command = TestProcessor.helpParse(sql);
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, pushCriteria);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, pushCriteria);
finder.addCapabilities("US", caps); //$NON-NLS-1$
finder.addCapabilities("Europe", caps);//$NON-NLS-1$
finder.addCapabilities("CustomerMaster", caps);//$NON-NLS-1$
Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/xml/TestXMLProcessor.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -10062,10 +10062,7 @@
BasicSourceCapabilities caps = new BasicSourceCapabilities();
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_SCALAR, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
CapabilitiesFinder capFinder = new SimpleCapabilitiesFinder(caps);
Modified: trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestCriteria.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestCriteria.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/sql/lang/TestCriteria.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -176,8 +176,8 @@
CompoundCriteria compCrit2 = new CompoundCriteria();
compCrit2.setOperator(CompoundCriteria.AND);
compCrit2.addCriteria(crit3);
- compCrit2.addCriteria(compCrit);
-
+ compCrit2.addCriteria(crit1);
+ compCrit2.addCriteria(crit2);
helpTestCombineCriteria(crit3, compCrit, compCrit2);
}
Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFacade.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -559,7 +559,8 @@
public Properties getExtensionProperties(Object metadataID)
throws MetaMatrixComponentException, QueryMetadataException {
- return null;
+ ArgCheck.isInstanceOf(FakeMetadataObject.class, metadataID);
+ return ((FakeMetadataObject)metadataID).getExtensionProps();
}
public int getElementLength(Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataFactory.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -30,7 +30,6 @@
import java.util.List;
import com.metamatrix.common.types.DataTypeManager;
-import com.metamatrix.common.types.DataTypeManager.DefaultDataClasses;
import com.metamatrix.dqp.message.ParameterInfo;
import com.metamatrix.query.mapping.relational.QueryNode;
import com.metamatrix.query.mapping.xml.MappingAttribute;
@@ -1738,6 +1737,7 @@
FakeMetadataObject pm3g2 = createPhysicalGroup("pm3.g2", pm3); //$NON-NLS-1$
FakeMetadataObject pm3g3 = createPhysicalGroup("pm3.g3", pm3); //$NON-NLS-1$
FakeMetadataObject pm4g1 = createPhysicalGroup("pm4.g1", pm4); //$NON-NLS-1$
+ FakeMetadataObject pm4g2 = createPhysicalGroup("pm4.g2", pm4); //$NON-NLS-1$
// Add group cardinality metadata
pm1g1.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(10));
pm1g2.putProperty(FakeMetadataObject.Props.CARDINALITY, new Integer(10));
@@ -1780,23 +1780,16 @@
List pm4g1e = createElements(pm4g1,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.BOOLEAN, DataTypeManager.DefaultDataTypes.DOUBLE });
+ List pm4g2e = createElements(pm4g2,
+ new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.BOOLEAN, DataTypeManager.DefaultDataTypes.DOUBLE });
// Add key metadata
- List keyElements = new ArrayList(1);
- keyElements.add(pm1g1e.iterator().next());
- FakeMetadataObject pm1g1key1 = createKey("pm1.g1.key1", pm1g1, keyElements); //e1 //$NON-NLS-1$
- keyElements = new ArrayList(1);
- keyElements.add(pm3g1e.iterator().next());
- FakeMetadataObject pm3g1key1 = createKey("pm3.g1.key1", pm3g1, keyElements); //e1 //$NON-NLS-1$
- keyElements = new ArrayList(1);
- keyElements.add(pm3g3e.iterator().next());
- FakeMetadataObject pm3g3key1 = createKey("pm3.g3.key1", pm3g3, keyElements); //e1 //$NON-NLS-1$
- keyElements = new ArrayList(1);
- Iterator i = pm4g1e.iterator();
- keyElements.add(i.next());
- keyElements.add(i.next());
- FakeMetadataObject pm4g1key1 = createKey("pm4.g1.key1", pm4g1, keyElements); //e1, e2 //$NON-NLS-1$
-
+ FakeMetadataObject pm1g1key1 = createKey("pm1.g1.key1", pm1g1, pm1g1e.subList(0, 1)); //e1 //$NON-NLS-1$
+ FakeMetadataObject pm3g1key1 = createKey("pm3.g1.key1", pm3g1, pm3g1e.subList(0, 1)); //e1 //$NON-NLS-1$
+ FakeMetadataObject pm3g3key1 = createKey("pm3.g3.key1", pm3g3, pm3g3e.subList(0, 1)); //e1 //$NON-NLS-1$
+ FakeMetadataObject pm4g1key1 = createKey("pm4.g1.key1", pm4g1, pm4g1e.subList(0, 2)); //e1, e2 //$NON-NLS-1$
+ FakeMetadataObject pm4g2key1 = createForeignKey("pm4.g2.fk", pm4g2, pm4g2e.subList(0, 2), pm4g1key1); //$NON-NLS-1$
// Add access pattern metadata
// Create access patterns - pm1
List elements = new ArrayList(1);
@@ -1876,7 +1869,10 @@
store.addObject(pm4g1);
store.addObjects(pm4g1e);
store.addObject(pm4g1key1);
-
+ store.addObject(pm4g2);
+ store.addObjects(pm4g2e);
+ store.addObject(pm4g2key1);
+
store.addObject(vm1);
store.addObject(vm1g1);
store.addObjects(vm1g1e);
@@ -4125,29 +4121,9 @@
* @param index Column index in group
* @return FakeMetadataObject Metadata object for element
*/
- public static FakeMetadataObject createElement(String name, FakeMetadataObject group, String type, int index) {
- FakeMetadataObject obj = new FakeMetadataObject(name, FakeMetadataObject.ELEMENT);
- obj.putProperty(FakeMetadataObject.Props.MODEL, group.getProperty(FakeMetadataObject.Props.MODEL));
- obj.putProperty(FakeMetadataObject.Props.GROUP, group);
- obj.putProperty(FakeMetadataObject.Props.TYPE, type);
-
- obj.putProperty(FakeMetadataObject.Props.SELECT, Boolean.TRUE);
- if(type.equals(DataTypeManager.DefaultDataTypes.STRING)) {
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_LIKE, Boolean.TRUE);
- } else {
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_LIKE, Boolean.FALSE);
- }
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_COMPARE, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.NULL, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.AUTO_INCREMENT, Boolean.FALSE);
- obj.putProperty(FakeMetadataObject.Props.CASE_SENSITIVE, Boolean.FALSE);
- obj.putProperty(FakeMetadataObject.Props.DEFAULT_VALUE, null);
- obj.putProperty(FakeMetadataObject.Props.INDEX, new Integer(index));
- obj.putProperty(FakeMetadataObject.Props.UPDATE, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.LENGTH, "100"); //$NON-NLS-1$
- obj.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, (name.lastIndexOf(".") == -1)? name : name.substring(name.lastIndexOf(".") + 1) ); //$NON-NLS-1$ //$NON-NLS-2$
- return obj;
- }
+ public static FakeMetadataObject createElement(String name, FakeMetadataObject group, String type, int index) {
+ return createElement(name, group, type, index, true);
+ }
public static FakeMetadataObject createElement(String name, FakeMetadataObject group, String type, int index, boolean flag) {
FakeMetadataObject obj = new FakeMetadataObject(name, FakeMetadataObject.ELEMENT);
@@ -4169,11 +4145,11 @@
obj.putProperty(FakeMetadataObject.Props.UPDATE, Boolean.TRUE);
obj.putProperty(FakeMetadataObject.Props.LENGTH, "100"); //$NON-NLS-1$
- int indexOfDot = name.indexOf("."); //$NON-NLS-1$
+ int indexOfDot = name.lastIndexOf("."); //$NON-NLS-1$
if (flag) {
name = name.substring(indexOfDot+1);
} else {
- name = "" + index; //$NON-NLS-1$
+ name = String.valueOf(index);
}
obj.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, name);
Modified: trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataObject.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataObject.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/unittest/FakeMetadataObject.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,8 +22,10 @@
package com.metamatrix.query.unittest;
-import java.util.*;
import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
public class FakeMetadataObject implements Comparable, Serializable {
@@ -46,6 +48,7 @@
private String type;
private Object defaultValue;
private Map props = new HashMap();
+ private Properties extensionProps;
public FakeMetadataObject(String name, String type) {
this.name = name;
@@ -133,6 +136,16 @@
}
}
+ public void setExtensionProp(String name, String value) {
+ if (this.extensionProps == null) {
+ this.extensionProps = new Properties();
+ }
+ this.extensionProps.setProperty(name, value);
+ }
+
+ public Properties getExtensionProps() {
+ return extensionProps;
+ }
public String toString() {
return getType() + "(" + getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/com/metamatrix/query/validator/TestValidator.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -104,7 +104,7 @@
return externalMetadata;
}
- public FakeMetadataFacade exampleMetadata() {
+ public static FakeMetadataFacade exampleMetadata() {
// Create metadata objects
FakeMetadataObject modelObj = FakeMetadataFactory.createPhysicalModel("test"); //$NON-NLS-1$
FakeMetadataObject vModelObj2 = FakeMetadataFactory.createVirtualModel("vTest"); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -102,7 +102,7 @@
AtomicRequestMessage request = TestConnectorWorkItem.createNewAtomicRequestMessage(1, 1);
SourceCapabilities caps = cm.getCapabilities(request.getRequestID(), null, Mockito.mock(DQPWorkContext.class));
- assertFalse(caps.supportsCapability(Capability.QUERY_WHERE_EXISTS));
+ assertFalse(caps.supportsCapability(Capability.CRITERIA_EXISTS));
assertFalse(caps.supportsCapability(Capability.QUERY_EXCEPT));
@@ -113,7 +113,7 @@
startConnectorManager(cmnew, props);
SourceCapabilities capsnew = cmnew.getCapabilities(request.getRequestID(), null, Mockito.mock(DQPWorkContext.class));
- assertTrue(capsnew.supportsCapability(Capability.QUERY_WHERE_EXISTS));
+ assertTrue(capsnew.supportsCapability(Capability.CRITERIA_EXISTS));
assertTrue(capsnew.supportsCapability(Capability.QUERY_EXCEPT));
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestElementImpl.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestElementImpl.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/language/TestElementImpl.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -22,17 +22,15 @@
package org.teiid.dqp.internal.datamgr.language;
+import junit.framework.TestCase;
+
import org.teiid.connector.language.IElement;
import org.teiid.connector.language.IGroup;
import org.teiid.connector.metadata.runtime.Element;
-import org.teiid.dqp.internal.datamgr.language.ElementImpl;
-import org.teiid.dqp.internal.datamgr.language.GroupImpl;
-import org.teiid.dqp.internal.datamgr.metadata.TestMetadataFactory;
-import junit.framework.TestCase;
-
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.query.sql.symbol.ElementSymbol;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.unittest.FakeMetadataObject;
public class TestElementImpl extends TestCase {
@@ -96,8 +94,8 @@
}
public void testGetMetadataID() throws Exception {
- FakeMetadataObject group = TestMetadataFactory.createGroup("pm1.g1", null); //$NON-NLS-1$
- FakeMetadataObject metadataID = TestMetadataFactory.createElement("e", group, DataTypeManager.DefaultDataTypes.STRING, 0); //$NON-NLS-1$
+ FakeMetadataObject group = FakeMetadataFactory.createPhysicalGroup("pm1.g1", FakeMetadataFactory.createPhysicalModel("pm1.g1")); //$NON-NLS-1$ //$NON-NLS-2$
+ FakeMetadataObject metadataID = FakeMetadataFactory.createElement("e", group, DataTypeManager.DefaultDataTypes.STRING, 0); //$NON-NLS-1$
assertNotNull(example("pm1.g1", "e", metadataID).getMetadataObject()); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/metadata/TestMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/metadata/TestMetadataFactory.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/metadata/TestMetadataFactory.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -24,17 +24,13 @@
*/
package org.teiid.dqp.internal.datamgr.metadata;
-import java.util.ArrayList;
import java.util.List;
-import org.teiid.dqp.internal.datamgr.metadata.ElementImpl;
-import org.teiid.dqp.internal.datamgr.metadata.GroupImpl;
-import org.teiid.dqp.internal.datamgr.metadata.RuntimeMetadataImpl;
-
import junit.framework.TestCase;
import com.metamatrix.common.types.DataTypeManager;
import com.metamatrix.query.unittest.FakeMetadataFacade;
+import com.metamatrix.query.unittest.FakeMetadataFactory;
import com.metamatrix.query.unittest.FakeMetadataObject;
import com.metamatrix.query.unittest.FakeMetadataStore;
@@ -49,8 +45,8 @@
public void setUp(){
FakeMetadataStore store = new FakeMetadataStore();
- pm1g1 = createGroup("pm1.g1", null); //$NON-NLS-1$
- List pm1g1e = createElements(pm1g1,
+ pm1g1 = FakeMetadataFactory.createPhysicalGroup("pm1.g1", FakeMetadataFactory.createPhysicalModel("pm1.g1")); //$NON-NLS-1$ //$NON-NLS-2$
+ List pm1g1e = FakeMetadataFactory.createElements(pm1g1,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] { DataTypeManager.DefaultDataTypes.STRING, DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataTypes.BOOLEAN, DataTypeManager.DefaultDataTypes.DOUBLE });
pm1g1e1 = (FakeMetadataObject)pm1g1e.get(0);
@@ -58,53 +54,7 @@
store.addObjects(pm1g1e);
metadataFactory = new RuntimeMetadataImpl(new FakeMetadataFacade(store));
}
-
-
- public static FakeMetadataObject createGroup(String name, FakeMetadataObject model) {
- FakeMetadataObject obj = new FakeMetadataObject(name, FakeMetadataObject.GROUP);
- obj.putProperty(FakeMetadataObject.Props.MODEL, model);
- obj.putProperty(FakeMetadataObject.Props.IS_VIRTUAL, Boolean.FALSE);
- obj.putProperty(FakeMetadataObject.Props.UPDATE, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.TEMP, Boolean.FALSE);
- obj.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, name.substring(name.lastIndexOf(".")+1)); //$NON-NLS-1$
- return obj;
- }
- public static FakeMetadataObject createElement(String name, FakeMetadataObject group, String type, int index) {
- FakeMetadataObject obj = new FakeMetadataObject(name, FakeMetadataObject.ELEMENT);
- obj.putProperty(FakeMetadataObject.Props.MODEL, group.getProperty(FakeMetadataObject.Props.MODEL));
- obj.putProperty(FakeMetadataObject.Props.GROUP, group);
- obj.putProperty(FakeMetadataObject.Props.TYPE, type);
-
- obj.putProperty(FakeMetadataObject.Props.SELECT, Boolean.TRUE);
- if(type.equals("string")) { //$NON-NLS-1$
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_LIKE, Boolean.TRUE);
- } else {
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_LIKE, Boolean.FALSE);
- }
- obj.putProperty(FakeMetadataObject.Props.SEARCHABLE_COMPARE, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.NULL, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.AUTO_INCREMENT, Boolean.FALSE);
- obj.putProperty(FakeMetadataObject.Props.DEFAULT_VALUE, null);
- obj.putProperty(FakeMetadataObject.Props.INDEX, new Integer(index));
- obj.putProperty(FakeMetadataObject.Props.UPDATE, Boolean.TRUE);
- obj.putProperty(FakeMetadataObject.Props.LENGTH, "100"); //$NON-NLS-1$
- obj.putProperty(FakeMetadataObject.Props.NAME_IN_SOURCE, name.substring(name.lastIndexOf(".")+1)); //$NON-NLS-1$
- return obj;
- }
-
- public static List createElements(FakeMetadataObject group, String[] names, String[] types) {
- String groupRoot = group.getName() + "."; //$NON-NLS-1$
- List elements = new ArrayList();
-
- for(int i=0; i<names.length; i++) {
- FakeMetadataObject element = createElement(groupRoot + names[i], group, types[i], i);
- elements.add(element);
- }
-
- return elements;
- }
-
//tests
public void testCreateMetadataID() throws Exception {
@@ -127,7 +77,7 @@
ElementImpl element = metadataFactory.getElement(pm1g1e1);
assertEquals(element.getLength(), 100);
assertEquals(element.getJavaType(), DataTypeManager.DefaultDataClasses.STRING);
- assertEquals(element.getNameInSource(), "e1"); //$NON-NLS-1$
+ assertEquals("e1", element.getNameInSource()); //$NON-NLS-1$
assertEquals(element.getActualID(), pm1g1e1);
}
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-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -190,19 +190,16 @@
//Create plan
FakeCapabilitiesFinder capFinder = new FakeCapabilitiesFinder();
BasicSourceCapabilities caps = new BasicSourceCapabilities();
- caps.setCapabilitySupport(Capability.QUERY_WHERE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_EQ, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_COMPARE_GT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_NOT, true);
- caps.setCapabilitySupport(Capability.QUERY_WHERE_IN, true);
- caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_EQ, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_NOT, true);
+ caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
+ caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_INNER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_OUTER_FULL, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_JOIN_SELFJOIN, true);
caps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, true);
caps.setCapabilitySupport(Capability.QUERY_ORDERBY, true);
- caps.setCapabilitySupport(Capability.FUNCTION, true);
caps.setFunctionSupport("+", false); //$NON-NLS-1$
caps.setFunctionSupport("convert", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceCapabilitiesFinder.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceCapabilitiesFinder.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceCapabilitiesFinder.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -58,16 +58,14 @@
assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_UNION));
assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_ORDERBY));
assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_SELECT_DISTINCT));
- assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_AGGREGATES));
- assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_WHERE_COMPARE));
+ assertEquals(true, singleCaps.supportsCapability(Capability.QUERY_AGGREGATES_AVG));
// Test the multi model to show that it IS affected
SourceCapabilities multiCaps = finder.findCapabilities(MULTI_MODEL);
assertEquals(false, multiCaps.supportsCapability(Capability.QUERY_UNION));
assertEquals(false, multiCaps.supportsCapability(Capability.QUERY_ORDERBY));
assertEquals(false, multiCaps.supportsCapability(Capability.QUERY_SELECT_DISTINCT));
- assertEquals(false, multiCaps.supportsCapability(Capability.QUERY_AGGREGATES));
- assertEquals(true, multiCaps.supportsCapability(Capability.QUERY_WHERE_COMPARE));
+ assertEquals(false, multiCaps.supportsCapability(Capability.QUERY_AGGREGATES_AVG));
}
}
Modified: trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestTPCR.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestTPCR.java 2009-05-06 17:19:14 UTC (rev 867)
+++ trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestTPCR.java 2009-05-06 20:38:38 UTC (rev 868)
@@ -32,6 +32,7 @@
import com.metamatrix.core.util.UnitTestUtil;
import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.optimizer.TestOptimizer;
+import com.metamatrix.query.optimizer.TestOptimizer.ComparisonMode;
import com.metamatrix.query.optimizer.capabilities.FakeCapabilitiesFinder;
import com.metamatrix.query.processor.HardcodedDataManager;
import com.metamatrix.query.processor.ProcessorPlan;
@@ -75,7 +76,7 @@
Arrays.asList(new Object[] { new Double(3459808.0), new BigDecimal("405838.6989"), TimestampUtil.createDate(95, 2, 4), new Double(0.0) }), //$NON-NLS-1$
Arrays.asList(new Object[] { new Double(492164.0), new BigDecimal("390324.0610"), TimestampUtil.createDate(95, 1, 19), new Double(0.0) }) }; //$NON-NLS-1$
- dataMgr.addData("SELECT g_2.l_orderkey AS c_0, SUM((g_2.l_extendedprice * (1 - g_2.l_discount))) AS c_1, g_1.o_orderdate AS c_2, g_1.o_shippriority AS c_3 FROM TPCR_Oracle_9i.CUSTOMER AS g_0, TPCR_Oracle_9i.ORDERS AS g_1, TPCR_Oracle_9i.LINEITEM AS g_2 WHERE (g_2.l_orderkey = g_1.o_orderkey) AND (g_2.l_shipdate > {ts'1995-03-15 00:00:00.0'}) AND (g_0.c_custkey = g_1.o_custkey) AND (g_0.c_mktsegment = 'BUILDING') AND (g_1.o_orderdate < {d'1995-03-15'}) GROUP BY g_2.l_orderkey, g_1.o_orderdate, g_1.o_shippriority ORDER BY c_1 DESC, c_2", //$NON-NLS-1$
+ dataMgr.addData("SELECT g_2.l_orderkey AS c_0, SUM((g_2.l_extendedprice * (1 - g_2.l_discount))) AS c_1, g_1.o_orderdate AS c_2, g_1.o_shippriority AS c_3 FROM TPCR_Oracle_9i.CUSTOMER AS g_0, TPCR_Oracle_9i.ORDERS AS g_1, TPCR_Oracle_9i.LINEITEM AS g_2 WHERE (g_0.c_custkey = g_1.o_custkey) AND (g_2.l_orderkey = g_1.o_orderkey) AND (g_0.c_mktsegment = 'BUILDING') AND (g_1.o_orderdate < {d'1995-03-15'}) AND (g_2.l_shipdate > {ts'1995-03-15 00:00:00.0'}) GROUP BY g_2.l_orderkey, g_1.o_orderdate, g_1.o_shippriority ORDER BY c_1 DESC, c_2", //$NON-NLS-1$
expected);
doProcess(plan, dataMgr, expected, DEBUG);
@@ -212,7 +213,7 @@
ProcessorPlan plan = TestOptimizer.helpPlan("select S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT from (SELECT SUPPLIER.S_ACCTBAL, SUPPLIER.S_NAME, NATION.N_NAME, PART.P_PARTKEY, PART.P_MFGR, SUPPLIER.S_ADDRESS, SUPPLIER.S_PHONE, SUPPLIER.S_COMMENT FROM PART, SUPPLIER, PARTSUPP, NATION, REGION WHERE (PART.P_PARTKEY = PS_PARTKEY) AND (S_SUPPKEY = PS_SUPPKEY) AND (P_SIZE = 15) AND (P_TYPE LIKE '%BRASS') AND (S_NATIONKEY = N_NATIONKEY) AND (N_REGIONKEY = R_REGIONKEY) AND (R_NAME = 'EUROPE') AND (PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST) FROM PARTSUPP, SUPPLIER, NATION, REGION WHERE (PART.P_PARTKEY = PS_PARTKEY) AND (S_SUPPKEY = PS_SUPPKEY) AND (S_NATIONKEY = N_NATIONKEY) AND (N_REGIONKEY = R_REGIONKEY) AND (R_NAME = 'EUROPE'))) ORDER BY SUPPLIER.S_ACCTBAL DESC, NATION.N_NAME, SUPPLIER.S_NAME, PART.P_PARTKEY) as x", //$NON-NLS-1$
METADATA, null, finder,
- new String[] {"SELECT g_1.S_ACCTBAL, g_1.S_NAME, g_3.N_NAME, g_0.P_PARTKEY, g_0.P_MFGR, g_1.S_ADDRESS, g_1.S_PHONE, g_1.S_COMMENT FROM TPCR_Oracle_9i.PART AS g_0, TPCR_Oracle_9i.SUPPLIER AS g_1, TPCR_Oracle_9i.PARTSUPP AS g_2, TPCR_Oracle_9i.NATION AS g_3, TPCR_Oracle_9i.REGION AS g_4 WHERE (g_0.P_PARTKEY = g_2.PS_PARTKEY) AND (g_2.PS_SUPPLYCOST = (SELECT MIN(g_5.PS_SUPPLYCOST) FROM TPCR_Oracle_9i.PARTSUPP AS g_5, TPCR_Oracle_9i.SUPPLIER AS g_6, TPCR_Oracle_9i.NATION AS g_7, TPCR_Oracle_9i.REGION AS g_8 WHERE (g_7.N_REGIONKEY = g_8.R_REGIONKEY) AND (g_8.R_NAME = 'EUROPE') AND (g_6.S_NATIONKEY = g_7.N_NATIONKEY) AND (g_6.S_SUPPKEY = g_5.PS_SUPPKEY) AND (g_5.PS_PARTKEY = g_0.P_PARTKEY))) AND (g_0.P_SIZE = 15.0) AND (g_0.P_TYPE LIKE '%BRASS') AND (g_1.S_NATIONKEY = g_3.N_NATIONKEY) AND (g_1.S_SUPPKEY = g_2.PS_SUPPKEY) AND (g_3.N_REGIONKEY = g_4.R_REGIONKEY) AND (g_4.R_NAME = 'EUROPE')"}, true); //$NON-NLS-1$
+ new String[] {"SELECT g_1.S_ACCTBAL, g_1.S_NAME, g_3.N_NAME, g_0.P_PARTKEY, g_0.P_MFGR, g_1.S_ADDRESS, g_1.S_PHONE, g_1.S_COMMENT FROM TPCR_Oracle_9i.PART AS g_0, TPCR_Oracle_9i.SUPPLIER AS g_1, TPCR_Oracle_9i.PARTSUPP AS g_2, TPCR_Oracle_9i.NATION AS g_3, TPCR_Oracle_9i.REGION AS g_4 WHERE (g_3.N_REGIONKEY = g_4.R_REGIONKEY) AND (g_1.S_NATIONKEY = g_3.N_NATIONKEY) AND (g_1.S_SUPPKEY = g_2.PS_SUPPKEY) AND (g_0.P_PARTKEY = g_2.PS_PARTKEY) AND (g_2.PS_SUPPLYCOST = (SELECT MIN(g_5.PS_SUPPLYCOST) FROM TPCR_Oracle_9i.PARTSUPP AS g_5, TPCR_Oracle_9i.SUPPLIER AS g_6, TPCR_Oracle_9i.NATION AS g_7, TPCR_Oracle_9i.REGION AS g_8 WHERE (g_6.S_SUPPKEY = g_5.PS_SUPPKEY) AND (g_6.S_NATIONKEY = g_7.N_NATIONKEY) AND (g_7.N_REGIONKEY = g_8.R_REGIONKEY) AND (g_5.PS_PARTKEY = g_0.P_PARTKEY) AND (g_8.R_NAME = 'EUROPE'))) AND (g_0.P_SIZE = 15.0) AND (g_0.P_TYPE LIKE '%BRASS') AND (g_4.R_NAME = 'EUROPE')"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
15 years, 7 months
teiid SVN: r867 - in trunk/console/src/main/java/com/metamatrix/console: ui/views/deploy and 1 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-06 13:19:14 -0400 (Wed, 06 May 2009)
New Revision: 867
Modified:
trunk/console/src/main/java/com/metamatrix/console/models/ConfigurationManager.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployMainPanel.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/model/ConfigurationTreeModel.java
Log:
TEIID-546: fixes to regression from psc changes
Modified: trunk/console/src/main/java/com/metamatrix/console/models/ConfigurationManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/ConfigurationManager.java 2009-05-05 23:30:21 UTC (rev 866)
+++ trunk/console/src/main/java/com/metamatrix/console/models/ConfigurationManager.java 2009-05-06 17:19:14 UTC (rev 867)
@@ -911,11 +911,9 @@
// }
private void fireConfigurationChange(ConfigurationChangeEvent theEvent) {
- LogManager.logDetail(LogContexts.PSCDEPLOY,
- "ConfigurationChangeEvent=" + theEvent.paramString()); //$NON-NLS-1$
+ LogManager.logDetail(LogContexts.PSCDEPLOY, "ConfigurationChangeEvent=" + theEvent.paramString()); //$NON-NLS-1$
for (int size=listeners.size(), i=0; i<size; i++) {
- ConfigurationChangeListener l =
- (ConfigurationChangeListener)listeners.get(i);
+ ConfigurationChangeListener l = (ConfigurationChangeListener)listeners.get(i);
l.configurationChanged(theEvent);
}
}
@@ -1176,22 +1174,15 @@
return host;
}
- public Collection getHostProcesses(
- Host theHost,
- ConfigurationID theConfigId)
- throws ExternalException {
+ public Collection getHostProcesses(Host theHost,ConfigurationID theConfigId) throws ExternalException {
try {
Collection result = null; // VMComponentDefn
Collection ids = null;
Configuration config = getConfig(theConfigId);
if (config == null) {
- LogManager.logCritical(
- LogContexts.PSCDEPLOY,
- "ConfigurationManager.getHostProcesses:" + //$NON-NLS-1$
- "Configuration " + config + " not found."); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logCritical(LogContexts.PSCDEPLOY,"ConfigurationManager.getHostProcesses: Configuration " + config + " not found."); //$NON-NLS-1$ //$NON-NLS-2$
result = Collections.EMPTY_LIST;
-
}
//
@@ -1235,17 +1226,11 @@
// VMComponentDefnID processId =
// deployedComp.getVMComponentDefnID();
VMComponentDefn process = (VMComponentDefn) itr.next();
-// config.getComponentDefn(processId);
+// config.getComponentDefn(processId);
result.add(process);
ids.add(process.getID());
- fireConfigurationChange(
- new ConfigurationChangeEvent(
- ConfigurationChangeEvent.NEW,
- process,
- config,
- new Object[] {theHost,
- config}));
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.NEW,process,config,new Object[] {theHost,config}));
// call this to cache the pscs
// getDeployedPscs(process);
@@ -1721,6 +1706,11 @@
}
}
+ private void addConfig(ConfigurationModelContainer theConfig) {
+ config = theConfig;
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.NEW,theConfig.getConfiguration(),theConfig.getConfiguration(), null));
+ }
+
public void refresh(){
super.refresh();
this.setRefreshNeeded();
@@ -1728,57 +1718,70 @@
refreshImpl();
refreshConfigs();
} catch (ExternalException e) {
- LogManager.logCritical(
- LogContexts.CONFIG,
- "ConfigurationManager.refreshConfigs:" + //$NON-NLS-1$
- "Error refreshing configuration."); //$NON-NLS-1$
-
+ LogManager.logCritical(LogContexts.CONFIG, "ConfigurationManager.refreshConfigs: Error refreshing configuration."); //$NON-NLS-1$
}
}
- private void refreshConfigs()
- throws ExternalException {
+ private void refreshConfigs() throws ExternalException {
- fireConfigurationChange(
- new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_START,
- this));
-
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_START,this));
try {
ConfigurationModelContainer nextStartUp = getAPI().getConfigurationModel(Configuration.NEXT_STARTUP);
if (nextStartUp == null) {
- LogManager.logCritical(
- LogContexts.CONFIG,
- "ConfigurationManager.refreshConfigs:" + //$NON-NLS-1$
- "Next Startup Configuration is null."); //$NON-NLS-1$
+ LogManager.logCritical(LogContexts.CONFIG,"ConfigurationManager.refreshConfigs:Next Startup Configuration is null."); //$NON-NLS-1$
} else {
- config = nextStartUp;
+ addConfig(nextStartUp);
}
- fireConfigurationChange(
- new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_END,
- this));
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_END,this));
refreshNeeded = false;
} catch (Exception theException) {
- throw new ExternalException(
- formatErrorMsg("refreshConfigs", theException), //$NON-NLS-1$
- theException);
+ throw new ExternalException(formatErrorMsg("refreshConfigs", theException), theException); //$NON-NLS-1$
}
}
+
+ private void refreshDeployedHosts() throws ExternalException {
+ Iterator itr = config.getHosts().iterator();
+ while (itr.hasNext()) {
+ Host host = (Host) itr.next();
+ getHostProcesses(host, config.getConfigurationID());
+ }
+ }
+ private void refreshHosts()
+ throws ExternalException {
+
+ try {
+ Collection hostCollection = getConfigModel(Configuration.NEXT_STARTUP_ID).getHosts();
+ if ((hostCollection == null) || (hostCollection.isEmpty())) {
+ LogManager.logCritical(LogContexts.CONFIG,"ConfigurationManager.refreshHosts: No hosts found or is null."); //$NON-NLS-1$
+ } else {
+ Iterator itr = hostCollection.iterator();
+ while (itr.hasNext()) {
+ Host host = (Host)itr.next();
+ LogManager.logDetail(LogContexts.CONFIG,"ConfigurationManager.refreshHosts: Adding Host:" + host); //$NON-NLS-1$
+ notifyHostChangeToConfigs(host, ConfigurationChangeEvent.NEW);
+ }
+ }
+ } catch (Exception theException) {
+ throw new ExternalException(
+ formatErrorMsg("refreshHosts", theException), //$NON-NLS-1$
+ theException);
+ }
+ }
+
public void refreshImpl()
throws ExternalException {
- fireConfigurationChange(
- new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_START,
- this));
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_START,this));
+
refreshConfigs();
-// refreshHosts();
- // refreshDeployedHosts();
- fireConfigurationChange(
- new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_END,
- this));
+ refreshHosts();
+ refreshDeployedHosts();
+
+ fireConfigurationChange(new ConfigurationChangeEvent(ConfigurationChangeEvent.REFRESH_END,this));
refreshNeeded = false;
}
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployMainPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployMainPanel.java 2009-05-05 23:30:21 UTC (rev 866)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployMainPanel.java 2009-05-06 17:19:14 UTC (rev 867)
@@ -444,7 +444,7 @@
pnlTreeOps.add(pnlTreeOpsSizer);
getConfigurationManager().addConfigurationChangeListener(treeModel);
- getConfigurationManager().refreshImpl();
+ //getConfigurationManager().refresh();
setInitialTreeState(true);
treeModel.addConfigurationTreeModelListener(this);
}
@@ -1024,13 +1024,12 @@
// if new host event, only select if the currently selected
// node has the same configuration. this is because when
// a host is created, events fire to add into all configurations.
- if (theEvent.isHostChange()) {
+ if (theEvent.isHostChange() && pnlDetail != null) {
Configuration config = theEvent.getConfiguration();
if (config.getID().equals(pnlDetail.getConfigId())) {
selectNode(theEvent.getSourceNode());
}
- } else if (!(pnlDetail instanceof DeployedProcessPanel) &&
- !theEvent.isServiceDefinitionChange()) {
+ } else if (!(pnlDetail instanceof DeployedProcessPanel) && !theEvent.isServiceDefinitionChange()) {
// if a new object is created, don't select it if
// current detail panel is the DeployedProcessPane.
// focus should stay on the panel, not the new one.
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/model/ConfigurationTreeModel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/model/ConfigurationTreeModel.java 2009-05-05 23:30:21 UTC (rev 866)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/model/ConfigurationTreeModel.java 2009-05-06 17:19:14 UTC (rev 867)
@@ -142,12 +142,7 @@
// notify tree model listeners
if (fireevent) {
- ConfigurationTreeModelEvent event =
- new ConfigurationTreeModelEvent(ConfigurationTreeModelEvent.NEW,
- configNode,
- configNode,
- null);
- fireConfigurationChange(event);
+ fireConfigurationChange(new ConfigurationTreeModelEvent(ConfigurationTreeModelEvent.NEW,configNode,configNode,null));
}
}
@@ -178,8 +173,10 @@
private void addDeloyedHost(Host theHost, Configuration theConfig, boolean fireevent) {
DefaultTreeNode configNode = getUserObjectNode(theConfig);
- DefaultTreeNode hostNode =
- createHostNode(theHost, theConfig, configNode);
+ DefaultTreeNode hostNode = createHostNode(theHost, theConfig, configNode);
+ if (configNode == null) {
+ configNode = hostNode;
+ }
HashMap map = (HashMap)hostConfigMap.get(theHost.getID());
if (map == null) {
// has not been deployed
@@ -361,22 +358,15 @@
* @param theUserObject the user object of the new node
* @param theParent the parent node of the new node
*/
- private SortableChildrenNode createNode(
- Object theUserObject,
- DefaultTreeNode theParent) {
-
+ private SortableChildrenNode createNode(Object theUserObject, DefaultTreeNode theParent) {
SortableChildrenNode child = new SortableChildrenNode(theUserObject);
- theParent.addChild(child);
+ theParent.addChild(child);
objNodeMap.put(theUserObject, child);
fireNodeAddedEvent(this, child);
return child;
}
- private SortableChildrenNode createHostNode(
- Host theHost,
- Configuration theConfig,
- DefaultTreeNode theParent) {
-
+ private SortableChildrenNode createHostNode(Host theHost, Configuration theConfig, DefaultTreeNode theParent) {
HostWrapper wrap = new HostWrapper(theHost, theConfig);
return createNode(wrap, theParent);
}
@@ -445,12 +435,9 @@
* @param theEvent the event being sent to the listeners
*/
private void fireConfigurationChange(ConfigurationTreeModelEvent theEvent) {
- LogManager.logDetail(
- LogContexts.PSCDEPLOY,
- "ConfigurationTreeModelEvent=" + theEvent.paramString()); //$NON-NLS-1$
+ LogManager.logDetail(LogContexts.PSCDEPLOY,"ConfigurationTreeModelEvent=" + theEvent.paramString()); //$NON-NLS-1$
for (int size=listeners.size(), i=0; i<size; i++) {
- ConfigurationTreeModelListener l =
- (ConfigurationTreeModelListener)listeners.get(i);
+ ConfigurationTreeModelListener l = (ConfigurationTreeModelListener)listeners.get(i);
l.treeNodesChanged(theEvent);
}
}
15 years, 7 months
teiid SVN: r866 - trunk/common-internal/src/main/resources/com/metamatrix/common/config/api.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-05 19:30:21 -0400 (Tue, 05 May 2009)
New Revision: 866
Modified:
trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
Log:
TEIID-233 - Adding support for TCP based clustering for server. Reviewed By VanH.
Modified: trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
===================================================================
--- trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-05-05 21:39:37 UTC (rev 865)
+++ trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-05-05 23:30:21 UTC (rev 866)
@@ -42,7 +42,7 @@
<PropertyDefinition Name="metamatrix.xatxnmgr.txnstatus_port" DisplayName="Recovery Port" ShortDescription="Transaction Recovery Port (0-any available port)" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
</ComponentType>
<ComponentType Name="JGroups" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
- <PropertyDefinition Name="cluster.protocol" DisplayName="Cluster Protocol Type" ShortDescription="Type of protocol to be used (Unicast or Multicast)" DefaultValue="UNICAST-TCP" Multiplicity="1" PropertyType="String" IsConstrainedToAllowedValues="true" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true">
+ <PropertyDefinition Name="cluster.protocol" DisplayName="Cluster Protocol Type" ShortDescription="Type of protocol to be used (Unicast or Multicast)" DefaultValue="UNICAST-TCP" Multiplicity="1" PropertyType="String" IsConstrainedToAllowedValues="true" ValueDelimiter="," IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true">
<AllowedValue>MULTICAST</AllowedValue>
<AllowedValue>UNICAST_TCP</AllowedValue>
<AllowedValue>UNICAST_UDP</AllowedValue>
15 years, 7 months
teiid SVN: r865 - in trunk/connectors: connector-ldap and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-05 17:39:37 -0400 (Tue, 05 May 2009)
New Revision: 865
Modified:
trunk/connectors/connector-jdbc/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-loopback/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-text/pom.xml
trunk/connectors/connector-xml/pom.xml
Log:
TEIID-549
Modified: trunk/connectors/connector-jdbc/pom.xml
===================================================================
--- trunk/connectors/connector-jdbc/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-jdbc/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -45,7 +45,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-ldap/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -42,7 +42,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
Modified: trunk/connectors/connector-loopback/pom.xml
===================================================================
--- trunk/connectors/connector-loopback/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-loopback/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -45,7 +45,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-salesforce/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -55,7 +55,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
Modified: trunk/connectors/connector-text/pom.xml
===================================================================
--- trunk/connectors/connector-text/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-text/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -41,7 +41,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
Modified: trunk/connectors/connector-xml/pom.xml
===================================================================
--- trunk/connectors/connector-xml/pom.xml 2009-05-05 19:09:01 UTC (rev 864)
+++ trunk/connectors/connector-xml/pom.xml 2009-05-05 21:39:37 UTC (rev 865)
@@ -56,7 +56,7 @@
<configuration>
<fileSeparator>:</fileSeparator>
<pathSeparator>;</pathSeparator>
- <prefix>extension</prefix>
+ <prefix>extensionjar</prefix>
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
15 years, 7 months
teiid SVN: r864 - in trunk: common-internal/src/main/java/com/metamatrix/common/config/api and 11 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-05-05 15:09:01 -0400 (Tue, 05 May 2009)
New Revision: 864
Removed:
trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/api/VMComponentDefnType.java
trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java
trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java
trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
trunk/server/src/main/java/com/metamatrix/platform/config/api/service/ConfigurationServiceInterface.java
trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLActionUpdateStrategy.java
trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationConnector.java
trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationMgr.java
trunk/server/src/main/java/com/metamatrix/server/Configuration.java
trunk/server/src/main/java/com/metamatrix/server/HostController.java
trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java
trunk/server/src/main/java/com/metamatrix/server/JGroupsProvider.java
trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigImportExport.java
trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigReader.java
Log:
TEIID-233 - Adding support for TCP based clustering for server. Reviewed By VanH.
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/CurrentConfiguration.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -22,6 +22,7 @@
package com.metamatrix.common.config;
+import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
@@ -81,11 +82,13 @@
public static final String BOOTSTRAP_FILE_NAME = "teiid.properties"; //$NON-NLS-1$
public static final String CONFIGURATION_READER_CLASS_PROPERTY_NAME = "metamatrix.config.reader"; //$NON-NLS-1$
- public static final String CLUSTER_NAME = "metamatrix.cluster.name"; //$NON-NLS-1$
+ public static final String CLUSTER_NAME = "cluster.name"; //$NON-NLS-1$
public static final String CONFIGURATION_NAME= "configuration.name"; //$NON-NLS-1$
+ public static final String CLUSTER_MEMBERS = "cluster.unicast.members"; //$NON-NLS-1$
private CurrentConfigurationReader reader;
private Properties bootstrapProperties;
+ private Properties modifyableBootstrapProperties;
private Properties systemBootstrapProperties;
private String bindAddress;
private InetAddress hostAddress;
@@ -137,6 +140,17 @@
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
+
+ // these properties will be used to identify the server in TCP based cluster setup.
+ String unicastMembers = bootstrapProperties.getProperty(CLUSTER_MEMBERS);
+ if (unicastMembers == null) {
+ unicastMembers = this.configurationName+"|"+this.hostAddress.getCanonicalHostName(); //$NON-NLS-1$
+ }
+ else {
+ unicastMembers = unicastMembers+","+this.configurationName+"|"+this.hostAddress.getCanonicalHostName(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ modifyableBootstrapProperties.setProperty(CLUSTER_MEMBERS, unicastMembers);
}
public boolean isAvailable() {
@@ -350,6 +364,7 @@
} catch (IOException e ) {
}
}
+ modifyableBootstrapProperties = bootstrapProps;
bootstrapProperties = new UnmodifiableProperties(bootstrapProps);
}
return bootstrapProperties;
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/ConfigurationObjectEditor.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -606,24 +606,6 @@
ComponentTypeDefn setPropertyDefinition(ComponentTypeDefn t, PropertyDefinition defn);
- /**
- * Call to set the specified configuration as the next startup configuration,
- * to use after a system reboot.
- * @param configurationID for the <code>Configuration</code> to use on the next system reboot.
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- * @deprecated as of v 2.0 beta 1, use {@link #setNextStartupConfiguration}
- */
- void setBootStrapConfiguration(ConfigurationID configurationID) throws ConfigurationException;
-
-
- /**
- * Sets the system next startup configuration
- * @param configurationID for the <code>Configuration</code> to use on the next system reboot.
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- */
- void setNextStartupConfiguration(ConfigurationID configurationID) throws ConfigurationException;
-
-
// ----------------------------------------------------------------------------------
// D E L E T E M E T H O D S
// ----------------------------------------------------------------------------------
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/VMComponentDefnType.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/VMComponentDefnType.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/VMComponentDefnType.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -36,6 +36,7 @@
/**
* @see SocketVMController
*/
+ public static final String CLUSTER_PORT = "vm.unicast.port"; //$NON-NLS-1$
public static final String SERVER_PORT = com.metamatrix.admin.api.objects.ProcessObject.SERVER_PORT;
public static final String MAX_THREADS = com.metamatrix.admin.api.objects.ProcessObject.MAX_THREADS;
public static final String TIMETOLIVE = com.metamatrix.admin.api.objects.ProcessObject.TIMETOLIVE;
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfigurationObjectEditor.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -2219,21 +2219,6 @@
}
/**
- * Sets the system next startup configuration
- * @deprecated as of v 2.0 beta 1, use {@link #setNextStartupConfiguration}
- */
- public void setBootStrapConfiguration(ConfigurationID configurationID) throws ConfigurationException {
- this.createExchangeAction(configurationID, ConfigurationModel.Attribute.NEXT_STARTUP_CONFIGURATION, configurationID, configurationID);
- }
-
- /**
- * Sets the system next startup configuration
- */
- public void setNextStartupConfiguration(ConfigurationID configurationID) throws ConfigurationException {
- this.createExchangeAction(configurationID, ConfigurationModel.Attribute.NEXT_STARTUP_CONFIGURATION, configurationID, configurationID);
- }
-
- /**
* Set the list of <code>ComponentTypeDefn</code>s for a local ComponentType
* object. This method will not generate actions because the definitions
* should have been created using the
Modified: trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml
===================================================================
--- trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/common-internal/src/main/resources/com/metamatrix/common/config/api/resourcetypemodel.xml 2009-05-05 19:09:01 UTC (rev 864)
@@ -42,14 +42,16 @@
<PropertyDefinition Name="metamatrix.xatxnmgr.txnstatus_port" DisplayName="Recovery Port" ShortDescription="Transaction Recovery Port (0-any available port)" DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="false"/>
</ComponentType>
<ComponentType Name="JGroups" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
- <PropertyDefinition Name="udp.multicast_supported" DisplayName="Multicast Supported" ShortDescription="Indicates if multicast supported." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="udp.mcast_messagebus_port" DisplayName="MessageBus Multicast Port" ShortDescription="The multicast port number." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="udp.mcast_addr" DisplayName="Multicast Address" ShortDescription="The multicast address." DefaultValue="224.30.10.10" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="ping.gossip_host" DisplayName="Ping Host Address" ShortDescription="The host address when multicast is not used." DefaultValue="" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="ping.gossip_port" DisplayName="Ping Host Port" ShortDescription="The host port when multicast is not used." DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="ping.gossip_refresh" DisplayName="Ping Gossip Refresh" ShortDescription="Indicates how often the gossip server tries to refresh." DefaultValue="15000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="ping.gossip_timout" DisplayName="Ping Gossip Timeout" ShortDescription="Indicates how soon the gossip server will timeout." DefaultValue="2000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
- <PropertyDefinition Name="ping.gossip_initialmembers" DisplayName="Ping Gossip Initial Num Mbrs" ShortDescription="Indicates the initial size of members to be joined." DefaultValue="3" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="cluster.protocol" DisplayName="Cluster Protocol Type" ShortDescription="Type of protocol to be used (Unicast or Multicast)" DefaultValue="UNICAST-TCP" Multiplicity="1" PropertyType="String" IsConstrainedToAllowedValues="true" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true">
+ <AllowedValue>MULTICAST</AllowedValue>
+ <AllowedValue>UNICAST_TCP</AllowedValue>
+ <AllowedValue>UNICAST_UDP</AllowedValue>
+ </PropertyDefinition>
+ <PropertyDefinition Name="cluster.port" DisplayName="Cluster Port" ShortDescription="The multicast or unicast port number" DefaultValue="5555" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="cluster.name" DisplayName="Cluster Name" ShortDescription="The Name of the cluster" Multiplicity="1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="cluster.multicast.address" DisplayName="Cluster Address (multicast)" ShortDescription="The multicast address" Multiplicity="1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="cluster.unicast.ping" DisplayName="Cluster Ping Intervel(unicast)" ShortDescription="Indicates how often the gossip server tries to refresh." DefaultValue="15000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
+ <PropertyDefinition Name="cluster.unicast.timout" DisplayName="Cluster Ping Timeout(unicast)" ShortDescription="Indicates how soon the gossip server will timeout." DefaultValue="2000" Multiplicity="0..1" PropertyType="Integer" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
<PropertyDefinition Name="jgroups.other.channel.settings" DisplayName="JGroups Other Settings" ShortDescription="This is the additional settings when creating the JGroups Channel." DefaultValue="MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):UNICAST(timeout=5000):pbcast.STABLE(desired_avg_gossip=20000):FRAG(frag_size=4096;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):pbcast.STATE_TRANSFER" Multiplicity="0..1" PropertyType="String" ValueDelimiter="," IsConstrainedToAllowedValues="true" IsExpert="false" IsHidden="false" IsMasked="false" IsModifiable="true" IsPreferred="true"/>
</ComponentType>
<ComponentType Name="SSL" ComponentTypeCode="4" Deployable="false" Deprecated="false" Monitorable="false">
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -447,8 +447,6 @@
throw new AdminComponentException(e);
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
}
}
@@ -634,8 +632,6 @@
throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
}
}
@@ -1050,8 +1046,6 @@
throw new AdminComponentException(e);
} catch(InvalidConfigurationElementException e) {
throw new AdminComponentException(e);
- } catch(ModificationException e) {
- throw new AdminComponentException(e);
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
} catch (ServiceException e) {
@@ -1522,8 +1516,6 @@
}
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
}
@@ -1550,8 +1542,6 @@
throw new AdminComponentException(e);
} catch (MetaMatrixProcessingException e) {
throw new AdminProcessingException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
}
break;
@@ -1575,8 +1565,6 @@
throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
}
break;
@@ -1855,8 +1843,6 @@
getConfigurationServiceProxy().delete(service, false, getUserName());
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
}
@@ -1871,8 +1857,6 @@
getConfigurationServiceProxy().delete(cb, false, getUserName());
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
}
@@ -1894,8 +1878,6 @@
getConfigurationServiceProxy().delete(ct, getUserName());
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
}
@@ -1941,8 +1923,6 @@
}
} catch (ConfigurationException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
} catch (ServiceException e) {
throw new AdminComponentException(e);
}
@@ -2019,8 +1999,6 @@
throw new AdminComponentException(e);
} catch (MetaMatrixProcessingException e) {
throw new AdminComponentException(e);
- } catch (ModificationException e) {
- throw new AdminComponentException(e);
}
}
Modified: trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -115,15 +115,11 @@
Set addedTypes = new HashSet(connectorTypes.size());
- ConfigurationModelContainer cmc =null;
-
Map reMapBinding = new HashMap(connectorBindings.size());
XMLConfigurationConnector writer = getWriter();
BasicConfigurationObjectEditor editor = new BasicConfigurationObjectEditor(true);
- if (cmc == null) {
- cmc = CurrentConfiguration.getInstance().getConfigurationModel();
- }
+ ConfigurationModelContainer cmc = CurrentConfiguration.getInstance().getConfigurationModel();
for (Iterator it= connectorBindings.values().iterator(); it.hasNext(); ) {
ConnectorBinding cb = (ConnectorBinding) it.next();
Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -467,11 +467,7 @@
// Config svc proxy
ConfigurationServiceInterface configAdmin = PlatformProxyHelper.getConfigurationServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL);
// First set the log config in the database
- try {
- configAdmin.executeTransaction(actions, principalName);
- } catch (ModificationException e) {
- throw new MetaMatrixComponentException(e, ErrorMessageKeys.ADMIN_0084, PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0084, config.getID()));
- }
+ configAdmin.executeTransaction(actions, principalName);
// Then, if the operational (current) config is effected, set logging config for
// LogManager in each VM.
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/api/service/ConfigurationServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/api/service/ConfigurationServiceInterface.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/api/service/ConfigurationServiceInterface.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -29,7 +29,6 @@
import java.util.Set;
import com.metamatrix.common.actions.ActionDefinition;
-import com.metamatrix.common.actions.ModificationException;
import com.metamatrix.common.config.api.ComponentDefn;
import com.metamatrix.common.config.api.ComponentDefnID;
import com.metamatrix.common.config.api.ComponentObject;
@@ -114,7 +113,7 @@
* if the name of the configuration model to obtain
* @return ConfigurationModelContainer
*/
- ConfigurationModelContainer getConfigurationModel(String configName) throws InvalidConfigurationException, ConfigurationException;
+ ConfigurationModelContainer getConfigurationModel(String configName) throws ConfigurationException;
/**
* <p>
@@ -282,15 +281,13 @@
* @param principalName
* of the person executing the transaction
* @return the set of objects that were affected by this transaction.
- * @throws ModificationException
- * if the target of the action is invalid, or if the target object is not a supported class of targets.
* @throws IllegalArgumentException
* if the action is null or if the result specification is invalid
* @throws ConfigurationException
* if an error occurred within or during communication with the Configuration Service.
*/
Set executeTransaction(ActionDefinition action, String principalName )
- throws ModificationException, ConfigurationException;
+ throws ConfigurationException;
/**
* Execute a list of actions, and optionally return the set of objects or object IDs that were affected/modified by the
@@ -301,15 +298,13 @@
* @param principalName
* of the person executing the transaction
* @return the set of objects that were affected by this transaction.
- * @throws ModificationException
- * if the target of any of the actions is invalid, or if the target object is not a supported class of targets.
* @throws IllegalArgumentException
* if the action is null or if the result specification is invalid
* @throws ConfigurationException
* if an error occurred within or during communication with the Configuration Service.
*/
Set executeTransaction(List actions, String principalName)
- throws ModificationException, ConfigurationException;
+ throws ConfigurationException;
/**
@@ -401,13 +396,12 @@
* @param theProperties
* @param principalName
* @return
- * @throws ModificationException
* @throws Exception
* @since 4.3
*/
public Object modify(ComponentObject theObject,
Properties theProperties,
- String principalName) throws ConfigurationException, ModificationException;
+ String principalName) throws ConfigurationException;
/**
@@ -453,11 +447,10 @@
* @param principalName
* User Name of user who is making the change
* @throws ConfigurationException
- * @throws ModificationException
* @since 4.3
*/
public void delete(ComponentObject theObject, boolean theDeleteDependenciesFlag,String principalName)
- throws ConfigurationException, ModificationException;
+ throws ConfigurationException;
/**
* Delete a Component Type
@@ -465,11 +458,10 @@
* @param componentType Component Type Object being deleted
* @param principalName User Name who is making the change
* @throws ConfigurationException
- * @throws ModificationException
* @since 4.3
*/
public void delete(ComponentType componentType, String principalName)
- throws ConfigurationException,ModificationException;
+ throws ConfigurationException;
/**
@@ -483,13 +475,12 @@
* @return DeployedComponent of the ServiceComponentDefns that was deployed
*
* @throws ConfigurationException
- * @throws ModificationException
* @since 6.1
*/
public DeployedComponent deployService(VMComponentDefnID theProcessID,
String serviceName,
- String principalName) throws ConfigurationException,ModificationException;
+ String principalName) throws ConfigurationException;
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/service/ConfigurationServiceImpl.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -39,7 +39,6 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.security.AuthorizationException;
import com.metamatrix.common.actions.ActionDefinition;
-import com.metamatrix.common.actions.ModificationException;
import com.metamatrix.common.config.api.ComponentDefn;
import com.metamatrix.common.config.api.ComponentDefnID;
import com.metamatrix.common.config.api.ComponentObject;
@@ -62,15 +61,18 @@
import com.metamatrix.common.config.api.exceptions.InvalidConfigurationException;
import com.metamatrix.common.config.model.BasicConfigurationObjectEditor;
import com.metamatrix.common.config.model.ComponentCryptoUtil;
+import com.metamatrix.common.config.model.ConfigurationModelContainerImpl;
import com.metamatrix.common.config.xml.XMLConfigurationImportExportUtility;
-import com.metamatrix.common.log.I18nLogManager;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.util.LogCommonConstants;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.platform.PlatformPlugin;
+import com.metamatrix.platform.config.ConfigMessages;
+import com.metamatrix.platform.config.ConfigPlugin;
import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
import com.metamatrix.platform.config.spi.xml.XMLConfigurationConnector;
import com.metamatrix.platform.config.spi.xml.XMLConfigurationMgr;
+import com.metamatrix.platform.service.ServicePlugin;
import com.metamatrix.platform.service.api.exception.ServiceException;
import com.metamatrix.platform.service.controller.AbstractService;
import com.metamatrix.platform.util.ErrorMessageKeys;
@@ -103,7 +105,7 @@
* Perform initialization and commence processing. This method is called only once.
*/
protected void initService(Properties env) throws Exception {
- I18nLogManager.logInfo(CONTEXT, LogMessageKeys.CONFIG_0002, new Object[] { getInstanceName()});
+ LogManager.logInfo(CONTEXT, ServicePlugin.Util.getString(LogMessageKeys.CONFIG_0002, new Object[] { getInstanceName()}));
}
/**
@@ -143,7 +145,7 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public ConfigurationID getCurrentConfigurationID() throws ConfigurationException {
- return this.getDesignatedConfigurationID(Configuration.NEXT_STARTUP);
+ return Configuration.NEXT_STARTUP_ID;
}
/**
@@ -153,7 +155,7 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public ConfigurationID getNextStartupConfigurationID() throws ConfigurationException {
- return this.getDesignatedConfigurationID(Configuration.NEXT_STARTUP);
+ return Configuration.NEXT_STARTUP_ID;
}
/**
@@ -163,7 +165,7 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public Configuration getCurrentConfiguration() throws ConfigurationException {
- return this.getDesignatedConfiguration(Configuration.NEXT_STARTUP);
+ return this.getDesignatedConfiguration();
}
/**
@@ -173,58 +175,17 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public Configuration getNextStartupConfiguration() throws ConfigurationException{
- return this.getDesignatedConfiguration(Configuration.NEXT_STARTUP);
+ return this.getDesignatedConfiguration();
}
- private Configuration getDesignatedConfiguration(String designation) throws ConfigurationException {
- // Look in the cache ...
- Configuration config = null;
-
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
- config = transaction.getDesignatedConfiguration(designation);
-
- if (config != null) {
- LogManager.logDetail(CONTEXT, "Found " + designation + " configuration " + config.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- throw new ConfigurationException("No " + designation + " configuration was found"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- return config;
+ private Configuration getDesignatedConfiguration() throws ConfigurationException {
+ XMLConfigurationConnector transaction = getConnection(null);
+ return transaction.getConfigurationModel().getConfiguration();
}
- private ConfigurationID getDesignatedConfigurationID(String designation) throws ConfigurationException {
- ConfigurationID configID = null;
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
- configID = transaction.getDesignatedConfigurationID(designation);
-
- if (configID != null) {
- LogManager.logTrace(CONTEXT, "Found " + designation + " configuration id " + configID); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- throw new ConfigurationException(ErrorMessageKeys.CONFIG_0042, PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0042));
- }
- return configID;
- }
-
- public ConfigurationModelContainer getConfigurationModel(String configName) throws InvalidConfigurationException, ConfigurationException {
- // Look in the cache ...
- ConfigurationModelContainer config = null;
-
- XMLConfigurationConnector transaction = null;
- try {
- transaction = getConnection(null);
- config = transaction.getConfigurationModel(configName);
-
- if (config == null) {
- LogManager.logTrace(CONTEXT, "No configuration model found"); //$NON-NLS-1$
- }
-
- }catch ( Exception e ) {
- throw new ConfigurationException(e,ErrorMessageKeys.CONFIG_0043, PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0043));
- }
- return config;
-
+ public ConfigurationModelContainer getConfigurationModel(String configName) throws ConfigurationException {
+ XMLConfigurationConnector transaction = getConnection(null);
+ return transaction.getConfigurationModel();
}
/**
@@ -276,18 +237,7 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public Collection getConfigurationAndDependents(ConfigurationID configID) throws ConfigurationException {
- if ( configID == null) {
- throw new IllegalArgumentException(PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0045, "configID")); //$NON-NLS-1$
- }
-
- // Look in the cache ...
- Collection result = null;
-
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
- result = transaction.getAllObjectsForConfigurationModel(configID);
-
- return result;
+ return getReadOnlyConfigurationModel().getAllObjects();
}
public ComponentType getComponentType(ComponentTypeID id) throws ConfigurationException {
@@ -295,80 +245,71 @@
throw new IllegalArgumentException(PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0045, "id")); //$NON-NLS-1$
}
- ComponentType type = null;
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
- type = transaction.getComponentType(id);
-
- if (type != null) {
- LogManager.logDetail(CONTEXT, "Found component type " + id); //$NON-NLS-1$
- } else {
- LogManager.logDetail(CONTEXT, "No component type found for " + id); //$NON-NLS-1$
- }
- return type;
-
+ ComponentType type = getReadOnlyConfigurationModel().getComponentType(id.getFullName());
+ if (type != null) {
+ LogManager.logDetail(CONTEXT, "Found component type " + id); //$NON-NLS-1$
+ } else {
+ LogManager.logDetail(CONTEXT, "No component type found for " + id); //$NON-NLS-1$
+ }
+ return type;
}
public Collection getAllComponentTypes(boolean includeDeprecated) throws ConfigurationException {
- XMLConfigurationConnector transaction = null;
- Collection result = new LinkedList();
- transaction = getConnection(null);
- result = transaction.getAllComponentTypes(includeDeprecated);
+ XMLConfigurationConnector transaction = getConnection(null);
+ Map types = transaction.getConfigurationModel().getComponentTypes();
+ Collection result = new LinkedList(types.values());
- if (result != null && result.size() > 0) {
- LogManager.logDetail(CONTEXT, "Found all component types"); //$NON-NLS-1$
+ if (result.size() > 0) {
+ LogManager.logDetail(CONTEXT, "Found all component types"); //$NON-NLS-1$
- } else {
- throw new ConfigurationException(ErrorMessageKeys.CONFIG_0049, PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0049));
- }
- return result;
+ } else {
+ throw new ConfigurationException(ErrorMessageKeys.CONFIG_0049,PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0049));
+ }
+ return result;
}
public Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID) throws ConfigurationException {
- XMLConfigurationConnector transaction = null;
- Collection result=null;
- transaction = getConnection(null);
- result = transaction.getComponentTypeDefinitions(componentTypeID);
+ Collection result = getComponentTypeDefinitions(getReadOnlyConfigurationModel(), componentTypeID);
- if (result != null && result.size() > 0) {
- LogManager.logDetail(CONTEXT, new Object[] {"Found component type definitions for ", componentTypeID} ); //$NON-NLS-1$
+ if (result != null && result.size() > 0) {
+ LogManager.logDetail(CONTEXT, new Object[] {"Found component type definitions for ", componentTypeID} ); //$NON-NLS-1$
- } else {
- LogManager.logTrace(CONTEXT, new Object[] {"Couldn't find component type definitions for ", componentTypeID} ); //$NON-NLS-1$
- }
+ } else {
+ LogManager.logTrace(CONTEXT, new Object[] {"Couldn't find component type definitions for ", componentTypeID} ); //$NON-NLS-1$
+ }
if (result == null) {
result = new ArrayList(1);
}
-
return result;
-
}
+ public Collection getComponentTypeDefinitions(ConfigurationModelContainer config, ComponentTypeID componentTypeID) {
+ ComponentType t = config.getComponentType(componentTypeID.getFullName());
+ if (t!= null) {
+ return t.getComponentTypeDefinitions();
+ }
+ return Collections.EMPTY_LIST;
+ }
private Collection getDependentComponentTypeDefinitions(ComponentTypeID componentTypeID) throws ConfigurationException {
- XMLConfigurationConnector transaction = getConnection(null);
- Collection defns = getDependentComponentTypeDefinitions(transaction, componentTypeID);
+ Collection defns = getDependentComponentTypeDefinitions(getReadOnlyConfigurationModel(), componentTypeID);
return defns;
}
- private Collection getDependentComponentTypeDefinitions(XMLConfigurationConnector transaction, ComponentTypeID componentTypeID) throws ConfigurationException {
+ private Collection getDependentComponentTypeDefinitions(ConfigurationModelContainer config, ComponentTypeID componentTypeID) throws ConfigurationException {
- Collection result=null;
+ Collection types = new ArrayList(config.getComponentTypes().values());
- Collection types = transaction.getAllComponentTypes(false);
+ Collection result= getSuperComponentTypeDefinitions(null, null, types, componentTypeID, config);
- result = getSuperComponentTypeDefinitions(null, null, types, componentTypeID, transaction);
-
if (result != null && result.size() > 0) {
LogManager.logDetail(CONTEXT, new Object[] {"Found dependent component type definitions for ", componentTypeID} ); //$NON-NLS-1$
} else {
result = new ArrayList(1);
}
-
return result;
-
}
/**
@@ -391,7 +332,7 @@
private Collection getSuperComponentTypeDefinitions(Map defnMap, Collection defns,
Collection componentTypes,
ComponentTypeID componentTypeID,
- XMLConfigurationConnector transaction) throws ConfigurationException {
+ ConfigurationModelContainer config) throws ConfigurationException {
if (defnMap == null) {
defnMap = new HashMap();
}
@@ -415,13 +356,10 @@
return defns;
}
- Collection superDefns = transaction.getComponentTypeDefinitions(type.getSuperComponentTypeID());
- // add the defns not already defined to the map
-// BaseID id;
+ Collection superDefns = getComponentTypeDefinitions(config, type.getSuperComponentTypeID());
ComponentTypeDefn sDefn;
if (superDefns != null && superDefns.size() > 0) {
Iterator it = superDefns.iterator();
-// ComponentTypeDefn cdefn = null;
while (it.hasNext()) {
sDefn = (ComponentTypeDefn) it.next();
//this map has been changed to be keyed
@@ -434,7 +372,7 @@
}
}
- return getSuperComponentTypeDefinitions(defnMap, defns, componentTypes, type.getSuperComponentTypeID(), transaction);
+ return getSuperComponentTypeDefinitions(defnMap, defns, componentTypes, type.getSuperComponentTypeID(), config);
}
public Collection getAllComponentTypeDefinitions(ComponentTypeID typeID) throws ConfigurationException {
@@ -499,16 +437,11 @@
public Collection getHosts() throws ConfigurationException {
- Collection hosts = null;
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
- hosts = transaction.getHosts();
-
- if (hosts == null) {
- hosts = Collections.EMPTY_LIST;
- }
-
- return hosts;
+ Collection hosts = getReadOnlyConfigurationModel().getConfiguration().getHosts();
+ if (hosts == null) {
+ hosts = Collections.EMPTY_LIST;
+ }
+ return hosts;
}
@@ -520,16 +453,11 @@
* @return ComponentDefn
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
- public ComponentDefn getComponentDefn(ConfigurationID configurationID, ComponentDefnID componentDefnID)
- throws ConfigurationException{
- XMLConfigurationConnector transaction = null;
- ComponentDefn defn = null;
- transaction = getConnection(null);
-
- defn = transaction.getComponentDefinition(componentDefnID, configurationID);
-
- return defn;
-
+ public ComponentDefn getComponentDefn(ConfigurationID configurationID, ComponentDefnID componentDefnID) throws ConfigurationException{
+ if (componentDefnID == null) {
+ throw new ConfigurationException(ConfigMessages.CONFIG_0045,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0045,"ComponentDefnID")); //$NON-NLS-1$
+ }
+ return getReadOnlyConfigurationModel().getConfiguration().getComponentDefn(componentDefnID);
}
/**
@@ -541,12 +469,8 @@
* @throws InvalidSessionException if the <code>callerSessionID</code> is not valid or is expired.
* @throws MetaMatrixComponentException if an error occurred in communicating with a component.
*/
- public Collection getResources()
- throws ConfigurationException{
- XMLConfigurationConnector transaction = null;
- transaction = getConnection(null);
-
- return transaction.getResources();
+ public Collection getResources() throws ConfigurationException{
+ return getReadOnlyConfigurationModel().getResources();
}
/**
@@ -558,9 +482,9 @@
* @throws MetaMatrixComponentException if an error occurred in communicating with a component.
*/
public void saveResources(Collection resourceDescriptors, String principalName)
- throws ConfigurationException {
- XMLConfigurationConnector transaction = null;
- transaction = this.getConnection(principalName);
+ throws ConfigurationException {
+
+ XMLConfigurationConnector transaction = this.getConnection(principalName);
transaction.saveResources(resourceDescriptors, principalName);
@@ -578,15 +502,13 @@
* the repository.
* @param principalName of the person executing the transaction
* @return the set of objects that were affected by this transaction.
- * @throws ModificationException if the target of the action is invalid, or
- * if the target object is not a supported class of targets.
* @throws IllegalArgumentException if the action is null
* or if the result specification is invalid
* @throws ConfigurationException if an error occurred within or during
* communication with the Configuration Service.
*/
public Set executeTransaction(ActionDefinition action, String principalName)
- throws ModificationException, ConfigurationException{
+ throws ConfigurationException{
if ( action == null ) {
throw new IllegalArgumentException(PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0045, "action")); //$NON-NLS-1$
}
@@ -602,14 +524,12 @@
* the repository.
* @param principalName of the person executing the transaction
* @return the set of objects that were affected by this transaction.
- * @throws ModificationException if the target of any of the actions is invalid, or
- * if the target object is not a supported class of targets.
* @throws IllegalArgumentException if the action is null
* or if the result specification is invalid
* @throws ConfigurationException if an error occurred within or during
* communication with the Configuration Service.
*/
- public Set executeTransaction(List actions, String principalName) throws ModificationException, ConfigurationException {
+ public Set executeTransaction(List actions, String principalName) throws ConfigurationException {
if ( actions == null ) {
throw new IllegalArgumentException(PlatformPlugin.Util.getString(ErrorMessageKeys.CONFIG_0045, "actions")); //$NON-NLS-1$
}
@@ -619,24 +539,12 @@
return result;
}
- XMLConfigurationConnector transaction = null;
-
-
- // Iterate through the actions, and apply all as a single transaction
- try {
- transaction = this.getConnection(principalName);
- result = transaction.executeActions(actions);
- transaction.commit(); // commit the transaction
- } catch ( ConfigurationException e ) {
- throw e;
- } catch ( Exception e ) {
- throw new ConfigurationException(e);
- }
+ XMLConfigurationConnector transaction = this.getConnection(principalName);
+ result = transaction.executeActions(actions);
+ transaction.commit(); // commit the transaction
return result;
}
-
-
protected void addProperty(Properties source, String sourceName, Properties props, String propName) {
String value = source.getProperty(sourceName);
if (value != null) {
@@ -654,15 +562,17 @@
protected XMLConfigurationConnector getConnection(String principal) throws ConfigurationException {
return XMLConfigurationMgr.getInstance().getTransaction(principal==null?this.getInstanceName():principal);
}
+
+ private ConfigurationModelContainerImpl getReadOnlyConfigurationModel() throws ConfigurationException {
+ return XMLConfigurationMgr.getInstance().getConfigurationModel(Configuration.NEXT_STARTUP_ID);
+ }
/**
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#addHost(java.lang.String,
* java.util.Properties)
* @since 4.3
*/
- public Host addHost(String hostName,
- String principalName,
- Properties properties) throws ConfigurationException {
+ public Host addHost(String hostName, String principalName, Properties properties) throws ConfigurationException {
com.metamatrix.common.config.api.Host host = null;
ConfigurationObjectEditor editor = null;
@@ -677,16 +587,12 @@
host = editor.createHost(hostName);
- host = (com.metamatrix.common.config.api.Host)editor
- .modifyProperties(host, allProps, ConfigurationObjectEditor.SET);
+ host = (com.metamatrix.common.config.api.Host)editor.modifyProperties(host, allProps, ConfigurationObjectEditor.SET);
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
//final Object[] params = new Object[] {this.getClass().getName(), theException.getMessage()};
final Object[] params = new Object[] {
hostName
@@ -746,10 +652,7 @@
}
} catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
final Object[] params = new Object[] {
processName, hostName
};
@@ -781,9 +684,7 @@
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
final Object[] params = new Object[] {
propertyName, theException.getMessage()
};
@@ -819,9 +720,7 @@
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
final Object[] params = new Object[] {
theException.getMessage(), properties
};
@@ -858,20 +757,15 @@
editor = createEditor();
config = getNextStartupConfiguration();
- /* ServiceComponentDefn scd = */
-// editor.createServiceComponentDefn((ConfigurationID)config.getID(),
-// (ComponentTypeID)ctConnector.getID(),
-// connectorBindingName);
-
binding = createConnectorBinding(ctConnector, editor, connectorBindingName);
binding = (ConnectorBinding)editor.modifyProperties(binding, properties, ConfigurationObjectEditor.SET);
if (vmName != null) {
- if (vmName.equalsIgnoreCase("all")) {
+ if (vmName.equalsIgnoreCase("all")) { //$NON-NLS-1$
Collection<VMComponentDefn> vms = config.getVMComponentDefns();
for (Iterator<VMComponentDefn> it=vms.iterator(); it.hasNext();) {
- VMComponentDefn vm = (VMComponentDefn) it.next();
+ VMComponentDefn vm = it.next();
DeployedComponent dc = this.deployeServiceDefnToVM( (VMComponentDefnID)vm.getID(), connectorBindingName, editor, principalName);
}
@@ -879,41 +773,24 @@
} else {
// TODO: the method from serveradminapi passes in "ALL" and its not currently
// called from anywhere else
-
}
}
-// if (pscName != null && !pscName.equals("")) { //$NON-NLS-1$
-// ProductServiceConfig psc = this.getPSCByName(config, pscName);
-// ServiceComponentDefnID bindingID = (ServiceComponentDefnID)binding.getID();
-// editor.addServiceComponentDefn(psc, bindingID);
-//
-// editor.deployServiceDefn(config, binding, (ProductServiceConfigID)psc.getID());
-// }
-
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
final Object[] params = new Object[] {
this.getClass().getName(), theException.getMessage()
};
- throw new ConfigurationException(theException,
- PlatformPlugin.Util.getString("ConfigurationServiceImpl.Error_creating_Connector_Binding", params)); //$NON-NLS-1$
+ throw new ConfigurationException(theException,PlatformPlugin.Util.getString("ConfigurationServiceImpl.Error_creating_Connector_Binding", params)); //$NON-NLS-1$
}
return binding;
}
- private ComponentType getComponentType(String connectorName,
- boolean deprecated) throws InvalidSessionException,
- AuthorizationException,
- ConfigurationException,
- MetaMatrixComponentException {
+ private ComponentType getComponentType(String connectorName, boolean deprecated) throws ConfigurationException {
Collection arylConnectors = getAllComponentTypes(deprecated);
Iterator itConnectors = arylConnectors.iterator();
while (itConnectors.hasNext()) {
@@ -925,47 +802,26 @@
return null;
}
-// private ProductServiceConfig getPSCByName(Configuration config,
-// String pscName) throws InvalidArgumentException {
-// ProductServiceConfig result = null;
-// if (config != null) {
-// ProductServiceConfigID pscID = new ProductServiceConfigID(((ConfigurationID)config.getID()), pscName);
-// result = config.getPSC(pscID);
-// }
-// return result;
-// }
-
- private ConnectorBinding createConnectorBinding(ComponentType ctConnector,
- ConfigurationObjectEditor coe,
- String sConnBindName) throws Exception {
- ConnectorBinding connectorBinding = coe.createConnectorComponent(Configuration.NEXT_STARTUP_ID, (ComponentTypeID)ctConnector.getID(),
- sConnBindName,
- null);
+ private ConnectorBinding createConnectorBinding(ComponentType ctConnector, ConfigurationObjectEditor coe, String sConnBindName) {
+ ConnectorBinding connectorBinding = coe.createConnectorComponent(Configuration.NEXT_STARTUP_ID, (ComponentTypeID)ctConnector.getID(),sConnBindName,null);
return connectorBinding;
}
- public Object modify(ComponentObject theObject,
- Properties theProperties,
- String principalName) throws ModificationException, ConfigurationException{
+ public Object modify(ComponentObject theObject,Properties theProperties, String principalName) throws ConfigurationException{
ConfigurationObjectEditor editor = null;
try {
editor = createEditor();
Object obj = editor.modifyProperties(theObject, theProperties, ConfigurationObjectEditor.SET);
executeTransaction(editor.getDestination().popActions(), principalName);
return obj;
- } catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- throw new ConfigurationException(theException);
+ } catch (ConfigurationException e) {
+ clearActions(editor);
+ throw e;
}
}
- public ComponentType importConnectorType(InputStream inputStream,
- String name,
- String principalName) throws ConfigurationException {
+ public ComponentType importConnectorType(InputStream inputStream, String name, String principalName) throws ConfigurationException {
ComponentType newType = null;
ConfigurationObjectEditor editor = createEditor();
@@ -976,14 +832,8 @@
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- final Object[] params = new Object[] {
- name, theException.getMessage()
- };
- final String msg = PlatformPlugin.Util.getString("ConfigurationServiceImpl.Error_importing_connector_type", params); //$NON-NLS-1$
+ clearActions(editor);
+ final String msg = PlatformPlugin.Util.getString("ConfigurationServiceImpl.Error_importing_connector_type", new Object[] {name, theException.getMessage()}); //$NON-NLS-1$
throw new ConfigurationException(theException, msg);
}
@@ -1025,20 +875,14 @@
for (Iterator<VMComponentDefn> it=vms.iterator(); it.hasNext();) {
VMComponentDefn vm = it.next();
editor.deployServiceDefn(config, newBinding, (VMComponentDefnID) vm.getID() );
-
}
}
-
-
}
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (Exception theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
final Object[] params = new Object[] {
name, theException.getMessage()
};
@@ -1047,18 +891,15 @@
}
return newBinding;
-
-
}
/**
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#delete(com.metamatrix.common.config.api.ComponentObject, boolean)
* @since 4.3
*/
- public void delete(ComponentObject theObject,
- boolean theDeleteDependenciesFlag,
- String principalName) throws ConfigurationException,
- ModificationException {
+ public void delete(ComponentObject theObject, boolean theDeleteDependenciesFlag, String principalName)
+ throws ConfigurationException {
+
ConfigurationObjectEditor editor = null;
try {
@@ -1072,47 +913,37 @@
if (editor.getDestination().getActionCount() != 0) {
executeTransaction(editor.getDestination().popActions(),principalName);
}
- } catch (ConfigurationException theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- throw theException;
- } catch (ServiceException err) {
-// rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- throw err;
- } catch (ModificationException mex) {
-// rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- throw mex;
- }
+ } catch (ConfigurationException e) {
+ clearActions(editor);
+ throw e;
+ } catch (ServiceException e) {
+ clearActions(editor);
+ throw e;
+ }
}
+ private void clearActions(ConfigurationObjectEditor editor) {
+ if (editor != null) {
+ editor.getDestination().popActions();
+ }
+ }
+
/**
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#delete(com.metamatrix.common.config.api.ComponentType, java.lang.String)
* @since 4.3
*/
- public void delete(ComponentType componentType,
- String principalName) throws ConfigurationException,
- ModificationException {
+ public void delete(ComponentType componentType, String principalName)
+ throws ConfigurationException {
ConfigurationObjectEditor editor = null;
- try {
- editor = createEditor();
- editor.delete(componentType);
- executeTransaction(editor.getDestination().popActions(),principalName);
- } catch (ConfigurationException theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
- throw theException;
- }
+ try {
+ editor = createEditor();
+ editor.delete(componentType);
+ executeTransaction(editor.getDestination().popActions(),principalName);
+ } catch (ConfigurationException e) {
+ clearActions(editor);
+ throw e;
+ }
}
/**
@@ -1127,13 +958,10 @@
* @return DeployedComponent of the ServiceComponentDefns that was deployed
*
* @throws ConfigurationException
- * @throws ModificationException
* @since 6.1
*/
- public DeployedComponent deployService(VMComponentDefnID theProcessID,
- String serviceName,
- String principalName) throws ConfigurationException,ModificationException {
+ public DeployedComponent deployService(VMComponentDefnID theProcessID, String serviceName, String principalName) throws ConfigurationException {
DeployedComponent deployComponent = null;
@@ -1144,10 +972,7 @@
deployComponent = deployeServiceDefnToVM(theProcessID, serviceName, editor, principalName);
executeTransaction(editor.getDestination().popActions(), principalName);
} catch (ConfigurationException theException) {
- // rollback
- if (editor != null) {
- editor.getDestination().popActions();
- }
+ clearActions(editor);
throw theException;
}
return deployComponent;
@@ -1156,7 +981,7 @@
private DeployedComponent deployeServiceDefnToVM(VMComponentDefnID theProcessID,
String serviceName,
ConfigurationObjectEditor editor,
- String principalName) throws ConfigurationException,ModificationException {
+ String principalName) throws ConfigurationException {
DeployedComponent deployComponent = null;
Deleted: trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/ConfigTransactionException.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -1,72 +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.platform.config.spi.xml;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import com.metamatrix.common.config.api.exceptions.ConfigurationException;
-
-/**
- * TransactionException exception indicates that the request cannot be
- * executed because of an error with the transaction.
- */
-
-public class ConfigTransactionException extends ConfigurationException {
-
- /**
- * Construct an instance with the message and error code specified.
- *
- * @param message A message describing the exception
- * @param code The error code
- */
- public ConfigTransactionException( String code, String message ) {
- super( code, message );
- }
-
- /**
- * Construct an instance from a message and an exception to chain to this one.
- *
- * @param code A code denoting the exception
- * @param e An exception to nest within this one
- */
- public ConfigTransactionException( Exception e, String message ) {
- super( e, message );
- }
-
- /**
- * Construct an instance from a message and a code and an exception to
- * chain to this one.
- *
- * @param e An exception to nest within this one
- * @param message A message describing the exception
- * @param code A code denoting the exception
- */
- public ConfigTransactionException( Exception e, String code, String message ) {
- super( e, code, message );
- }
-
-} // END CLASS
-
-
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLActionUpdateStrategy.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLActionUpdateStrategy.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLActionUpdateStrategy.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -22,7 +22,6 @@
package com.metamatrix.platform.config.spi.xml;
-
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashSet;
@@ -99,233 +98,94 @@
import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
import com.metamatrix.platform.security.audit.AuditManager;
+public class XMLActionUpdateStrategy {
-public class XMLActionUpdateStrategy {
+ public PropertyValidations validateProperty = new PropertyValidations();
+ public XMLActionUpdateStrategy() {
+ }
- public PropertyValidations validateProperty = new PropertyValidations();
+ Set executeActionsOnTarget(Object target, List actions, ConfigurationModelContainerImpl config, String principal, XMLConfigurationConnector transaction) throws ConfigurationException {
-
- public XMLActionUpdateStrategy() {
- }
-
-
- public Set executeActionsOnTarget(Object target, List actions, XMLConfigurationConnector transaction )
- throws ConfigTransactionException, ConfigurationException {
- // System.out.println("STRATEGY: Start Execute on Target " + target + " of type " + target.getClass().getName());
-
-
Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- return affectedIDs;
- }
+ /**
+ * Certain object types, when changed, require that both the NextStartup
+ * and Operational Configurations be changed. Those object types are not
+ * considered to be bound by a configuration, all the other types are.
+ * The following are the 2 different categories:
+ *
+ * Unbound by Configuration: - Host - ComponentType/ComponentTypeDefn -
+ * ResourcePool (ResourceDescriptor) - Resource (ResourceDescriptor) -
+ * Connector Bindings (ComponentDefn/DeployedComponent of
+ * ConnectorBindingType)
+ *
+ * Bound by Configuration - Configuration -
+ * ServiceComponentDefn(ComponentDefn)/DeployedComponent -
+ * VMComponentDefn(ComponentDefn)/DeployedComponent - PSC
+ */
- ConfigurationModelContainerImpl model = null;
-
-/**
- * Certain object types, when changed, require that both the
- * NextStartup and Operational Configurations be changed. Those
- * object types are not considered to be bound by a configuration,
- * all the other types are. The following are the 2 different
- * categories:
- *
- * Unbound by Configuration:
- * - Host
- * - ComponentType/ComponentTypeDefn
- * - ResourcePool (ResourceDescriptor)
- * - Resource (ResourceDescriptor)
- * - Connector Bindings (ComponentDefn/DeployedComponent of ConnectorBindingType)
- *
- * Bound by Configuration
- * - Configuration
- * - ServiceComponentDefn(ComponentDefn)/DeployedComponent
- * - VMComponentDefn(ComponentDefn)/DeployedComponent
- * - PSC
- */
-
- if ( target instanceof ConfigurationID ) {
- ConfigurationID id = (ConfigurationID) target;
-
-
- executeActions(id, actions, transaction);
-
-
- } else if (target instanceof HostID) {
- HostID id = (HostID) target;
- // apply changes to all configurations
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
-// System.out.println("STRATEGY: Update Config " + m.getConfigurationID());
-
- executeActions(m, id, actions, transaction);
- }
-
- } else if (target instanceof SharedResourceID) {
- SharedResourceID id = (SharedResourceID) target;
- // apply changes to all configurations
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
-// System.out.println("STRATEGY: Update Config " + m.getConfigurationID());
-
- executeActions(m, id, actions, transaction);
- }
-
- } else if (target instanceof AuthenticationProviderID) {
- AuthenticationProviderID id = (AuthenticationProviderID) target;
-
- Collection trans = transaction.getObjects();
-
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
-
- executeActions(m, id, actions, transaction);
-
- }
-
- } else if (target instanceof ComponentTypeID) {
- ComponentTypeID id = (ComponentTypeID) target;
- Collection trans = transaction.getObjects();
- // apply changes to all configurations
-
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
- executeActions(m, id, actions, transaction);
- }
-
- } else if (target instanceof ComponentTypeDefnID) {
- ComponentTypeDefnID id = (ComponentTypeDefnID) target;
- Collection trans = transaction.getObjects();
-
- // apply changes to all configurations
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
- executeActions(m, id, actions, transaction);
- }
-
- } else if (target instanceof ConnectorBindingID) {
- ConnectorBindingID id = (ConnectorBindingID) target;
- Collection trans = transaction.getObjects();
-// System.out.println("STRATEGY: Update Connector " + target);
-
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
- executeActions(m, id, actions, transaction);
- }
-
-
-
- } else if (target instanceof DeployedComponentID) {
- DeployedComponentID id = (DeployedComponentID) target;
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
- executeActions(m, id, actions, transaction);
- }
-
-
- } else if (target instanceof VMComponentDefnID) {
- VMComponentDefnID id = (VMComponentDefnID) target;
-
-// System.out.println("STRATEGY: Update ComponentDefn " + id);
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
-
-// System.out.println("STRATEGY: Execute Update ComponentDefn " + id);
-
- executeActions(m, id, actions, transaction);
- }
-
-
- } else if (target instanceof ServiceComponentDefnID) {
- ServiceComponentDefnID id = (ServiceComponentDefnID) target;
-
-// System.out.println("STRATEGY: Update SvcComponentDefn " + id);
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
- executeActions( m, id, actions, transaction);
-
- }
-
-
- } else if (target instanceof PropDefnAllowedValueID) {
- PropDefnAllowedValueID id = (PropDefnAllowedValueID) target;
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- model = (ConfigurationModelContainerImpl) it.next();
-
- // deployed comps are not necessarily applied to all configs
-// if (doesCompChangeApply(id, model)) {
- executeActions(model, id, actions, transaction);
-// }
- }
-
- } else {
- throw new ConfigTransactionException(ConfigMessages.CONFIG_0071, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0071, target));
- }
-
-
-// System.out.println("STRATEGY: End Update Target " + target);
-
+ if (target instanceof ConfigurationID) {
+ ConfigurationID id = (ConfigurationID) target;
+ executeActions(id, actions, config, principal, transaction);
+ } else if (target instanceof HostID) {
+ HostID id = (HostID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof SharedResourceID) {
+ SharedResourceID id = (SharedResourceID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof AuthenticationProviderID) {
+ AuthenticationProviderID id = (AuthenticationProviderID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof ComponentTypeID) {
+ ComponentTypeID id = (ComponentTypeID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof ComponentTypeDefnID) {
+ ComponentTypeDefnID id = (ComponentTypeDefnID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof ConnectorBindingID) {
+ ConnectorBindingID id = (ConnectorBindingID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof DeployedComponentID) {
+ DeployedComponentID id = (DeployedComponentID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof VMComponentDefnID) {
+ VMComponentDefnID id = (VMComponentDefnID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof ServiceComponentDefnID) {
+ ServiceComponentDefnID id = (ServiceComponentDefnID) target;
+ executeActions(id, actions, config, principal);
+ } else if (target instanceof PropDefnAllowedValueID) {
+ PropDefnAllowedValueID id = (PropDefnAllowedValueID) target;
+ executeActions(id, actions);
+ } else {
+ throw new ConfigurationException(ConfigMessages.CONFIG_0071,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0071,target));
+ }
return affectedIDs;
}
- private ConfigurationModelContainerImpl getConfigModel(BaseID id, XMLConfigurationConnector transaction) throws ConfigurationException {
+ private ComponentType getComponentType(ConfigurationModelContainer config,
+ ComponentTypeID id, BaseID targetID) throws ConfigurationException {
+ ComponentType type = config.getComponentType(id.getFullName());
- String name;
- if (id instanceof ConfigurationID) {
- name = id.getFullName();
- } else {
- name = id.getParentFullName();
+ if (type == null) {
+ throw new InvalidComponentException(ConfigPlugin.Util.getString("XMLActionUpdateStrategy.Unable_to_add_component_type_not_found", new Object[] { targetID, id })); //$NON-NLS-1$
}
- ConfigurationModelContainerImpl container = (ConfigurationModelContainerImpl) transaction.getObject(name);
+ return type;
+ }
- if (id instanceof ConfigurationID) {
- // a config model may not exist if a delete was performed
- } else {
- if (container == null) {
- throw new ConfigurationException(ConfigMessages.CONFIG_0072, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0072, name));
- }
- }
-
-
- return container;
- }
-
- private ComponentType getComponentType(ConfigurationModelContainer config, ComponentTypeID id, BaseID targetID)throws ConfigurationException {
-
- ComponentType type = config.getComponentType(id.getFullName());
-
- if (type == null) {
- throw new InvalidComponentException(ConfigPlugin.Util.getString("XMLActionUpdateStrategy.Unable_to_add_component_type_not_found", new Object[] {targetID, id})); //$NON-NLS-1$
- }
-
- return type;
-
- }
-
-
- public Set executeActions(ConfigurationModelContainerImpl config,
- AuthenticationProviderID targetID, List actions,
- XMLConfigurationConnector transaction)
+ private Set executeActions(AuthenticationProviderID targetID, List actions,
+ ConfigurationModelContainerImpl config, String principal)
throws InvalidConfigurationException, ConfigurationException {
Set affectedIDs = new HashSet();
if (actions.isEmpty()) {
return affectedIDs;
}
- // System.out.println("STRATEGY: ResourceDescriptor Component Target " +
- // targetID);
int actionIndex = -1;
@@ -346,25 +206,17 @@
if (action instanceof CreateObject) {
if (rd != null) {
- DuplicateComponentException e = new DuplicateComponentException(
- ConfigMessages.CONFIG_0189,
- ConfigPlugin.Util.getString(
- ConfigMessages.CONFIG_0189, targetID));
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0189, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0189,targetID));
e.setActionIndex(actionIndex);
throw e;
}
rd = (AuthenticationProvider) args[0];
- rd = (AuthenticationProvider) setCreationDate(rd, transaction.getLockAcquiredBy());
+ rd = (AuthenticationProvider) setCreationDate(rd, principal);
- ComponentType type = getComponentType(config, rd
- .getComponentTypeID(), targetID);
+ ComponentType type = getComponentType(config, rd.getComponentTypeID(), targetID);
- // ComponentType type =
- // config.getComponentType(rd.getComponentTypeID().getFullName());
-
// process properties for any encryptions
- processPropertyForNewObject(rd, type, config, transaction
- .getLockAcquiredBy());
+ processPropertyForNewObject(rd, type, config, principal);
cfg.addComponentDefn(rd);
@@ -373,42 +225,30 @@
|| action instanceof ExchangeObject) {
if (rd == null) {
- throw new InvalidComponentException(
- ConfigMessages.CONFIG_0190,
- ConfigPlugin.Util.getString(
- ConfigMessages.CONFIG_0190, targetID));
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0190, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0190,targetID));
}
- // ComponentType type =
- // config.getComponentType(rd.getComponentTypeID().getFullName());
ComponentType type = getComponentType(config, rd
.getComponentTypeID(), targetID);
- rd = (AuthenticationProvider) setLastChangedDate(rd, transaction.getLockAcquiredBy());
+ rd = (AuthenticationProvider) setLastChangedDate(rd,
+ principal);
- processPropertyChanges(action, rd, type, config,
- transaction.getLockAcquiredBy());
+ processPropertyChanges(action, rd, type, config, principal);
} else if (action instanceof DestroyObject) {
if (rd != null) {
delete(targetID, cfg);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
}
-
} else {
- throw new InvalidArgumentException(
- ConfigMessages.CONFIG_0075, ConfigPlugin.Util
- .getString(ConfigMessages.CONFIG_0191,
- action.getActionDescription()));
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0191,action.getActionDescription()));
}
-
}
-
} catch (ConfigurationException ce) {
throw ce;
-
} catch (Exception e) {
ConfigurationException e2 = new ConfigurationException(e);
e2.setActionIndex(actionIndex);
@@ -417,1475 +257,1068 @@
return affectedIDs;
}
-
+ private Set executeActions(DeployedComponentID targetID, List actions, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidDeployedComponentException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- public Set executeActions(ConfigurationModelContainerImpl config, DeployedComponentID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidDeployedComponentException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: DeployedComp Target " + targetID + " on config " + config.getConfigurationID());
+ int actionIndex = -1;
+ affectedIDs.add(targetID);
- int actionIndex = -1;
- affectedIDs.add(targetID);
-
BasicConfiguration cfg = (BasicConfiguration) config.getConfiguration();
+ try {
- try {
-
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
DeployedComponent dc = cfg.getDeployedComponent(targetID);
- if(action instanceof CreateObject) {
+ if (action instanceof CreateObject) {
- if ( dc != null ) {
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0076, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0076, targetID));
- e.setActionIndex(actionIndex);
- throw e;
- }
+ if (dc != null) {
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0076, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0076,targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
- dc = (BasicDeployedComponent) args[0];
+ dc = (BasicDeployedComponent) args[0];
- dc = (BasicDeployedComponent) setCreationDate(dc, transaction.getLockAcquiredBy());
+ dc = (BasicDeployedComponent) setCreationDate(dc, principal);
- ComponentType type = getComponentType(config, dc.getComponentTypeID(), targetID);
+ ComponentType type = getComponentType(config, dc.getComponentTypeID(), targetID);
- // ComponentType type = config.getComponentType(dc.getComponentTypeID().getFullName());
- boolean isDeployable = type.isDeployable();
- if (!isDeployable) {
- throw new InvalidDeployedComponentException(ConfigMessages.CONFIG_0077, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0077, targetID.getName()));
- }
+ boolean isDeployable = type.isDeployable();
+ if (!isDeployable) {
+ throw new InvalidDeployedComponentException(ConfigMessages.CONFIG_0077, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0077,targetID.getName()));
+ }
- cfg.addDeployedComponent(dc);
+ cfg.addDeployedComponent(dc);
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject ||
- action instanceof ExchangeObject) {
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject
+ || action instanceof ExchangeObject) {
- if (dc == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0078, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0078, targetID));
- }
+ if (dc == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0078, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0078,targetID));
+ }
- //ComponentType type = config.getComponentType(dc.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, dc.getComponentTypeID(), targetID);
+ ComponentType type = getComponentType(config, dc.getComponentTypeID(), targetID);
- dc = (BasicDeployedComponent) setLastChangedDate(dc, transaction.getLockAcquiredBy());
+ dc = (BasicDeployedComponent) setLastChangedDate(dc,principal);
- processPropertyChanges(action,
- dc,
- type,
- config,
- transaction.getLockAcquiredBy());
+ processPropertyChanges(action, dc, type, config, principal);
- } else if (action instanceof DestroyObject) {
+ } else if (action instanceof DestroyObject) {
-
- if (dc != null) {
+ if (dc != null) {
delete(targetID, config.getConfiguration());
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
- }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0079, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0079,action.getActionDescription()));
+ }
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0079, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0079, action.getActionDescription()));
- }
+ }
- }
+ } catch (ConfigurationException ce) {
+ throw ce;
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ return affectedIDs;
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
+ }
+ private Set executeActions(ServiceComponentDefnID targetID, List actions,
+ ConfigurationModelContainerImpl config, String principal)
+ throws InvalidDeployedComponentException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
+ // System.out.println("STRATEGY: ComponentDefn Target " + targetID);
- return affectedIDs;
+ int actionIndex = -1;
- }
+ affectedIDs.add(targetID);
-
- public Set executeActions(ConfigurationModelContainerImpl config, ServiceComponentDefnID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidDeployedComponentException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: ComponentDefn Target " + targetID);
-
- int actionIndex = -1;
-
- affectedIDs.add(targetID);
-
BasicConfiguration cfg = (BasicConfiguration) config.getConfiguration();
- try {
+ try {
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
- ComponentDefn cd = cfg.getServiceComponentDefn(targetID);
+ ComponentDefn cd = cfg.getServiceComponentDefn(targetID);
- actionIndex++;
- Object args[] = action.getArguments();
+ actionIndex++;
+ Object args[] = action.getArguments();
- if(action instanceof CreateObject ) {
- if (cd!= null) {
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0083, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0083, targetID));
- e.setActionIndex(actionIndex);
- throw e;
- }
- cd = (ComponentDefn) args[0];
+ if (action instanceof CreateObject) {
+ if (cd != null) {
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0083, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0083,targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
+ cd = (ComponentDefn) args[0];
- cd = (ComponentDefn) setCreationDate(cd, transaction.getLockAcquiredBy());
+ cd = (ComponentDefn) setCreationDate(cd, principal);
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ // process properties for any encryptions
+ processPropertyForNewObject(cd, type, config, principal);
- // process properties for any encryptions
- processPropertyForNewObject(cd, type, config, transaction.getLockAcquiredBy());
+ cfg.addComponentDefn(cd);
-// System.out.println("STRATEGY: Add ComponentDefn Target " + targetID);
+ } else if (action instanceof AddObject || action instanceof RemoveObject) {
- cfg.addComponentDefn(cd);
+ if (cd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0084, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0084,targetID));
+ }
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject) {
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0084, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0084, targetID));
- }
+ processPropertyChanges(action, cd, type, config, principal);
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
+ } else if (action instanceof ExchangeObject) {
+ ExchangeObject anAction = (ExchangeObject) action;
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
+ if (cd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0084, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0084,targetID));
+ }
+ if (anAction.hasAttributeCode()
+ && (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY
+ .getCode() || anAction.getAttributeCode()
+ .intValue() == ConfigurationModel.Attribute.PROPERTIES
+ .getCode())) {
- } else if (action instanceof ExchangeObject) {
- ExchangeObject anAction = (ExchangeObject) action;
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0084, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0084, targetID));
- }
+ processPropertyChanges(action, cd, type, config,principal);
+ } else if (anAction.hasAttributeCode()
+ && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME
+ .getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0085, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0085,action.getActionDescription(),targetID));
+
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0086,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0086, anAction.getActionDescription()));
- if (anAction.hasAttributeCode() &&
- (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY.getCode() ||
- anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTIES.getCode() ) ) {
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
+ if (cd instanceof ServiceComponentDefn) {
+ setRoutingUUID((ServiceComponentDefn) cd,(String) anAction.getNewValue());
+ setLastChangedDate(cd, principal);
+ } else {
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0087,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0087, action.getActionDescription(),targetID));
+ }
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0085, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0085, action.getActionDescription(), targetID));
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0086,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0086, anAction.getActionDescription()));
+ }
-// } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PSC_NAME.getCode()) {
-// ProductServiceConfigID pscID = (ProductServiceConfigID)anAction.getNewValue();
-// ProductServiceConfig psc = config.getConfiguration().getPSC(pscID);
-//
-// setLastChangedDate(psc, transaction.getLockAcquiredBy());
-//
-//
-// // add the service the PSC
-// ConfigurationObjectEditorHelper.addServiceComponentDefn(psc, targetID);
+ } else if (action instanceof DestroyObject) {
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0086, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0086, anAction.getActionDescription()));
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
-
- if (cd instanceof ServiceComponentDefn) {
- setRoutingUUID((ServiceComponentDefn) cd, (String) anAction.getNewValue());
-
- setLastChangedDate(cd, transaction.getLockAcquiredBy());
-
-
- } else {
-
- throw new InvalidComponentException(ConfigMessages.CONFIG_0087, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0087, action.getActionDescription(), targetID));
-
- }
-
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0086, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0086, anAction.getActionDescription()));
- }
-
-
-
-
- } else if (action instanceof DestroyObject) {
-
- if (cd != null) {
-// System.out.println("STRATEGY: Destroy ServiceDefn Target " + targetID);
+ if (cd != null) {
delete(targetID, cfg);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
- }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075,action.getActionDescription()));
+ }
+ }
+ } catch (ConfigurationException ce) {
+ throw ce;
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
- }
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- }
+ return affectedIDs;
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ private Set executeActions(VMComponentDefnID targetID, List actions, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidDeployedComponentException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
+ int actionIndex = -1;
+ affectedIDs.add(targetID);
- return affectedIDs;
-
- }
-
- public Set executeActions( ConfigurationModelContainerImpl config, VMComponentDefnID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidDeployedComponentException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: ComponentDefn Target " + targetID);
-
- int actionIndex = -1;
-
- affectedIDs.add(targetID);
-
BasicConfiguration cfg = (BasicConfiguration) config.getConfiguration();
- try {
+ try {
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
ComponentDefn cd = cfg.getVMComponentDefn(targetID);
- if(action instanceof CreateObject ) {
- if (cd!= null) {
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0088, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0088, action.getActionDescription(), targetID));
- e.setActionIndex(actionIndex);
- throw e;
- }
- cd = (ComponentDefn) args[0];
-// System.out.println("STRATEGY: Add ComponentDefn Target " + targetID);
+ if (action instanceof CreateObject) {
+ if (cd != null) {
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0088, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0088,action.getActionDescription(),targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
+ cd = (ComponentDefn) args[0];
- cd = (ComponentDefn) setCreationDate(cd, transaction.getLockAcquiredBy());
+ cd = (ComponentDefn) setCreationDate(cd, principal);
- //ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- // process properties for any encryptions
- processPropertyForNewObject(cd, type, config, transaction.getLockAcquiredBy());
+ // process properties for any encryptions
+ processPropertyForNewObject(cd, type, config, principal);
- cfg.addComponentDefn(cd);
-
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject) {
+ cfg.addComponentDefn(cd);
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0089, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0089, targetID));
- }
-// System.out.println("STRATEGY: Add or Remove object for target " + targetID);
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject) {
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
+ if (cd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0089, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0089,targetID));
+ }
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
+ processPropertyChanges(action, cd, type, config, principal);
- // System.out.println("STRATEGY: Got type for " + targetID);
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
+ } else if (action instanceof ExchangeObject) {
+ ExchangeObject anAction = (ExchangeObject) action;
-// System.out.println("STRATEGY: End of Property changes " + targetID);
+ if (cd == null) {
+ throw new InvalidComponentException(
+ ConfigMessages.CONFIG_0089, ConfigPlugin.Util
+ .getString(ConfigMessages.CONFIG_0089,
+ targetID));
+ }
- } else if (action instanceof ExchangeObject) {
- ExchangeObject anAction = (ExchangeObject) action;
+ if (anAction.hasAttributeCode()
+ && (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY
+ .getCode() || anAction.getAttributeCode()
+ .intValue() == ConfigurationModel.Attribute.PROPERTIES
+ .getCode())) {
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0089, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0089, targetID));
- }
-// System.out.println("STRATEGY: Exchange for Target " + targetID);
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
+ processPropertyChanges(action, cd, type, config,principal);
- if (anAction.hasAttributeCode() &&
- (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY.getCode() ||
- anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTIES.getCode() ) ) {
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME.getCode()) {
+
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0090, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0090,action.getActionDescription(),targetID));
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PSC_NAME.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0090, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0090,action.getActionDescription(),targetID));
- // System.out.println("STRATEGY: Exchange Properties " + targetID);
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0091,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0091,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0090, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0090, action.getActionDescription(), targetID));
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0091,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
+ }
+ } else if (action instanceof DestroyObject) {
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PSC_NAME.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0090, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0090, action.getActionDescription(), targetID));
-
-
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0091, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
-
-// System.out.println("STRATEGY: Exchange enables " + targetID);
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
-// System.out.println("STRATEGY: Exchange routing " + targetID);
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0091, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
-
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0091, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, anAction.getActionDescription()));
- }
- } else if (action instanceof DestroyObject) {
-
- if (cd != null) {
-// System.out.println("STRATEGY: Destroy ComponentDefn Target " + targetID);
-
+ if (cd != null) {
delete(targetID, cfg);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
- }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0091, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091,action.getActionDescription()));
+ }
+ }
+ } catch (ConfigurationException ce) {
+ throw ce;
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0091, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0091, action.getActionDescription()));
- }
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- }
+ return affectedIDs;
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ private Set executeActions(ConnectorBindingID targetID, List actions, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidDeployedComponentException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
-
-
- return affectedIDs;
-
- }
-
-
- public Set executeActions( ConfigurationModelContainerImpl config, ConnectorBindingID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidDeployedComponentException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: ConnectorBinding Target " + targetID + " on config " + config.getConfigurationID());
-
- int actionIndex = -1;
-
- affectedIDs.add(targetID);
-
+ int actionIndex = -1;
+ affectedIDs.add(targetID);
BasicConfiguration cfg = (BasicConfiguration) config.getConfiguration();
- try {
+ try {
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
ComponentDefn cd = cfg.getConnectorBinding(targetID);
- if(action instanceof CreateObject ) {
+ if (action instanceof CreateObject) {
- if (cd!= null) {
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0092, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0092, targetID));
- e.setActionIndex(actionIndex);
- throw e;
- }
- cd = (ComponentDefn) args[0];
+ if (cd != null) {
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0092, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0092,targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
+ cd = (ComponentDefn) args[0];
+ cd = (ComponentDefn) setCreationDate(cd, principal);
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- cd = (ComponentDefn) setCreationDate(cd, transaction.getLockAcquiredBy());
+ // process properties for any encryptions
+ processPropertyForNewObject(cd, type, config, principal);
+ cfg.addComponentDefn(cd);
- // ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject) {
- // process properties for any encryptions
- processPropertyForNewObject(cd, type, config, transaction.getLockAcquiredBy());
+ if (cd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0093, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0093,targetID));
+ }
-// System.out.println("STRATEGY: Add ConnectorBinding Target " + dvt.getID() + " to config " + cfg.getID());
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
+ processPropertyChanges(action, cd, type, config, principal);
- cfg.addComponentDefn(cd);
+ } else if (action instanceof ExchangeObject) {
+ ExchangeObject anAction = (ExchangeObject) action;
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject) {
+ if (cd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0093, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0093,targetID));
+ }
+ if (anAction.hasAttributeCode() && (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY.getCode() || anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTIES.getCode())) {
+ ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
+ cd = (ComponentDefn) setLastChangedDate(cd, principal);
+ processPropertyChanges(action, cd, type, config,principal);
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0093, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0093, targetID));
- }
-// System.out.println("STRATEGY: Add or Remove ConnectorBinding Property " + dvt.getID() + " to config " + cfg.getID());
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0094, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0094,action.getActionDescription(),targetID));
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0096,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096, anAction.getActionDescription()));
+ } else if (anAction.hasAttributeCode()&& anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
+ cd = (ConnectorBinding) setLastChangedDate(cd,principal);
+ setRoutingUUID((ConnectorBinding) cd, (String) anAction.getNewValue());
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0096,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096, anAction.getActionDescription()));
+ }
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
-
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
-
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
-
-
- } else if (action instanceof ExchangeObject) {
- ExchangeObject anAction = (ExchangeObject) action;
-
-
- if (cd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0093, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0093, targetID));
- }
-
-
- if (anAction.hasAttributeCode() &&
- (anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTY.getCode() ||
- anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PROPERTIES.getCode() ) ) {
-// System.out.println("STRATEGY: Exchange ConnectorBinding Properties for Target " + dvt.getID() + " to config " + cfg.getID());
-
- // ComponentType type = config.getComponentType(cd.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, cd.getComponentTypeID(), targetID);
-
- cd = (ComponentDefn) setLastChangedDate(cd, transaction.getLockAcquiredBy());
-
- processPropertyChanges(action,
- cd,
- type,
- config,
- transaction.getLockAcquiredBy());
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.NAME.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0094, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0094, action.getActionDescription(),targetID));
-
-
-// } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.PSC_NAME.getCode()) {
-//
-//// System.out.println("STRATEGY: Exchange ConnectorBinding PSC for Target " + dvt.getID() + " for PSC exchange");
-//
-// ProductServiceConfigID pscID = (ProductServiceConfigID)anAction.getNewValue();
-// ProductServiceConfig psc = config.getConfiguration().getPSC(pscID);
-//
-// if (psc == null) {
-// throw new InvalidComponentException(ConfigMessages.CONFIG_0095, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0095, pscID, config.getConfigurationID()));
-// }
-//
-// setLastChangedDate(psc, transaction.getLockAcquiredBy());
-//
-// // add the service the PSC
-// ConfigurationObjectEditorHelper.addServiceComponentDefn(psc, targetID);
-
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.IS_ENABLED.getCode()) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0096, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096, anAction.getActionDescription() ));
-
-//System.out.println("STRATEGY: Exchange ConnectorBinding isEnabled for Target " + dvt.getID() + " to config " + cfg.getID());
-
- } else if (anAction.hasAttributeCode() && anAction.getAttributeCode().intValue() == ConfigurationModel.Attribute.ROUTING_UUID.getCode()) {
-// System.out.println("STRATEGY: Exchange ConnectorBinding RoutingUUID for Target " + dvt.getID() + " to config " + cfg.getID());
-
- cd = (ConnectorBinding) setLastChangedDate(cd, transaction.getLockAcquiredBy());
-
- setRoutingUUID((ConnectorBinding) cd, (String) anAction.getNewValue());
-
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0096, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096, anAction.getActionDescription() ));
- }
-
-
- } else if (action instanceof DestroyObject) {
- if (cd != null) {
-// System.out.println("STRATEGY: Destroy ConnectorBinding Target " + targetID);
-
+ } else if (action instanceof DestroyObject) {
+ if (cd != null) {
delete(targetID, cfg);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
- }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0096, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096,action.getActionDescription()));
+ }
+ }
+ } catch (ConfigurationException ce) {
+ throw ce;
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0096, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0096, action.getActionDescription() ));
- }
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- }
+ return affectedIDs;
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ private Set executeActions(ConfigurationID targetID, List actions, ConfigurationModelContainerImpl config, String principal, XMLConfigurationConnector transaction) throws InvalidConfigurationException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
+ int actionIndex = -1;
+ BasicConfiguration dvt = null;
- return affectedIDs;
+ affectedIDs.add(targetID);
- }
+ try {
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
+ if (action.hasAttributeCode() && (action.getAttributeCode().intValue() == ConfigurationModel.Attribute.CURRENT_CONFIGURATION .getCode() || action.getAttributeCode().intValue() == ConfigurationModel.Attribute.NEXT_STARTUP_CONFIGURATION.getCode())) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0097, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0097,action.getActionDescription()));
+ }
+ // NOTE: These changes are always made within a transaction and
+ // a configurtation is never deleted without one taking its
+ // place.
+ // And when a delete occurs, a new empty model will take its
+ // place.
+ // Therefore, a model will ALWAYS exists
+ if (action instanceof CreateObject) {
+ Object obj = args[0];
+ if (obj instanceof Collection) {
+ Collection objs = (Collection) obj;
+ // Not sure of this pattern here - rareddy
+ ConfigurationModelContainerImpl newConfig = new ConfigurationModelContainerImpl();
+ transaction.setConfigurationModel(newConfig);
+ newConfig.setConfigurationObjects(objs);
- public Set executeActions( ConfigurationID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidConfigurationException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: Configuaraton Target " + targetID);
+ for (Iterator it = objs.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof ComponentObject) {
+ ComponentObject co = (ComponentObject) o;
+ ComponentType type = getComponentType(config,co.getComponentTypeID(), targetID);
+ processPropertyForNewObject(co, type, config,principal);
+ }
+ }
+ } else {
+ dvt = (BasicConfiguration) obj;
+ config.addObject(dvt);
+ }
- int actionIndex = -1;
+ } else if (action instanceof AddObject || action instanceof RemoveObject || action instanceof ExchangeObject) {
+ Configuration configuration = config.getConfiguration();
+ if (configuration == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0098, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0098,targetID));
+ }
- ConfigurationModelContainerImpl config = getConfigModel(targetID, transaction);
+ ComponentType type = getComponentType(config, configuration.getComponentTypeID(), targetID);
+ processPropertyChanges(action, configuration, type, config,principal);
+ } else if (action instanceof DestroyObject) {
+ // create an empty model
+ // the assumption here is there should other actions as part
+ // of this
+ // transaction that will load the container before it is
+ // committed
- BasicConfiguration dvt = null;
+ // Not sure of this pattern here - rareddy
+ ConfigurationModelContainerImpl emptyConfig = new ConfigurationModelContainerImpl();
+ transaction.setConfigurationModel(emptyConfig);
- affectedIDs.add(targetID);
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0099, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0099,action.getActionDescription()));
+ }
- try {
+ } // end of while loop
+ } catch (ConfigurationException ce) {
+ throw ce;
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ } catch (Exception e) {
- if (action.hasAttributeCode() &&
- (action.getAttributeCode().intValue() == ConfigurationModel.Attribute.CURRENT_CONFIGURATION.getCode() ||
- action.getAttributeCode().intValue() == ConfigurationModel.Attribute.NEXT_STARTUP_CONFIGURATION.getCode() ) ) {
- // || action.getAttributeCode().intValue() == ConfigurationModel.Attribute.STARTUP_CONFIGURATION.getCode())
-
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0097, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0097, action.getActionDescription() ));
- }
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
+ return affectedIDs;
- // NOTE: These changes are always made within a transaction and
- // a configurtation is never deleted without one taking its place.
- // And when a delete occurs, a new empty model will take its place.
- // Therefore, a model will ALWAYS exists
- if(action instanceof CreateObject ) {
-// System.out.println("STRATEGY: CREATE Configuaraton " + targetID);
- Object obj = args[0];
- if (obj instanceof Collection) {
- Collection objs = (Collection) obj;
-// System.out.println("TRANS SIZE 1: " + transaction.getObjects().size());
+ }
- ConfigurationModelContainerImpl newConfig = new ConfigurationModelContainerImpl();
- transaction.addObjects(targetID.getFullName(), newConfig);
+ private Set executeActions(ComponentTypeID targetID, List actions,ConfigurationModelContainerImpl config, String principal)
+ throws InvalidConfigurationException, ConfigurationException {
+
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
-// System.out.println("STRATEGY: # OF CONFIG OBJS: " + objs.size());
- newConfig.setConfigurationObjects(objs);
+ int actionIndex = -1;
- for (Iterator it=objs.iterator(); it.hasNext(); ) {
- Object o = it.next();
- if (o instanceof ComponentObject) {
- ComponentObject co = (ComponentObject) o;
- // ComponentType type = newConfig.getComponentType(co.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(newConfig, co.getComponentTypeID(), targetID);
+ affectedIDs.add(targetID);
- // process properties for any encryptions
- processPropertyForNewObject(co, type, newConfig, transaction.getLockAcquiredBy());
- }
+ try {
- }
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
-// System.out.println("TRANS SIZE 2: " + transaction.getObjects().size());
+ actionIndex++;
+ Object args[] = action.getArguments();
- } else {
- dvt = (BasicConfiguration) obj;
+ if (action instanceof CreateObject) {
- config.addObject(dvt);
+ ComponentType type = config.getComponentType(targetID
+ .getFullName());
- }
+ if (type != null) {
+ // because types are not configuration bound, the create
+ // for the type will only be added where it does not
+ // exist
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0100, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0100,targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject ||
- action instanceof ExchangeObject) {
+ BasicComponentType dvt = (BasicComponentType) args[0];
+ setCreationDate(dvt, principal);
+ config.addComponentType(dvt);
- Configuration configuration = config.getConfiguration();
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
- if (configuration == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0098, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0098, targetID));
- }
+ } else if (action instanceof ExchangeObject) {
+ ExchangeObject exchangeAction = (ExchangeObject) action;
- //ComponentType type = config.getComponentType(configuration.getComponentTypeID().getFullName());
- // ComponentType type = getComponentType(config, configuration.getComponentTypeID(), targetID);
- ComponentType type = getComponentType(config, configuration.getComponentTypeID(), targetID);
+ ComponentType type = config.getComponentType(targetID.getFullName());
- processPropertyChanges(action,
- configuration,
- type,
- config,
- transaction.getLockAcquiredBy());
-
- } else if (action instanceof DestroyObject) {
-// System.out.println("STRATEGY: DESTROY Configuaraton " + targetID);
-
- // create an empty model
- // the assumption here is there should other actions as part of this
- // transaction that will load the container before it is committed
- ConfigurationModelContainerImpl emptyConfig = new ConfigurationModelContainerImpl();
- transaction.addObjects(targetID.getFullName(), emptyConfig);
-
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0099, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0099, action.getActionDescription()));
- }
-
- } // end of while loop
-
-
- } catch (ConfigurationException ce) {
- throw ce;
-
- } catch ( Exception e ) {
-
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
- return affectedIDs;
-
-
-
- }
-
-
- public Set executeActions(ConfigurationModelContainerImpl config,ComponentTypeID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidConfigurationException, ConfigurationException {
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: ComponentType Target " + targetID);
-
- int actionIndex = -1;
-
- affectedIDs.add(targetID);
-
- try {
-
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
-
- actionIndex++;
- Object args[] = action.getArguments();
-
- if(action instanceof CreateObject) {
-
- ComponentType type = config.getComponentType(targetID.getFullName());
-
- if ( type != null ) {
-// System.out.println(ConfigPlugin.Util.getString(LogMessageKeys.CONFIG_0005, targetID));
-
- // because types are not configuration bound, the create
- // for the type will only be added where it does not exist
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0100, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0100,targetID ));
- e.setActionIndex(actionIndex);
- throw e;
- }
- // System.out.println("STRATEGY: Add ComponentType Target " + targetID);
-
- BasicComponentType dvt = (BasicComponentType) args[0];
-
- setCreationDate(dvt, transaction.getLockAcquiredBy());
-
- config.addComponentType(dvt);
-
-// if (dvt.isOfTypeConnector()) {
-// // the new type must be added to the connector product type.
-// ProductType pt = config.getProductType(MetaMatrixProductVersion.CONNECTOR_PRODUCT_TYPE_NAME);
-// ConfigurationObjectEditorHelper.addServiceComponentType(pt, dvt);
-// }
-
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
-
-
- } else if (action instanceof ExchangeObject) {
- ExchangeObject exchangeAction = (ExchangeObject) action;
-
-
- ComponentType type = config.getComponentType(targetID.getFullName());
-
if (type == null) {
- throw new InvalidDeployedComponentException(ConfigMessages.CONFIG_0102,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0102,targetID));
- }
+ throw new InvalidDeployedComponentException(ConfigMessages.CONFIG_0102, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0102,targetID));
+ }
- BasicComponentType bct = (BasicComponentType) type;
+ BasicComponentType bct = (BasicComponentType) type;
- if (action.hasAttributeCode() && action.getAttributeCode().intValue() == ConfigurationModel.Attribute.UPDATE_COMPONENT_TYPE.getCode()) {
+ if (action.hasAttributeCode()&& action.getAttributeCode().intValue() == ConfigurationModel.Attribute.UPDATE_COMPONENT_TYPE.getCode()) {
- ComponentType newCt = (ComponentType)exchangeAction.getNewValue();
- setLastChangedDate(newCt, transaction.getLockAcquiredBy());
-
- config.addComponentType((ComponentType)exchangeAction.getNewValue());
-
+ ComponentType newCt = (ComponentType) exchangeAction.getNewValue();
+ setLastChangedDate(newCt, principal);
- } else if (action.hasAttributeCode() && action.getAttributeCode().intValue() == ConfigurationModel.Attribute.PARENT_COMPONENT_TYPEID.getCode()) {
+ config.addComponentType((ComponentType) exchangeAction.getNewValue());
- bct.setParentComponentTypeID((ComponentTypeID)exchangeAction.getNewValue());
+ } else if (action.hasAttributeCode()&& action.getAttributeCode().intValue() == ConfigurationModel.Attribute.PARENT_COMPONENT_TYPEID.getCode()) {
- setLastChangedDate(bct, transaction.getLockAcquiredBy());
+ bct.setParentComponentTypeID((ComponentTypeID) exchangeAction.getNewValue());
+ setLastChangedDate(bct, principal);
- } else if (action.hasAttributeCode() && action.getAttributeCode().intValue() == ConfigurationModel.Attribute.SUPER_COMPONENT_TYPEID.getCode()){
+ } else if (action.hasAttributeCode()&& action.getAttributeCode().intValue() == ConfigurationModel.Attribute.SUPER_COMPONENT_TYPEID.getCode()) {
- bct.setSuperComponentTypeID((ComponentTypeID)exchangeAction.getNewValue());
+ bct.setSuperComponentTypeID((ComponentTypeID) exchangeAction.getNewValue());
- setLastChangedDate(bct, transaction.getLockAcquiredBy());
+ setLastChangedDate(bct, principal);
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
- }
- } else if (action instanceof ExchangeBoolean) {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
+ }
+ } else if (action instanceof ExchangeBoolean) {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
- } else if (action instanceof DestroyObject) {
+ } else if (action instanceof DestroyObject) {
- ComponentType type = config.getComponentType(targetID.getFullName());
+ ComponentType type = config.getComponentType(targetID.getFullName());
if (type != null) {
-
- Collection services = config.getConfiguration().getComponentDefnIDs((ComponentTypeID) type.getID());
- if (services != null && services.size() > 0) {
- ComponentDefnID d = (ComponentDefnID) services.iterator().next();
- throw new InvalidDeployedComponentException(ConfigPlugin.Util.getString("XMLActionUpdateStrategy.Unable_to_delete_component_type_related_components_found", new Object[] {type.getID(), d.getFullName()})); //$NON-NLS-1$
-
- }
-
- config.remove(targetID);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ Collection services = config.getConfiguration().getComponentDefnIDs((ComponentTypeID) type.getID());
+ if (services != null && services.size() > 0) {
+ ComponentDefnID d = (ComponentDefnID) services.iterator().next();
+ throw new InvalidDeployedComponentException(ConfigPlugin.Util.getString("XMLActionUpdateStrategy.Unable_to_delete_component_type_related_components_found", new Object[] { type.getID(), d.getFullName() })); //$NON-NLS-1$
+ }
- }
+ config.remove(targetID);
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
- }
- }
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0101, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0101,action.getActionDescription()));
+ }
+ }
- } catch ( Exception e ) {
+ } catch (ConfigurationException ce) {
+ throw ce;
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
+ } catch (Exception e) {
- return affectedIDs;
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- }
+ return affectedIDs;
+ }
- public Set executeActions(ConfigurationModelContainerImpl config, ComponentTypeDefnID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidConfigurationException, ConfigurationException {
+ private Set executeActions(ComponentTypeDefnID targetID, List actions, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidConfigurationException, ConfigurationException {
- /**
- * This method is used for the mass importing of a configuration, instead of
- * recreating every object using the editor.
- *
- * NOTE: DO NOT add calls for setting history in this method because the importing
- * should retain what the original file contained.
- */
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
+ /**
+ * This method is used for the mass importing of a configuration,
+ * instead of recreating every object using the editor.
+ *
+ * NOTE: DO NOT add calls for setting history in this method because the
+ * importing should retain what the original file contained.
+ */
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- int actionIndex = -1;
- affectedIDs.add(targetID);
+ int actionIndex = -1;
+ affectedIDs.add(targetID);
- try {
+ try {
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
+ BasicComponentTypeDefn dvt = (BasicComponentTypeDefn) args[0];
+ ComponentType type = getComponentType(config, dvt.getComponentTypeID(), targetID);
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ if (action instanceof CreateObject) {
+ if (type.getComponentTypeDefinition(dvt.getFullName()) != null) {
+ // this check is added because when the editor is used
+ // by the importer,
+ // it creates actions for this defn where the component
+ // type
+ // that it added already contains the definitions.
+ // Therefore, only throw an exception if it is
+ // different.
+ ComponentTypeDefn ctd = type.getComponentTypeDefinition(dvt.getFullName());
+ if (dvt.equals(ctd)) {
+ } else {
+ DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0104,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0104,targetID));
+ e.setActionIndex(actionIndex);
+ throw e;
+ }
+ }
- BasicComponentTypeDefn dvt = (BasicComponentTypeDefn) args[0];
-// ComponentTypeID typeID = dvt.getComponentTypeID();
+ BasicComponentType btype = (BasicComponentType) type;
+ btype.addComponentTypeDefinition(dvt);
- //ComponentType type = config.getComponentType(typeID.getFullName());
+ } else if (action instanceof ExchangeObject) {
+ BasicComponentType btype = (BasicComponentType) type;
- ComponentType type = getComponentType(config, dvt.getComponentTypeID(), targetID);
-
-// if (type == null) {
-// throw new InvalidDeployedComponentException(ConfigMessages.CONFIG_0102,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0102,typeID));
-// }
+ if (type.getComponentTypeDefinition(dvt.getFullName()) == null) {
+ btype.removeComponentTypeDefinition(dvt);
+ }
+ btype.addComponentTypeDefinition(dvt);
+ } else if (action instanceof DestroyObject) {
+ if (type.getComponentTypeDefinition(dvt.getFullName()) != null) {
+ BasicComponentType btype = (BasicComponentType) type;
+ btype.removeComponentTypeDefinition(dvt);
+ }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0103, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0103,action.getActionDescription()));
+ }
+ }
+ } catch (ConfigurationException ce) {
+ throw ce;
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
+ return affectedIDs;
+ }
- if(action instanceof CreateObject) {
- if (type.getComponentTypeDefinition(dvt.getFullName()) != null) {
- // this check is added because when the editor is used by the importer,
- // it creates actions for this defn where the component type
- // that it added already contains the definitions.
- // Therefore, only throw an exception if it is different.
- ComponentTypeDefn ctd = type.getComponentTypeDefinition(dvt.getFullName());
- if (dvt.equals(ctd)) {
- } else {
- DuplicateComponentException e = new DuplicateComponentException(ConfigMessages.CONFIG_0104,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0104,targetID));
- e.setActionIndex(actionIndex);
- throw e;
- }
- }
+ private Set executeActions(PropDefnAllowedValueID targetID, List actions) {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- BasicComponentType btype = (BasicComponentType) type;
- btype.addComponentTypeDefinition(dvt);
+ affectedIDs.add(targetID);
+ return affectedIDs;
+ }
+ private Set executeActions(HostID targetID, List actions,ConfigurationModelContainerImpl config, String principal)
+ throws InvalidComponentException, ConfigurationException {
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- } else if (action instanceof ExchangeObject) {
- BasicComponentType btype = (BasicComponentType) type;
+ int actionIndex = -1;
+ BasicHost dvt = null;
- if (type.getComponentTypeDefinition(dvt.getFullName()) == null) {
- btype.removeComponentTypeDefinition(dvt);
- }
+ affectedIDs.add(targetID);
- btype.addComponentTypeDefinition(dvt);
- } else if (action instanceof DestroyObject) {
- if (type.getComponentTypeDefinition(dvt.getFullName()) == null) {
+ try {
- } else {
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
- BasicComponentType btype = (BasicComponentType) type;
- btype.removeComponentTypeDefinition(dvt);
- }
-
-
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0103,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0103,action.getActionDescription() ));
- }
- }
-
-
- } catch (ConfigurationException ce) {
- throw ce;
-
- } catch ( Exception e ) {
-
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
-
- return affectedIDs;
-
-
- }
-
-
- public Set executeActions(ConfigurationModelContainerImpl config,PropDefnAllowedValueID targetID, List actions, XMLConfigurationConnector transaction ) throws InvalidConfigurationException, ConfigurationException {
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-
- affectedIDs.add(targetID);
-
-
-
- return affectedIDs;
- }
-
-
-
-
- public Set executeActions(ConfigurationModelContainerImpl config, HostID targetID, List actions, XMLConfigurationConnector transaction) throws InvalidComponentException, ConfigurationException{
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
-// System.out.println("STRATEGY: Update Host " + targetID);
-
- int actionIndex = -1;
- BasicHost dvt = null;
-
- affectedIDs.add(targetID);
-
- try {
-
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
-
- if(action instanceof CreateObject ) {
+ if (action instanceof CreateObject) {
Host host = config.getHost(targetID.getFullName());
- if (host != null) {
- // because hosts are not configuration bound, the create
- // for the hosts will only be added where it does not exist
- continue;
+ if (host != null) {
+ // because hosts are not configuration bound, the create
+ // for the hosts will only be added where it does not
+ // exist
+ continue;
+ }
+ dvt = (BasicHost) args[0];
-// DuplicateComponentException e = new DuplicateComponentException("The host (\"" + targetID + "\") already exists and may not be recreated");
-// e.setActionIndex(actionIndex);
-// throw e;
- }
- dvt = (BasicHost) args[0];
+ // call to validate the type exists
+ getComponentType(config, dvt.getComponentTypeID(), targetID);
- // call to validate the type exists
- getComponentType(config, dvt.getComponentTypeID(), targetID);
+ dvt = (BasicHost) setCreationDate(dvt, principal);
+ BasicConfiguration bc = (BasicConfiguration) config.getConfiguration();
+ bc.addHost(dvt);
- dvt = (BasicHost) setCreationDate(dvt, transaction.getLockAcquiredBy());
-
- BasicConfiguration bc = (BasicConfiguration) config.getConfiguration();
- bc.addHost(dvt);
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject
+ || action instanceof ExchangeObject) {
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject ||
- action instanceof ExchangeObject) {
-
-
Host host = config.getHost(targetID.getFullName());
- if (host == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0105,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0105,targetID));
- }
+ if (host == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0105, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0105,targetID));
+ }
- // ComponentType type = config.getComponentType(host.getComponentTypeID().getFullName());
- ComponentType type = getComponentType(config, host.getComponentTypeID(), targetID);
+ ComponentType type = getComponentType(config, host.getComponentTypeID(), targetID);
+ host = (Host) setLastChangedDate(host, principal);
+ processPropertyChanges(action, host, type, config,principal);
- host = (Host) setLastChangedDate(host, transaction.getLockAcquiredBy());
-
- processPropertyChanges(action,
- host,
- type,
- config,
- transaction.getLockAcquiredBy());
-
-
- } else if (action instanceof DestroyObject) {
+ } else if (action instanceof DestroyObject) {
Host host = config.getHost(targetID.getFullName());
- if (host != null) {
- // if the host is deleted, so must the dependent objects be deleted (if they exist)
+ if (host != null) {
+ // if the host is deleted, so must the dependent objects
+ // be deleted (if they exist)
delete(targetID, config.getConfiguration());
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
- }
+ setLastChangedDate(config.getConfiguration(), principal);
+ }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075,action.getActionDescription()));
+ }
+ }
+ } catch (ConfigurationException ce) {
+ throw ce;
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0075,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
- }
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
+ return affectedIDs;
- }
+ }
+ /**
+ * Executes the specified component type actions and will update the list of
+ * component types with the changes.
+ *
+ * @param componentTypes
+ * is the configuration to be updated
+ */
- } catch (ConfigurationException ce) {
- throw ce;
+ private Set executeActions(SharedResourceID targetID, List actions,
+ ConfigurationModelContainerImpl config, String principal)
+ throws InvalidConfigurationException, ConfigurationException {
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
- return affectedIDs;
+ Set affectedIDs = new HashSet();
+ if (actions.isEmpty()) {
+ return affectedIDs;
+ }
- }
+ int actionIndex = -1;
+ affectedIDs.add(targetID);
+ BasicSharedResource dvt = null;
- /**
- * Executes the specified component type actions and will update the list of component types
- * with the changes.
- * @param componentTypes is the configuration to be updated
- */
+ try {
- public Set executeActions(ConfigurationModelContainerImpl config, SharedResourceID targetID, List actions, XMLConfigurationConnector transaction )
- throws InvalidConfigurationException, ConfigurationException{
+ // Iterate through the actions ...
+ Iterator iter = actions.iterator();
+ while (iter.hasNext()) {
+ ActionDefinition action = (ActionDefinition) iter.next();
+ actionIndex++;
+ Object args[] = action.getArguments();
- Set affectedIDs = new HashSet();
- if ( actions.isEmpty() ) {
- return affectedIDs;
- }
+ if (action instanceof CreateObject) {
+ SharedResource rd = config.getResource(targetID.getFullName());
- int actionIndex = -1;
+ if (rd != null) {
+ // because rd are not configuration bound, the create
+ // for the rd will only be added where it does not exist
+ continue;
+ }
+ dvt = (BasicSharedResource) args[0];
- affectedIDs.add(targetID);
- BasicSharedResource dvt = null;
+ dvt = (BasicSharedResource) setCreationDate(dvt, principal);
- try {
+ ComponentType type = ResourceModel.getComponentType(dvt.getName());
- // Iterate through the actions ...
- Iterator iter = actions.iterator();
- while ( iter.hasNext() ) {
- ActionDefinition action = (ActionDefinition) iter.next();
- actionIndex++;
- Object args[] = action.getArguments();
+ // process properties for any encryptions
+ processPropertyForNewObject(dvt, type, config, principal);
- if(action instanceof CreateObject ) {
- SharedResource rd = config.getResource(targetID.getFullName());
+ config.addResource(dvt);
- if (rd != null) {
- // because rd are not configuration bound, the create
- // for the rd will only be added where it does not exist
- continue;
+ } else if (action instanceof AddObject
+ || action instanceof RemoveObject
+ || action instanceof ExchangeObject) {
-// DuplicateComponentException e = new DuplicateComponentException("The host (\"" + targetID + "\") already exists and may not be recreated");
-// e.setActionIndex(actionIndex);
-// throw e;
- }
- dvt = (BasicSharedResource) args[0];
+ SharedResource rd = config.getResource(targetID
+ .getFullName());
- dvt = (BasicSharedResource) setCreationDate(dvt, transaction.getLockAcquiredBy());
+ if (rd == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0106, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0106,targetID));
+ }
- ComponentType type = ResourceModel.getComponentType(dvt.getName());
+ // get the type based on the SharedResource Name, not its
+ // type
+ ComponentType type = ResourceModel.getComponentType(rd.getName());
+ rd = (SharedResource) setLastChangedDate(rd, principal);
+ processPropertyChanges(action, rd, type, config, principal);
- // process properties for any encryptions
- processPropertyForNewObject(dvt, type, config, transaction.getLockAcquiredBy());
+ } else if (action instanceof DestroyObject) {
+ SharedResource rd = config.getResource(targetID.getFullName());
- config.addResource(dvt);
-
- } else if (action instanceof AddObject ||
- action instanceof RemoveObject ||
- action instanceof ExchangeObject) {
-
- SharedResource rd = config.getResource(targetID.getFullName());
-
- if (rd == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0106,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0106, targetID));
- }
-
- // get the type based on the SharedResource Name, not its type
- ComponentType type = ResourceModel.getComponentType(rd.getName());
-
- // ComponentType type = config.getComponentType(rd.getComponentTypeID().getFullName());
-
- // ComponentType type = getComponentType(config, rd.getComponentTypeID(), targetID);
-
- rd = (SharedResource)setLastChangedDate(rd, transaction.getLockAcquiredBy());
-
- processPropertyChanges(action,
- rd,
- type,
- config,
- transaction.getLockAcquiredBy());
-
-
-
- } else if (action instanceof DestroyObject) {
- SharedResource rd = config.getResource(targetID.getFullName());
-
- if (rd != null) {
+ if (rd != null) {
config.remove(targetID);
- setLastChangedDate(config.getConfiguration(), transaction.getLockAcquiredBy());
+ setLastChangedDate(config.getConfiguration(), principal);
- }
+ }
- } else {
- throw new InvalidArgumentException(ConfigMessages.CONFIG_0075,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
- }
+ } else {
+ throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075,action.getActionDescription()));
+ }
+ }
- }
+ } catch (ConfigurationException ce) {
+ throw ce;
+ } catch (Exception e) {
+ ConfigurationException e2 = new ConfigurationException(e);
+ e2.setActionIndex(actionIndex);
+ throw e2;
+ }
- } catch (ConfigurationException ce) {
- throw ce;
+ return affectedIDs;
+ }
- } catch ( Exception e ) {
- ConfigurationException e2 = new ConfigurationException(e);
- e2.setActionIndex(actionIndex);
- throw e2;
- }
+ void updateSharedResource(SharedResource resource,ConfigurationModelContainerImpl config, String principal) throws ConfigurationException {
+ ComponentType type = ResourceModel.getComponentType(resource.getName());
- return affectedIDs;
- }
-
- public void updateSharedResource(SharedResource resource, XMLConfigurationConnector transaction) throws ConfigurationException{
-
- Collection trans = transaction.getObjects();
- for (Iterator it=trans.iterator(); it.hasNext(); ) {
- ConfigurationModelContainerImpl m = (ConfigurationModelContainerImpl) it.next();
-// System.out.println("STRATEGY: Update SharedResource " + m.getConfigurationID());
-
-
- ComponentType type = ResourceModel.getComponentType(resource.getName());
-
- Properties props = resource.getProperties();
-
-
- SharedResource sr = m.getResource(resource.getFullName());
- if (sr == null) {
- throw new InvalidComponentException(ConfigMessages.CONFIG_0106,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0106, resource.getFullName()));
- }
-
- // if (ResourceModel.doesResourceRequireEncryption(sr.getName())) {
- updateProperties(sr, props, null, ConfigurationObjectEditor.ADD, type, m, transaction.getLockAcquiredBy());
-// } else {
-//
-// ConfigurationObjectEditorHelper.modifyProperties(sr, resource.getProperties(), ConfigurationObjectEditorHelper.ADD);
-//
-// }
-
- sr = (SharedResource) setLastChangedDate(sr, transaction.getLockAcquiredBy());
-
-
-
+ Properties props = resource.getProperties();
+ SharedResource sr = config.getResource(resource.getFullName());
+ if (sr == null) {
+ throw new InvalidComponentException(ConfigMessages.CONFIG_0106,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0106,resource.getFullName()));
}
- }
-
- /**
- * Executes the specified component type actions and will update the list of component types
- * with the changes.
- * @param componentTypes is the configuration to be updated
- */
+ updateProperties(sr, props, null, ConfigurationObjectEditor.ADD, type,config, principal);
-// public Set executeActions(ConfigurationModelContainerImpl config, ProductTypeID targetID, List actions, XMLConfigurationConnector transaction )
-// throws InvalidConfigurationException, ConfigurationException{
-//
-// Set affectedIDs = new HashSet();
-// if ( actions.isEmpty() ) {
-// return affectedIDs;
-// }
-//
-// int actionIndex = -1;
-//
-// affectedIDs.add(targetID);
-// BasicProductType dvt = null;
-//
-// try {
-//
-// // Iterate through the actions ...
-// Iterator iter = actions.iterator();
-// while ( iter.hasNext() ) {
-// ActionDefinition action = (ActionDefinition) iter.next();
-// actionIndex++;
-// Object args[] = action.getArguments();
-//
-// if(action instanceof CreateObject ) {
-// ProductType rd = config.getProductType(targetID.getFullName());
-//
-// if (rd != null) {
-// // because rd are not configuration bound, the create
-// // for the rd will only be added where it does not exist
-// continue;
-// }
-// dvt = (BasicProductType) args[0];
-//
-// dvt = (BasicProductType) setCreationDate(dvt, transaction.getLockAcquiredBy());
-//
-//
-// config.addProductType(dvt);
-//
-// } else if (action instanceof AddObject ||
-// action instanceof RemoveObject ||
-// action instanceof ExchangeObject) {
-//
-// throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
-//
-////
-//// ProductType rd = config.getProductType(targetID.getFullName());
-////
-//// if (rd == null) {
-//// throw new InvalidComponentException(ConfigMessages.CONFIG_0106,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0106, targetID));
-//// }
-////
-////
-//// ComponentType type = config.getComponentType(rd.getComponentTypeID().getFullName());
-//// rd = (SharedResource)setLastChangedDate(editor, rd, transaction.getLockAcquiredBy());
-////
-//// processPropertyChanges(action,
-//// rd,
-//// type,
-//// config,
-//// transaction.getLockAcquiredBy());
-////
-////
-//
-// } else if (action instanceof DestroyObject) {
-// // CANNOT REMOVE PRODUCT TYPES, they are predetermined for each release
-//
-// throw new InvalidArgumentException(ConfigMessages.CONFIG_0075, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
-//
-//// ProductType rd = config.getProductType(targetID.getFullName());
-////
-//// if (rd != null) {
-//// config.remove(targetID);
-//// setLastChangedDate(editor, config.getConfiguration(), transaction.getLockAcquiredBy());
-////
-//// }
-//
-// } else {
-// throw new InvalidArgumentException(ConfigMessages.CONFIG_0075,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0075, action.getActionDescription()));
-// }
-//
-// }
-//
-//
-// } catch (ConfigurationException ce) {
-// throw ce;
-//
-// } catch ( Exception e ) {
-// ConfigurationException e2 = new ConfigurationException(e);
-// e2.setActionIndex(actionIndex);
-// throw e2;
-// }
-//
-//
-// return affectedIDs;
-// }
-//
+ sr = (SharedResource) setLastChangedDate(sr, principal);
+ }
- // ----------------------------------------------------------------------------------------
- // P R O P E R T Y M E T H O D S
- // ----------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------
+ // --------------
+ // P R O P E R T Y M E T H O D S
+ //--------------------------------------------------------------------------
+ // --------------
- private void processPropertyForNewObject(ComponentObject object,
- ComponentType type,
- ConfigurationModelContainerImpl config,
- String principal)
- throws InvalidPropertyValueException, ConfigurationException {
+ private void processPropertyForNewObject(ComponentObject object, ComponentType type, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidPropertyValueException, ConfigurationException {
-// because new objects may no longer have seperate actions for their properties, the
-// properties that they have must be checked for passwords so that
-// they can be encrypted.
-
- BasicComponentObject bco = (BasicComponentObject) object;
-
- Properties props = bco.getEditableProperties();
+ // because new objects may no longer have seperate actions for their
+ // properties, the
+ // properties that they have must be checked for passwords so that
+ // they can be encrypted.
- updateProperties(object, props, null, ConfigurationObjectEditor.SET, type, config, principal);
+ BasicComponentObject bco = (BasicComponentObject) object;
- }
+ Properties props = bco.getEditableProperties();
- private void processPropertyChanges(ActionDefinition action,
- ComponentObject object,
- ComponentType type,
- ConfigurationModelContainerImpl config,
- String principal)
- throws InvalidPropertyValueException, ConfigurationException {
+ updateProperties(object, props, null, ConfigurationObjectEditor.SET,
+ type, config, principal);
+ }
- int operation = -1;
- String propName;
- String propValue;
- // System.out.println("STRATEGY: Process Property Changes" + object.getFullName());
+ private void processPropertyChanges(ActionDefinition action,ComponentObject object, ComponentType type,ConfigurationModelContainerImpl config, String principal)
+ throws InvalidPropertyValueException, ConfigurationException {
- if(action instanceof AddNamedObject ||
- action instanceof AddObject) {
- operation = ConfigurationObjectEditor.ADD;
- } else if (action instanceof ExchangeNamedObject ||
- action instanceof ExchangeObject) {
- operation = ConfigurationObjectEditor.SET;
- } else if (action instanceof RemoveNamedObject ||
- action instanceof RemoveObject) {
- operation = ConfigurationObjectEditor.REMOVE;
- } else {
- throw new RuntimeException(ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0107, action.getClass().getName()));
- }
+ int operation = -1;
+ String propName;
+ String propValue;
- Object args[] = action.getArguments();
+ if (action instanceof AddNamedObject || action instanceof AddObject) {
+ operation = ConfigurationObjectEditor.ADD;
+ } else if (action instanceof ExchangeNamedObject
+ || action instanceof ExchangeObject) {
+ operation = ConfigurationObjectEditor.SET;
+ } else if (action instanceof RemoveNamedObject
+ || action instanceof RemoveObject) {
+ operation = ConfigurationObjectEditor.REMOVE;
+ } else {
+ throw new RuntimeException(ConfigPlugin.Util.getString(
+ ConfigMessages.CONFIG_0107, action.getClass().getName()));
+ }
- /*
- System.out.println("<!><!>Properties processing action " + action + " with args:");
- for (int i= 0; i<args.length; i++){
- System.out.println(i + ": " + args[i]);
- }
- */
-// System.out.println("STRATEGY: Process Property Changes 1" );
+ Object args[] = action.getArguments();
- if (args[0] instanceof Properties) {
+ /*
+ * System.out.println("<!><!>Properties processing action " + action +
+ * " with args:"); for (int i= 0; i<args.length; i++){
+ * System.out.println(i + ": " + args[i]); }
+ */
+ // System.out.println("STRATEGY: Process Property Changes 1" );
+ if (args[0] instanceof Properties) {
- Properties props = null;
- Properties oldProps = null;
- if (operation == ConfigurationObjectEditor.ADD) {
- props = (Properties) args[0];
- } else if (operation == ConfigurationObjectEditor.SET) {
- // 0 arg is the old value
- // 1 arg is the new value
- oldProps = (Properties)args[0];
- props = (Properties) args[1];
- } else if (operation == ConfigurationObjectEditor.REMOVE) {
- props = (Properties) args[0];
- }
+ Properties props = null;
+ Properties oldProps = null;
+ if (operation == ConfigurationObjectEditor.ADD) {
+ props = (Properties) args[0];
+ } else if (operation == ConfigurationObjectEditor.SET) {
+ // 0 arg is the old value
+ // 1 arg is the new value
+ oldProps = (Properties) args[0];
+ props = (Properties) args[1];
+ } else if (operation == ConfigurationObjectEditor.REMOVE) {
+ props = (Properties) args[0];
+ }
+ updateProperties(object, props, oldProps, operation, type, config,
+ principal);
-// System.out.println("STRATEGY: Process Property Changes 2" );
+ } else {
+ propName = (String) args[0];
- updateProperties(object, props, oldProps,operation, type, config, principal);
+ String oldValue = ""; //$NON-NLS-1$
+ propValue = ""; //$NON-NLS-1$
- } else {
- propName = (String) args[0];
- String oldValue = ""; //$NON-NLS-1$
- propValue = ""; //$NON-NLS-1$
+ if (operation == ConfigurationObjectEditor.ADD) {
+ propValue = (String) args[1];
+ } else if (operation == ConfigurationObjectEditor.SET) {
+ oldValue = (String) args[1];
+ propValue = (String) args[2];
+ } else if (operation == ConfigurationObjectEditor.REMOVE) {
+ propValue = ""; //$NON-NLS-1$
+ }
- if (operation == ConfigurationObjectEditor.ADD) {
- propValue = (String) args[1];
- } else if (operation == ConfigurationObjectEditor.SET) {
- oldValue = (String) args[1];
- propValue = (String) args[2];
- } else if (operation == ConfigurationObjectEditor.REMOVE) {
- propValue = ""; //$NON-NLS-1$
- }
-// System.out.println("STRATEGY: Process Property Changes 3" );
+ updateProperty(object, propName, propValue, oldValue, operation,
+ type, config, principal);
+ }
- updateProperty(object, propName, propValue, oldValue, operation, type, config, principal);
- // Must encrypt connection passwords here
- // "targetObj instanceof ServiceComponentDefnID" indicates it's a connector binding
- }
+ }
- }
+ private void updateProperties(ComponentObject object, Properties props, Properties oldValues, int operation, ComponentType type, ConfigurationModelContainerImpl config, String principal)
+ throws InvalidPropertyValueException, ConfigurationException {
- private void updateProperties(ComponentObject object,
- Properties props,
- Properties oldValues,
- int operation,
- ComponentType type,
- ConfigurationModelContainerImpl config,
- String principal) throws InvalidPropertyValueException, ConfigurationException {
+ String propName;
+ String propValue;
- String propName;
- String propValue;
+ Enumeration propertyNames = props.propertyNames();
+ Properties passwordProps = new Properties();
- Enumeration propertyNames = props.propertyNames();
- Properties passwordProps = new Properties();
-
- while ( propertyNames.hasMoreElements() ) {
+ while (propertyNames.hasMoreElements()) {
- propName = (String) propertyNames.nextElement();
- propValue = props.getProperty(propName);
-
- validateProperty.isPropertyValid(propName, propValue);
- // Must encrypt connection passwords here
+ propName = (String) propertyNames.nextElement();
+ propValue = props.getProperty(propName);
- if (propValue != null && propValue.trim().length() > 0 &&
- isPasswordProp(propName, type, config) &&
- ! CryptoUtil.isValueEncrypted(propValue) ) {
- try {
+ validateProperty.isPropertyValid(propName, propValue);
+ // Must encrypt connection passwords here
- propValue = CryptoUtil.stringEncrypt(propValue);
- } catch ( CryptoException e ) {
- e.printStackTrace();
- throw new InvalidPropertyValueException(e,ConfigMessages.CONFIG_0108, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0108));
- }
- }
- passwordProps.setProperty(propName, propValue);
+ if (propValue != null && propValue.trim().length() > 0 && isPasswordProp(propName, type, config) && !CryptoUtil.isValueEncrypted(propValue)) {
+ try {
+ propValue = CryptoUtil.stringEncrypt(propValue);
+ } catch (CryptoException e) {
+ throw new InvalidPropertyValueException(e,ConfigMessages.CONFIG_0108, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0108));
+ }
+ }
+ passwordProps.setProperty(propName, propValue);
+ }
+ switch (operation) {
+ case ConfigurationObjectEditor.ADD:
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"adding properties " + passwordProps, principal, object.getName()); //$NON-NLS-1$
+ break;
+ case ConfigurationObjectEditor.SET:
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"setting properties " + passwordProps + " previous values " + oldValues, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ break;
+ case ConfigurationObjectEditor.REMOVE:
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"removing properties " + passwordProps, principal, object.getName()); //$NON-NLS-1$
+ break;
+ }
+ modifyProperties(object, passwordProps, operation);
+ }
- }
- switch (operation) {
- case ConfigurationObjectEditor.ADD:
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "adding properties " + passwordProps, principal, object.getName()); //$NON-NLS-1$
- break;
- case ConfigurationObjectEditor.SET:
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "setting properties " + passwordProps + " previous values " + oldValues, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- break;
- case ConfigurationObjectEditor.REMOVE:
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "removing properties " + passwordProps, principal, object.getName()); //$NON-NLS-1$
- break;
- }
+ private void updateProperty(ComponentObject object, String propName,String propValue, String oldValue, int operation,ComponentType type, ConfigurationModelContainerImpl config,String principal)
+ throws InvalidPropertyValueException,ConfigurationException {
+
+ validateProperty.isPropertyValid(propName, propValue);
- modifyProperties(object, passwordProps, operation);
+ if (propValue != null && propValue.trim().length() > 0 && isPasswordProp(propName, type, config) && !CryptoUtil.isValueEncrypted(propValue)) {
+ try {
+ propValue = CryptoUtil.getCryptor().encrypt(propValue);
+ } catch (CryptoException e) {
+ throw new InvalidPropertyValueException(e,ConfigMessages.CONFIG_0108, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0108));
+ }
+ }
- }
+ if (operation == ConfigurationObjectEditor.ADD) {
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"adding " + propName + " with value " + propValue, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ BasicComponentObject target = (BasicComponentObject) object;
+ target.addProperty(propName, propValue);
+ } else if (operation == ConfigurationObjectEditor.SET) {
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"setting " + propName + " to value " + propValue + " previous value was " + oldValue, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- private void updateProperty(ComponentObject object,
- String propName,
- String propValue,
- String oldValue,
- int operation,
- ComponentType type,
- ConfigurationModelContainerImpl config,
- String principal) throws InvalidPropertyValueException, ConfigurationException {
- validateProperty.isPropertyValid(propName, propValue);
+ BasicComponentObject target = (BasicComponentObject) object;
+ target.removeProperty(propName);
+ target.addProperty(propName, propValue);
- if (propValue != null && propValue.trim().length() > 0 &&
- isPasswordProp(propName, type, config) &&
- ! CryptoUtil.isValueEncrypted(propValue)) {
- char[] pwd = null;
- try {
- propValue = CryptoUtil.getCryptor().encrypt(propValue);
- } catch ( CryptoException e ) {
- throw new InvalidPropertyValueException(e, ConfigMessages.CONFIG_0108, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0108));
- }
- }
+ } else if (operation == ConfigurationObjectEditor.REMOVE) {
+ AuditManager.getInstance().record(ConfigurationServiceInterface.NAME,"removing " + propName, principal, object.getName()); //$NON-NLS-1$
+ BasicComponentObject target = (BasicComponentObject) object;
+ target.removeProperty(propName);
+ }
+ }
- if (operation == ConfigurationObjectEditor.ADD) {
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "adding " + propName + " with value " + propValue, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- BasicComponentObject target = (BasicComponentObject) object;
+ /**
+ * Determines if the given propDefn is a password property (ISMASKED == 1).
+ */
+ private static boolean isPasswordProp(String propName, ComponentType type, ConfigurationModelContainerImpl config)
+ throws ConfigurationException {
- target.addProperty(propName, propValue);
+ if (type == null) {
+ Assertion.isNotNull(type, ConfigPlugin.Util.getString(
+ ConfigMessages.CONFIG_0109, propName));
+ }
- } else if (operation == ConfigurationObjectEditor.SET) {
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "setting " + propName + " to value " + propValue + " previous value was " + oldValue, principal, object.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- BasicComponentObject target = (BasicComponentObject) object;
-
- target.removeProperty(propName);
-
- target.addProperty(propName, propValue);
-
- } else if (operation == ConfigurationObjectEditor.REMOVE) {
- AuditManager.getInstance().record(ConfigurationServiceInterface.NAME, "removing " + propName, principal, object.getName()); //$NON-NLS-1$
- BasicComponentObject target = (BasicComponentObject) object;
-
- target.removeProperty(propName);
- }
- }
-
- /**
- * Determines if the given propDefn is a password property (ISMASKED == 1).
- */
- private static boolean isPasswordProp(String propName, ComponentType type, ConfigurationModelContainerImpl config)
- throws ConfigurationException {
-
- if(type == null){
- Assertion.isNotNull(type, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0109, propName));
- }
-
ComponentType checkType = null;
if (type.getComponentTypeDefinition(propName) != null) {
@@ -1894,194 +1327,184 @@
checkType = findComponentTypeBasedOnHierarchy(propName, type, INITIAL_TREE_PATH, config);
}
- if (checkType == null) {
- return false;
- }
+ if (checkType == null) {
+ return false;
+ }
-// Assertion.isNotNull(checkType.getComponentTypeDefinition(propName), "No component type definition for " + propName + " in component type " + type.getFullName());
- ComponentTypeDefn td = checkType.getComponentTypeDefinition(propName);
+ // Assertion.isNotNull(checkType.getComponentTypeDefinition(propName),
+ // "No component type definition for " + propName +
+ // " in component type " + type.getFullName());
+ ComponentTypeDefn td = checkType.getComponentTypeDefinition(propName);
- if (td.getPropertyDefinition().isMasked()) {
- return true;
- }
+ if (td.getPropertyDefinition().isMasked()) {
+ return true;
+ }
- return false;
- }
+ return false;
+ }
- /**
- * This methods traverses the component type parent or super types heirarchy.
- * This is a recursive method used to traverse the tree.
- * NOTE: the treePath is used to ensure only one path is used and not
- * allow it to cross over and use the other path. An example
- * would be the "Service" component type that has a parent type
- * but is also the super type of all the services.
- *
- */
- private static final int INITIAL_TREE_PATH = -1;
- private static final int PARENT_TREE_PATH = 1;
- private static final int SUPER_TREE_PATH = 2;
+ /**
+ * This methods traverses the component type parent or super types
+ * heirarchy. This is a recursive method used to traverse the tree. NOTE:
+ * the treePath is used to ensure only one path is used and not allow it to
+ * cross over and use the other path. An example would be the "Service"
+ * component type that has a parent type but is also the super type of all
+ * the services.
+ *
+ */
+ private static final int INITIAL_TREE_PATH = -1;
+ private static final int PARENT_TREE_PATH = 1;
+ private static final int SUPER_TREE_PATH = 2;
- private static ComponentType findComponentTypeBasedOnHierarchy(String propName, ComponentType type, int treePath, ConfigurationModelContainerImpl config) throws ConfigurationException {
- ComponentType foundType = null;
+ private static ComponentType findComponentTypeBasedOnHierarchy(
+ String propName, ComponentType type, int treePath,
+ ConfigurationModelContainerImpl config)
+ throws ConfigurationException {
+ ComponentType foundType = null;
-// first try down the parent path to find the definition for the propName
- if ( (treePath == PARENT_TREE_PATH || treePath == INITIAL_TREE_PATH) &&
- type.getParentComponentTypeID() != null) {
+ // first try down the parent path to find the definition for the
+ // propName
+ if ((treePath == PARENT_TREE_PATH || treePath == INITIAL_TREE_PATH)
+ && type.getParentComponentTypeID() != null) {
- foundType = config.getComponentType(type.getParentComponentTypeID().getFullName());
+ foundType = config.getComponentType(type.getParentComponentTypeID()
+ .getFullName());
- // not all parents or supers may be component types, but product types - that have no definitions
- if (foundType != null) {
- // if this parent doesn't contain the definition then goto its parent
+ // not all parents or supers may be component types, but product
+ // types - that have no definitions
+ if (foundType != null) {
+ // if this parent doesn't contain the definition then goto its
+ // parent
if (foundType.getComponentTypeDefinition(propName) != null) {
return foundType;
}
- // dont want to return here because at the intial call of this method
- // and the parent type doesnt have the defn, the super has to be checked
+ // dont want to return here because at the intial call of this
+ // method
+ // and the parent type doesnt have the defn, the super has to be
+ // checked
foundType = findComponentTypeBasedOnHierarchy(propName, foundType, PARENT_TREE_PATH, config);
if (foundType != null) {
return foundType;
}
- }
- }
+ }
+ }
+ if ((treePath == SUPER_TREE_PATH || treePath == INITIAL_TREE_PATH)
+ && type.getSuperComponentTypeID() != null) {
- if ( (treePath == SUPER_TREE_PATH || treePath == INITIAL_TREE_PATH) &&
- type.getSuperComponentTypeID() != null) {
+ foundType = config.getComponentType(type.getSuperComponentTypeID().getFullName());
- foundType = config.getComponentType(type.getSuperComponentTypeID().getFullName());
-
- if (foundType != null) {
- // if this parent doesn't contain the definition then goto its parent
+ if (foundType != null) {
+ // if this parent doesn't contain the definition then goto its
+ // parent
if (foundType.getComponentTypeDefinition(propName) != null) {
return foundType;
}
- foundType = findComponentTypeBasedOnHierarchy(propName, foundType, SUPER_TREE_PATH, config);
+ foundType = findComponentTypeBasedOnHierarchy(propName,foundType, SUPER_TREE_PATH, config);
if (foundType != null) {
return foundType;
}
- }
+ }
- }
+ }
- return foundType;
+ return foundType;
- }
+ }
- private ComponentObject setLastChangedDate(ComponentObject defn, String principal) {
+ private ComponentObject setLastChangedDate(ComponentObject defn,String principal) {
+ String lastChangedDate = DateUtil.getCurrentDateAsString();
+ return BasicUtil.setLastChangedHistory(defn, principal, lastChangedDate);
+ }
- String lastChangedDate = DateUtil.getCurrentDateAsString();
+ private ComponentType setLastChangedDate(ComponentType defn,String principal) {
+ String lastChangedDate = DateUtil.getCurrentDateAsString();
+ return BasicUtil.setLastChangedHistory(defn, principal, lastChangedDate);
+ }
- return BasicUtil.setLastChangedHistory(defn, principal, lastChangedDate);
- }
+ private ComponentObject setCreationDate(ComponentObject defn,String principal) {
- private ComponentType setLastChangedDate(ComponentType defn, String principal) {
+ String creationDate = DateUtil.getCurrentDateAsString();
+ defn = BasicUtil.setLastChangedHistory(defn, principal, creationDate);
+ return BasicUtil.setCreationChangedHistory(defn, principal,creationDate);
+ }
- String lastChangedDate = DateUtil.getCurrentDateAsString();
+ private ComponentType setCreationDate(ComponentType defn, String principal) {
+ String creationDate = DateUtil.getCurrentDateAsString();
+ defn = BasicUtil.setLastChangedHistory(defn, principal, creationDate);
+ return BasicUtil.setCreationChangedHistory(defn, principal,creationDate);
+ }
- return BasicUtil.setLastChangedHistory(defn, principal, lastChangedDate);
- }
+ private Configuration delete(ComponentObjectID targetID,Configuration configuration) {
+ BasicConfiguration basicConfig = (BasicConfiguration) configuration;
+ basicConfig.removeComponentObject(targetID);
+ return basicConfig;
+ }
+ /**
+ * The command to signify setting of an attribute.
+ */
+ public static final int SET = 0;
- private ComponentObject setCreationDate(ComponentObject defn, String principal) {
+ /**
+ * The command to signify addition of an attribute.
+ */
+ public static final int ADD = 1;
- String creationDate = DateUtil.getCurrentDateAsString();
+ /**
+ * The command to signify removal of an attribute.
+ */
+ public static final int REMOVE = 2;
- defn = BasicUtil.setLastChangedHistory(defn, principal, creationDate);
+ private ComponentObject modifyProperties(ComponentObject t, Properties props, int command) {
+ Assertion.isNotNull(t);
- return BasicUtil.setCreationChangedHistory(defn, principal, creationDate);
- }
+ if (props == null) {
+ return t;
+ }
- private ComponentType setCreationDate(ComponentType defn, String principal) {
+ BasicComponentObject target = (BasicComponentObject) t;
+ Properties newProps = null;
- String creationDate = DateUtil.getCurrentDateAsString();
+ switch (command) {
+ case ADD:
+ newProps = new Properties();
+ newProps.putAll(target.getEditableProperties());
+ newProps.putAll(props);
- defn = BasicUtil.setLastChangedHistory(defn, principal, creationDate);
+ target.addProperties(newProps);
- return BasicUtil.setCreationChangedHistory(defn, principal, creationDate);
- }
-
-
- private Configuration delete( ComponentObjectID targetID, Configuration configuration ) throws ConfigurationException {
- //System.out.println("<!><!><!><!>deleting " + target + ", delete dependencies: " + deleteDependencies);
+ break;
+ case REMOVE:
+ newProps = new Properties();
+ newProps.putAll(target.getEditableProperties());
+ Iterator iter = props.keySet().iterator();
+ while (iter.hasNext()) {
+ newProps.remove(iter.next());
+ }
- BasicConfiguration basicConfig = (BasicConfiguration) configuration;
- basicConfig.removeComponentObject( targetID);
+ target.setProperties(newProps);
+ break;
+ case SET:
+ target.setProperties(props);
+ break;
+ }
- return basicConfig;
- }
-
- /**
- * The command to signify setting of an attribute.
- */
- public static final int SET = 0;
+ return target;
- /**
- * The command to signify addition of an attribute.
- */
- public static final int ADD = 1;
+ }
- /**
- * The command to signify removal of an attribute.
- */
- public static final int REMOVE = 2;
- private ComponentObject modifyProperties( ComponentObject t, Properties props, int command ) {
- Assertion.isNotNull(t);
+ private void setRoutingUUID(ServiceComponentDefn serviceComponentDefn,
+ String newRoutingUUID) {
+ Assertion.isNotNull(serviceComponentDefn);
- if (props == null) {
- return t;
- }
-
-
- BasicComponentObject target = (BasicComponentObject) t;
- Properties newProps = null;
-
- switch ( command ) {
- case ADD:
- newProps = new Properties();
- newProps.putAll( target.getEditableProperties() );
- newProps.putAll( props );
-
- target.addProperties(newProps);
-
- break;
- case REMOVE:
- newProps = new Properties();
- newProps.putAll( target.getEditableProperties() );
- Iterator iter = props.keySet().iterator();
- while ( iter.hasNext() ) {
- newProps.remove( iter.next() );
- }
-
- target.setProperties(newProps);
- break;
- case SET:
- target.setProperties(props);
- break;
- }
-
- return target;
-
-
- }
-
- private void setRoutingUUID(ServiceComponentDefn serviceComponentDefn, String newRoutingUUID){
- Assertion.isNotNull(serviceComponentDefn);
-
- BasicServiceComponentDefn basicService = (BasicServiceComponentDefn) serviceComponentDefn;
- basicService.setRoutingUUID(newRoutingUUID);
-
- }
-
+ BasicServiceComponentDefn basicService = (BasicServiceComponentDefn) serviceComponentDefn;
+ basicService.setRoutingUUID(newRoutingUUID);
+ }
}
-
-
-
-
-
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationConnector.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationConnector.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationConnector.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -23,6 +23,7 @@
package com.metamatrix.platform.config.spi.xml;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -46,6 +47,7 @@
import com.metamatrix.common.config.api.SharedResource;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.config.api.exceptions.InvalidComponentException;
+import com.metamatrix.common.config.model.ConfigurationModelContainerImpl;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.transaction.TransactionException;
import com.metamatrix.common.util.LogCommonConstants;
@@ -62,208 +64,44 @@
private String principal;
private XMLConfigurationMgr configurationMgr;
- private Map configurationObjects = new HashMap(3);
+ private ConfigurationModelContainerImpl clonedConfiguration;
+
private XMLActionUpdateStrategy updateStrategy = new XMLActionUpdateStrategy();
- XMLConfigurationConnector(XMLConfigurationMgr configurationMgr, String principal) {
+ XMLConfigurationConnector(XMLConfigurationMgr configurationMgr, ConfigurationModelContainerImpl config, String principal) {
this.configurationMgr = configurationMgr;
this.principal = principal;
+ this.clonedConfiguration = config;
}
/**
- * Returns the name that holds the lock.
- * @return String name who holds the lock
- */
- public String getLockAcquiredBy() {
- return principal;
- }
-
- /**
* Complete the transaction represented by this TransactionObject.
* @throws TransactionException if the transaction is unable to commit.
*/
- public void commit() throws ConfigTransactionException{
- Collection<ConfigurationModelContainer> models = getObjects();
- this.configurationObjects.clear();
- configurationMgr.applyTransaction(models, this.principal);
+ public void commit() throws ConfigurationException {
+ checkState();
+ configurationMgr.applyTransaction(clonedConfiguration, this.principal);
+ this.clonedConfiguration = null;
}
- /**
- * Returns the objects that changed during this transaction
- */
- public Collection getObjects() {
- return new ArrayList(configurationObjects.values());
- }
-
- /**
- * Call to add an object to the set of objects that changed during this
- * transaction.
- * For the configuration process, this object will be
- * @see {ConfigurationModelContainer Configuration}
- * @param key is the id of the configuration
- * @param value is the configuration container
- */
- public void addObjects(Object key, Object value) {
- configurationObjects.put(key, value);
-
- }
-
- /**
- * Returns the objects that changed during this transaction. For
- * the configuration process, these objects will be
- * @see {ConfigurationModelContainer Configurations}.
- * @return Collection of objects that changed during the transaction.
- */
- public Object getObject(Object key) {
- return configurationObjects.get(key);
- }
-
-
- // ------------------------------------------------------------------------------------
- // C O N F I G U R A T I O N I N F O R M A T I O N
- // ------------------------------------------------------------------------------------
-
- /**
- * Returns one of the well-known
- * {@link SystemConfigurationNames system configurations}, either
- * the
- * {@link SystemConfigurationNames#OPERATIONAL operational configuration},
- * the
- * {@link SystemConfigurationNames#NEXT_STARTUP next startup configuration},
- * or the
- * {@link SystemConfigurationNames#STARTUP startup configuration}. Use
- * {@link SystemConfigurationNames} to supply the String parameter.
- * @param designation String indicating which of the system configurations
- * is desired; use one of the {@link SystemConfigurationNames} constants
- * @return the desired Configuration
- * @throws ConfigurationException if an error occurred within or during
- * communication with the Configuration Service.
- */
- public Configuration getDesignatedConfiguration(String designation) throws ConfigurationException{
- return getConfigurationModel(XMLConfigurationMgr.getDesignatedConfigurationID(designation)).getConfiguration();
- }
-
- public ConfigurationModelContainer getConfigurationModel(String configName) throws ConfigurationException {
- return getConfigurationModel(XMLConfigurationMgr.getDesignatedConfigurationID(configName));
- }
-
- public ConfigurationID getDesignatedConfigurationID(String designation) throws ConfigurationException {
- return XMLConfigurationMgr.getDesignatedConfigurationID(designation);
- }
-
- /**
- * Obtain the list of component definition instances that makeup the configuration.
- * @return the list of Component instances
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- */
- public Map getComponentDefinitions(ConfigurationID configurationID) throws ConfigurationException {
- ConfigurationModelContainer config = getConfigurationModel(configurationID);
-
- return config.getConfiguration().getComponentDefns();
- }
- public ConfigurationModelContainer getConfigurationModel(ConfigurationID configurationID) throws ConfigurationException {
- return this.configurationMgr.getConfigurationModel(configurationID);
+ public ConfigurationModelContainerImpl getConfigurationModel() throws ConfigurationException {
+ checkState();
+ return clonedConfiguration;
}
- /**
- * Returns a Collection of {@link com.metamatrix.common.config.api.ResourceDescriptor ResourceDescriptor}
- * for all internal resources defined to the system. The internal resources are not managed with
- * the other configuration related information. They are not dictated based on which configuration
- * they will operate (i.e., next startup or operational);
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- */
- public Collection getResources() throws ConfigurationException {
- ConfigurationModelContainer cmc = getConfigurationModel(Configuration.NEXT_STARTUP_ID);
+ private void checkState() throws ConfigurationException {
+ if (clonedConfiguration == null) {
+ throw new ConfigurationException("Tranaction already commited; Configuration in Invalid State"); //$NON-NLS-1$
+ }
+ }
- return cmc.getResources();
- }
- /**
- * Obtain the component definition
- * @return the ComponentDefn
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- */
- public ComponentDefn getComponentDefinition(ComponentDefnID targetID, ConfigurationID configurationID) throws ConfigurationException{
- if (targetID == null) {
- throw new ConfigurationException(ConfigMessages.CONFIG_0045,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0045,"ComponentDefnID")); //$NON-NLS-1$
- }
- ComponentDefn defn = null;
-
-
- if (configurationID == null) {
- configurationID = getDesignatedConfigurationID(targetID.getParentFullName());
- }
-
- ConfigurationModelContainer config = getConfigurationModel(configurationID);
- defn = config.getConfiguration().getComponentDefn(targetID);
-
- return defn;
- }
-
-
- public Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID) throws ConfigurationException{
- ConfigurationModelContainer config = getConfigurationModel(Configuration.NEXT_STARTUP_ID);
- ComponentType t = config.getComponentType(componentTypeID.getFullName());
- if (t!= null) {
- return t.getComponentTypeDefinitions();
- }
- return Collections.EMPTY_LIST;
- }
-
-
- /**
- * Obtain the list of deployed components that represent the configuration
- * when deployed.
- * @return the list of DeployedComponents
- * @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
- */
- public List getDeployedComponents(ConfigurationID configurationID) throws ConfigurationException{
- ConfigurationModelContainer config = getConfigurationModel(configurationID);
-
-
- Collection dcs = config.getConfiguration().getDeployedComponents();
- List result = new LinkedList();
- result.addAll(dcs);
- return result;
- }
-
- /**
- * Obtain the list of registered host
- * @return Collection of Hosts
- * @throws ConfigurationException if an error occurred within or during communication with the Metadata Service.
- */
- public Collection getHosts() throws ConfigurationException{
- return this.configurationMgr.getConfigurationModel(Configuration.NEXT_STARTUP_ID).getConfiguration().getHosts();
- }
-
- public ComponentType getComponentType(ComponentTypeID id) throws ConfigurationException {
- if ( id == null ) {
- throw new ConfigurationException(ConfigMessages.CONFIG_0127, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0127));
- }
- return this.configurationMgr.getConfigurationModel(Configuration.NEXT_STARTUP_ID).getComponentType(id.getFullName());
- }
-
-
- public Collection getAllComponentTypes(boolean includeDeprecated) throws ConfigurationException {
- ConfigurationModelContainer config = getConfigurationModel(Configuration.NEXT_STARTUP_ID);
-
- Map typeMap = config.getComponentTypes();
- Collection types = new ArrayList(typeMap.size());
- types.addAll(typeMap.values());
- return types;
-
- }
-
- public Collection getAllObjectsForConfigurationModel(ConfigurationID configID) throws ConfigurationException {
- return this.configurationMgr.getConfigurationModel(configID).getAllObjects();
- }
-
// ----------------------------------------------------------------------------------------
// C O N F I G U R A T I O N U P D A T E M E T H O D S
// ----------------------------------------------------------------------------------------
- public Set executeActions( List actions ) throws InvalidComponentException, ConfigurationException {
+ public Set executeActions( List actions ) throws ConfigurationException {
ArgCheck.isNotNull(actions, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0045, "actions")); //$NON-NLS-1$
LogManager.logDetail(LogCommonConstants.CTX_CONFIG, "Executing", actions.size(), "action(s) for principal", principal); //$NON-NLS-1$ //$NON-NLS-2$
@@ -282,64 +120,58 @@
int actionCounter = -1;
// Iterate through the actions, and apply all as a single transaction
- try {
- boolean createObject = false;
+ boolean createObject = false;
- // Get the first action and its target, and add it to the list ...
- Iterator iter = actions.iterator();
- if ( iter.hasNext() ) {
- currentAction = (ActionDefinition) iter.next();
- currentTarget = currentAction.getTarget();
- actionsWithSameTarget.add(currentAction);
+ // Get the first action and its target, and add it to the list ...
+ Iterator iter = actions.iterator();
+ if ( iter.hasNext() ) {
+ currentAction = (ActionDefinition) iter.next();
+ currentTarget = currentAction.getTarget();
+ actionsWithSameTarget.add(currentAction);
+ }
+
+ while ( iter.hasNext() ) {
+ nextAction = (ActionDefinition) iter.next();
+ if ( currentAction instanceof CreateObject ) {
+ createObject = true;
}
-//System.out.println("WRITER: Iterater Actions " + actions.size());
- while ( iter.hasNext() ) {
- nextAction = (ActionDefinition) iter.next();
- if ( currentAction instanceof CreateObject ) {
- createObject = true;
- }
-
- // If the current action is a 'DestroyObject' action, then process only
- // the destroy (other actions not processed up to this point do not
- // need to be processed, since the target will be destroyed anyway).
- if ( currentAction instanceof DestroyObject ) {
- // If creating and destroying an object in the same action list,
- // then don't need to do anything ...
- if ( !createObject ) {
- result.addAll( executeActionsOnTarget( currentTarget,actionsWithSameTarget) );
- }
- actionCounter += actionsWithSameTarget.size();
- actionsWithSameTarget.clear();
- createObject = false;
- currentTarget = nextAction.getTarget();
- }
-
- // Otherwise, if the next action has another target, process up to the current action ...
- else if ( currentTarget != nextAction.getTarget() ) {
-
+ // If the current action is a 'DestroyObject' action, then process only
+ // the destroy (other actions not processed up to this point do not
+ // need to be processed, since the target will be destroyed anyway).
+ if ( currentAction instanceof DestroyObject ) {
+ // If creating and destroying an object in the same action list,
+ // then don't need to do anything ...
+ if ( !createObject ) {
result.addAll( executeActionsOnTarget( currentTarget,actionsWithSameTarget) );
- actionCounter += actionsWithSameTarget.size();
- actionsWithSameTarget.clear();
- createObject = false;
- currentTarget = nextAction.getTarget();
}
-
- // Add this next action ...
- currentAction = nextAction;
- actionsWithSameTarget.add(currentAction);
+ actionCounter += actionsWithSameTarget.size();
+ actionsWithSameTarget.clear();
+ createObject = false;
+ currentTarget = nextAction.getTarget();
}
- // Process the last set of actions ...
- if ( actionsWithSameTarget.size() != 0 ) {
+ // Otherwise, if the next action has another target, process up to the current action ...
+ else if ( currentTarget != nextAction.getTarget() ) {
- result.addAll( executeActionsOnTarget(currentTarget,actionsWithSameTarget) );
+ result.addAll( executeActionsOnTarget( currentTarget,actionsWithSameTarget) );
+ actionCounter += actionsWithSameTarget.size();
+ actionsWithSameTarget.clear();
createObject = false;
+ currentTarget = nextAction.getTarget();
}
- } catch ( Exception e ) {
- throw new ConfigurationException(e);
+ // Add this next action ...
+ currentAction = nextAction;
+ actionsWithSameTarget.add(currentAction);
}
+
+ // Process the last set of actions ...
+ if ( actionsWithSameTarget.size() != 0 ) {
+
+ result.addAll( executeActionsOnTarget(currentTarget,actionsWithSameTarget) );
+ createObject = false;
+ }
LogManager.logInfo(LogCommonConstants.CTX_CONFIG,ConfigPlugin.Util.getString(ConfigMessages.MSG_0007));
return result;
}
@@ -348,13 +180,8 @@
* Executes the specified transactions, which must all be applied to the same target, using
* the specified transaction.
*/
- private Set executeActionsOnTarget( Object target, List actions)
- throws ConfigTransactionException, ConfigurationException {
-
- Set results = updateStrategy.executeActionsOnTarget(target, actions, this);
-
- return results;
-
+ private Set executeActionsOnTarget( Object target, List actions) throws ConfigurationException {
+ return updateStrategy.executeActionsOnTarget(target, actions, clonedConfiguration, this.principal, this);
}
/**
@@ -364,14 +191,17 @@
* @throws ConfigurationException if an error occurred within or during communication with the Configuration Service.
*/
public void saveResources(Collection resourceDescriptors, String principalName) throws ConfigurationException {
-
+ checkState();
for (Iterator it=resourceDescriptors.iterator(); it.hasNext(); ) {
SharedResource rd = (SharedResource) it.next();
ArgCheck.isNotNull(rd, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0130));
- updateStrategy.updateSharedResource(rd, this);
+ updateStrategy.updateSharedResource(rd, clonedConfiguration, principalName);
}
}
+ void setConfigurationModel(ConfigurationModelContainerImpl config) {
+ this.clonedConfiguration = config;
+ }
}
Modified: trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationMgr.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationMgr.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/platform/config/spi/xml/XMLConfigurationMgr.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -22,10 +22,7 @@
package com.metamatrix.platform.config.spi.xml;
-import java.util.Collection;
import java.util.EventObject;
-import java.util.HashMap;
-import java.util.Map;
import java.util.Properties;
import com.metamatrix.common.config.CurrentConfiguration;
@@ -35,6 +32,7 @@
import com.metamatrix.common.config.api.exceptions.ConfigurationConnectionException;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.config.model.ConfigurationModelContainerAdapter;
+import com.metamatrix.common.config.model.ConfigurationModelContainerImpl;
import com.metamatrix.common.config.util.ConfigObjectsNotResolvableException;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.messaging.MessageBus;
@@ -64,7 +62,7 @@
private PersistentConnectionFactory connFactory;
private MessageBus messageBus;
- private Map<String, ConfigurationModelContainer> configs = new HashMap<String, ConfigurationModelContainer>();
+ private ConfigurationModelContainerImpl readOnlyConfig;
private ConfigurationModelContainerAdapter adapter = new ConfigurationModelContainerAdapter();
private XMLConfigurationMgr(Properties properties) throws ConfigurationException {
@@ -112,55 +110,40 @@
}
public XMLConfigurationConnector getTransaction(String principal) throws ConfigurationException {
- XMLConfigurationConnector transaction = new XMLConfigurationConnector(this, principal);
- ConfigurationID configID = XMLConfigurationMgr.getDesignatedConfigurationID(Configuration.NEXT_STARTUP);
- ConfigurationModelContainer transconfig = getConfigurationModelForTransaction(configID);
- transaction.addObjects(configID.getFullName(), transconfig);
- return transaction;
+ return new XMLConfigurationConnector(this, getConfigurationModelForTransaction(Configuration.NEXT_STARTUP_ID), principal);
}
/**
* Returns the configuration for the specified configID.
* {@see Configuration}.
*/
- public synchronized ConfigurationModelContainer getConfigurationModel(ConfigurationID configID) throws ConfigurationException {
- ConfigurationModelContainer cmc = configs.get(configID.getFullName());
+ public synchronized ConfigurationModelContainerImpl getConfigurationModel(ConfigurationID configID) throws ConfigurationException {
- if (cmc == null) {
- cmc = readModel(configID);
+ if (this.readOnlyConfig == null) {
+ PersistentConnection pc = getConnection(true);
- if (cmc == null) {
- throw new ConfigurationException(ConfigMessages.CONFIG_0114,
- ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0114, configID));
+ try {
+ this.readOnlyConfig = (ConfigurationModelContainerImpl)pc.read(configID);
+ } finally {
+ pc.close();
+ }
+
+ if (this.readOnlyConfig == null) {
+ throw new ConfigurationException(ConfigMessages.CONFIG_0114,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0114, configID));
}
- configs.put(cmc.getConfigurationID().getFullName(), cmc);
}
- return cmc;
+ return this.readOnlyConfig;
}
- private ConfigurationModelContainer readModel(ConfigurationID configID) throws ConfigurationException {
- PersistentConnection pc = getConnection(true);
- try {
- return pc.read(configID);
- } finally {
- pc.close();
- }
- }
-
/**
* This method is only used by the XMLConfigurationWriter so that is may obtain
* a model specifically for transaction purposes.
*/
- private ConfigurationModelContainer getConfigurationModelForTransaction(ConfigurationID configID) throws ConfigurationException {
+ private ConfigurationModelContainerImpl getConfigurationModelForTransaction(ConfigurationID configID) throws ConfigurationException {
ConfigurationModelContainer cmc = getConfigurationModel(configID);
-
- if (cmc == null) {
- throw new ConfigurationException(ConfigMessages.CONFIG_0114, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0114, configID));
- }
-
- return (ConfigurationModelContainer)cmc.clone();
+ return (ConfigurationModelContainerImpl)cmc.clone();
}
/**
@@ -168,61 +151,41 @@
* @param transaction is the transaction that contains the object model that changed
* @throws ConfigurationException if a problem occurs setting the configuration.
*/
- synchronized void applyTransaction(Collection<ConfigurationModelContainer> models, String principal) throws ConfigTransactionException {
+ synchronized void applyTransaction(ConfigurationModelContainerImpl cmc, String principal) throws ConfigurationException {
- if (models == null || models.isEmpty()) {
- throw new ConfigTransactionException(ConfigMessages.CONFIG_0119, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0119));
- }
-
PersistentConnection pc = null;
boolean success = false;
try {
- for (ConfigurationModelContainer config : models) {
- try {
-
- //validate the model before saving
- adapter.validateModel(config);
-
- if (pc == null) {
- pc = getConnection(false);
- }
-
- pc.write(config, principal);
- configs.put(config.getConfigurationID().getFullName(), config);
- } catch (ConfigurationException ce) {
- throw new ConfigTransactionException(ce, ConfigMessages.CONFIG_0120, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0120, config.getConfigurationID()));
- } catch (ConfigObjectsNotResolvableException e) {
- throw new ConfigTransactionException(e, ConfigMessages.CONFIG_0120, ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0120, config.getConfigurationID()));
- }
- }
- try {
- pc.commit();
- } catch (ConfigurationException e) {
- throw new ConfigTransactionException(e, e.getMessage());
- }
+ // validate the model before saving
+ adapter.validateModel(cmc);
+
+ cmc = (ConfigurationModelContainerImpl)cmc.clone();
+ pc = getConnection(false);
+ pc.write(cmc, principal);
+
+ pc.commit();
success = true;
+ this.readOnlyConfig = cmc;
+ } catch (ConfigObjectsNotResolvableException e) {
+ throw new ConfigurationException(e, ConfigMessages.CONFIG_0120,ConfigPlugin.Util.getString(ConfigMessages.CONFIG_0120, cmc.getConfigurationID()));
} finally {
try {
if (!success && pc != null) {
- try {
- pc.rollback();
- } catch (ConfigurationException e) {
- throw new ConfigTransactionException(e, e.getMessage());
- }
- }
+ pc.rollback();
+ }
} finally {
pc.close();
}
}
- if (messageBus != null){
- try {
- messageBus.processEvent(new ConfigurationChangeEvent(XMLConfigurationMgr.class.getName(), ConfigurationChangeEvent.CONFIG_REFRESH));
+ if (messageBus != null) {
+ try {
+ messageBus.processEvent(new ConfigurationChangeEvent(XMLConfigurationMgr.class.getName(),ConfigurationChangeEvent.CONFIG_REFRESH));
} catch (MessagingException e) {
- LogManager.logWarning(LogCommonConstants.CTX_CONFIG, e, "Exception sending refresh event"); //$NON-NLS-1$
+ LogManager.logWarning(LogCommonConstants.CTX_CONFIG, e,"Exception sending refresh event"); //$NON-NLS-1$
}
}
- }
+ }
/**
* This method should connect to the persitent storage.
@@ -233,7 +196,7 @@
}
private synchronized void clearCache() {
- configs.clear();
+ this.readOnlyConfig = null;
}
/**
Modified: trunk/server/src/main/java/com/metamatrix/server/Configuration.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/Configuration.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/server/Configuration.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -29,5 +29,5 @@
final String CLUSTERNAME = "ClusterName"; //$NON-NLS-1$
final String LOGFILE = "LogFile"; //$NON-NLS-1$
final String LOGDIR = "LogDir"; //$NON-NLS-1$
-
+ final String UNICAST_PORT = "UnicastPort"; //$NON-NLS-1$
}
Modified: trunk/server/src/main/java/com/metamatrix/server/HostController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/HostController.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/server/HostController.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -353,7 +353,7 @@
java = "java"; //$NON-NLS-1$
}
String java_opts = vmprops.getProperty(VMComponentDefnType.JAVA_OPTS, ""); //$NON-NLS-1$
- java_opts = java_opts + " -Dcom.sun.management.jmxremote " + System.getProperty(VMComponentDefnType.JAVA_OPTS, ""); //$NON-NLS-1$ //$NON-NLS-2$
+ java_opts = java_opts + " -Dcom.sun.management.jmxremote "; //$NON-NLS-1$
java = replaceToken(java, vmprops);
java_opts = replaceToken(java_opts, vmprops);
Modified: trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -22,6 +22,8 @@
package com.metamatrix.server;
+import java.util.Properties;
+
import org.jboss.cache.Cache;
import org.jgroups.mux.Multiplexer;
@@ -81,7 +83,8 @@
bindConstant().annotatedWith(Names.named(Configuration.CLUSTERNAME)).to(systemName);
bindConstant().annotatedWith(Names.named(Configuration.LOGFILE)).to(StringUtil.replaceAll(host.getFullName(), ".", "_")+"_hc.log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
bindConstant().annotatedWith(Names.named(Configuration.LOGDIR)).to(host.getLogDirectory());
-
+ bindConstant().annotatedWith(Names.named(Configuration.UNICAST_PORT)).to(5555);
+
Names.bindProperties(binder(), CurrentConfiguration.getInstance().getProperties());
bind(Multiplexer.class).toProvider(JGroupsProvider.class).in(Scopes.SINGLETON);
@@ -92,5 +95,4 @@
bind(MessageBus.class).to(JGroupsMessageBus.class).in(Scopes.SINGLETON); // VM Message bus is in common-internal
bind(HostMonitor.class).in(Scopes.SINGLETON);
}
-
}
Modified: trunk/server/src/main/java/com/metamatrix/server/JGroupsProvider.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/JGroupsProvider.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/server/JGroupsProvider.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -23,7 +23,9 @@
package com.metamatrix.server;
import java.lang.management.ManagementFactory;
+import java.util.Collection;
import java.util.Properties;
+import java.util.StringTokenizer;
import javax.management.MBeanRegistrationException;
import javax.management.MBeanServer;
@@ -35,10 +37,16 @@
import org.jgroups.JChannel;
import org.jgroups.mux.Multiplexer;
+import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import com.google.inject.name.Named;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.ResourceNames;
+import com.metamatrix.common.config.api.Host;
+import com.metamatrix.common.config.api.HostID;
+import com.metamatrix.common.config.api.VMComponentDefn;
+import com.metamatrix.common.config.api.VMComponentDefnType;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.util.LogCommonConstants;
@@ -51,19 +59,10 @@
@Singleton
public class JGroupsProvider implements Provider<org.jgroups.mux.Multiplexer> {
- // Default Multicast Property values
- private static final String DEFAULT_UDP_MCAST_SUPPORTED = "true"; //$NON-NLS-1$
+ public static final String TCP = "tcp"; //$NON-NLS-1$
private static final String DEFAULT_UDP_MCAST_ADDR_PREFIX = "224."; //$NON-NLS-1$
- private static final String DEFAULT_UDP_MCAST_PORT = "5555"; //$NON-NLS-1$
private static final String ALL_INTERFACES_ADDR = "0.0.0.0"; //$NON-NLS-1$
- // Default Gossip Server Property values
- private static final String DEFAULT_PING_GOSSIP_HOST = "localhost"; //$NON-NLS-1$
- private static final String DEFAULT_PING_GOSSIP_PORT = "5555"; //$NON-NLS-1$
- private static final String DEFAULT_PING_GOSSIP_REFRESH = "15000"; //$NON-NLS-1$
- private static final String DEFAULT_PING_TIMEOUT = "2000"; //$NON-NLS-1$
- private static final String DEFAULT_PING_NUM_INITIAL_MEMBERS = "3"; //$NON-NLS-1$
-
private static final String DEFAULT_JGROUPS_OTHER_SETTINGS =
"MERGE2(min_interval=5000;max_interval=10000):" + //$NON-NLS-1$
"FD_SOCK:" + //$NON-NLS-1$
@@ -78,18 +77,25 @@
private static final String ENCRYPT_ALL = ":ENCRYPT(key_store_name=teiid.keystore;store_password=changeit;alias=cluster_key)"; //$NON-NLS-1$
private static final String ENCRYPT_ALL_KEY = "metamatrix.encryption.internal.secure.sockets"; //$NON-NLS-1$
+
+ public enum Protocol { UNICAST_TCP, UNICAST_UDP, MULTICAST}
- private static final String UDP_MCAST_SUPPORTED_PROPERTY = "udp.multicast_supported"; //$NON-NLS-1$
- private static final String UDP_MCAST_MESSAGEBUS_PORT_PROPERTY = "udp.mcast_messagebus_port"; //$NON-NLS-1$
- private static final String UDP_MCAST_ADDR_PROPERTY = "udp.mcast_addr"; //$NON-NLS-1$
- private static final String PING_GOSSIP_HOST_PROPERTY = "ping.gossip_host"; //$NON-NLS-1$
- private static final String PING_GOSSIP_PORT_PROPERTY = "ping.gossip_port"; //$NON-NLS-1$
- private static final String PING_GOSSIP_REFRESH_PROPERTY = "ping.gossip_refresh"; //$NON-NLS-1$
- private static final String PING_GOSSIP_TIMEOUT_PROPERTY = "ping.gossip_timout"; //$NON-NLS-1$
- private static final String PING_GOSSIP_NUM_INITIAL_MEMBERS_PROPERTY = "ping.gossip_initialmembers"; //$NON-NLS-1$
+ public static final String CLUSTER_PROTOCOL = "cluster.protocol"; //$NON-NLS-1$
+ private static final String CLUSTER_MULTICAST_PORT = "cluster.port"; //$NON-NLS-1$
+ private static final String CLUSTER_MULTICAST_ADDRESS = "cluster.multicast.address"; //$NON-NLS-1$
+ private static final String CLUSTER_PING = "cluster.unicast.ping"; //$NON-NLS-1$
+ private static final String CLUSTER_TIMEOUT = "cluster.unicast.timout"; //$NON-NLS-1$
private static final String JGROUPS_OTHER_SETTINGS_PROPERTY = "jgroups.other.channel.settings"; //$NON-NLS-1$
private static final String BIND_ADDRESS_PROPERTY = "jgroups.bind.address"; //$NON-NLS-1$
+
+ private int unicastPort;
+
+ @Inject
+ public JGroupsProvider((a)Named(Configuration.UNICAST_PORT) int port) {
+ this.unicastPort = port;
+ }
+
/**
* Helper method to create a JChannel.
* Properties needed to create the JChannel are read from current configuration.
@@ -130,51 +136,53 @@
Properties configProps = CurrentConfiguration.getInstance().getResourceProperties(ResourceNames.JGROUPS);
boolean useEncrypt = PropertiesUtils.getBooleanProperty(CurrentConfiguration.getInstance().getProperties(), ENCRYPT_ALL_KEY, false);
- String udpMulticastSupported = configProps.getProperty(UDP_MCAST_SUPPORTED_PROPERTY, DEFAULT_UDP_MCAST_SUPPORTED);
-
- String udpMulticastPort = configProps.getProperty(UDP_MCAST_MESSAGEBUS_PORT_PROPERTY, DEFAULT_UDP_MCAST_PORT);
- String pingGossipHost = configProps.getProperty(PING_GOSSIP_HOST_PROPERTY, DEFAULT_PING_GOSSIP_HOST);
- String pingGossipPort = configProps.getProperty(PING_GOSSIP_PORT_PROPERTY, DEFAULT_PING_GOSSIP_PORT);
- String pingGossipRerefresh = configProps.getProperty(PING_GOSSIP_REFRESH_PROPERTY, DEFAULT_PING_GOSSIP_REFRESH);
- String pingTimeout = configProps.getProperty(PING_GOSSIP_TIMEOUT_PROPERTY, DEFAULT_PING_TIMEOUT);
- String pingInitialMemberCount = configProps.getProperty(PING_GOSSIP_NUM_INITIAL_MEMBERS_PROPERTY, DEFAULT_PING_NUM_INITIAL_MEMBERS);
+
+ Protocol protocol = Protocol.valueOf(configProps.getProperty(CLUSTER_PROTOCOL, Protocol.UNICAST_TCP.toString()));
+ boolean useMulticast = (protocol == Protocol.MULTICAST);
+
+ String multicastPort = configProps.getProperty(CLUSTER_MULTICAST_PORT, "5555"); //$NON-NLS-1$
+ String pingGossipRerefresh = configProps.getProperty(CLUSTER_PING, "10000"); //$NON-NLS-1$ 10 secs
+ String pingTimeout = configProps.getProperty(CLUSTER_TIMEOUT, "2000"); //$NON-NLS-1$ 2 secs
String otherSettings = configProps.getProperty(JGROUPS_OTHER_SETTINGS_PROPERTY, DEFAULT_JGROUPS_OTHER_SETTINGS);
-
+ String unicastMembers = CurrentConfiguration.getInstance().getProperties().getProperty(CurrentConfiguration.CLUSTER_MEMBERS);
+
String bindAddress = getBindAddress();
boolean multicastOnAllInterfaces = bindAddress.equalsIgnoreCase(ALL_INTERFACES_ADDR);
-
- String udpMulticastAddress = configProps.getProperty(UDP_MCAST_ADDR_PROPERTY);
- if (udpMulticastAddress == null || udpMulticastAddress.length() == 0) {
- String currentAddr = CurrentConfiguration.getInstance().getBindAddress();
- if (currentAddr.indexOf('.') != -1) {
- String lastNode = currentAddr.substring(currentAddr.indexOf('.')+1);
- udpMulticastAddress = DEFAULT_UDP_MCAST_ADDR_PREFIX + lastNode;
- }
- else {
- throw new ConfigurationException("Failed to set default multicast address"); //$NON-NLS-1$
- }
- }
+ String clusterAddress = configProps.getProperty(CLUSTER_MULTICAST_ADDRESS);
- if (udpMulticastSupported.equalsIgnoreCase("true")) { //$NON-NLS-1$
+ if (useMulticast) {
if (multicastOnAllInterfaces) {
properties =
- "UDP(mcast_addr="+udpMulticastAddress+";mcast_port="+udpMulticastPort+";ip_ttl=32;receive_on_all_interfaces=" + udpMulticastSupported.toString() + ";" + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "UDP(mcast_addr="+clusterAddress+";mcast_port="+multicastPort+";ip_ttl=32;receive_on_all_interfaces=true;" + //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
"mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" + //$NON-NLS-1$
- "PING(timeout="+pingTimeout+";num_initial_members="+pingInitialMemberCount+"):";//$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
-
-
+ "PING(timeout="+pingTimeout+";):";//$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logInfo(LogCommonConstants.CTX_MESSAGE_BUS, "JGroups using multicast on all available interfaces"); //$NON-NLS-1$
} else {
+ clusterAddress = getMulticastAddress(clusterAddress, bindAddress);
properties =
- "UDP(mcast_addr="+udpMulticastAddress+";mcast_port="+udpMulticastPort+";ip_ttl=32;bind_addr="+bindAddress+";"+ //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "UDP(mcast_addr="+clusterAddress+";mcast_port="+multicastPort+";ip_ttl=32;bind_addr="+bindAddress+";"+ //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" + //$NON-NLS-1$
- "PING(timeout="+pingTimeout+";num_initial_members="+pingInitialMemberCount+"):";//$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+ "PING(timeout="+pingTimeout+";):";//$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logInfo(LogCommonConstants.CTX_MESSAGE_BUS, "JGroups using multicast with address "+clusterAddress+ " and port "+ multicastPort); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
- properties =
- "UDP(ip_mcast=false;mcast_addr="+udpMulticastAddress+";mcast_port="+udpMulticastPort+";bind_addr="+bindAddress+"):" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "PING(gossip_host="+pingGossipHost+";gossip_port="+pingGossipPort+";gossip_refresh="+pingGossipRerefresh+";" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "timeout="+pingTimeout+";num_initial_members="+pingInitialMemberCount+"):"; //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+ if (protocol == Protocol.UNICAST_UDP) {
+ clusterAddress = getMulticastAddress(clusterAddress, bindAddress);
+ properties =
+ "UDP(ip_mcast=false;mcast_addr="+clusterAddress+";mcast_port="+multicastPort+";bind_addr="+bindAddress+"):" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "PING(gossip_host="+getGossipHost(unicastMembers)+";gossip_port="+getGossipPort(unicastMembers)+";gossip_refresh="+pingGossipRerefresh+";" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "timeout="+pingTimeout+";):"; //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logInfo(LogCommonConstants.CTX_MESSAGE_BUS, "JGroups using Unicast with UDP with gossip host"+getGossipHost(unicastMembers)+ " and port "+ getGossipPort(unicastMembers)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else {
+ String resolvedClusterMemebers = resolveClusterMembers(unicastMembers);
+ properties = "TCP(start_port="+this.unicastPort+";port_range=0;bind_addr="+bindAddress+";loopback=true;skip_suspected_members=true;discard_incompatible_packets=true;sock_conn_timeout=3000;use_concurrent_stack=true;):" + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "TCPPING(initial_hosts="+resolvedClusterMemebers+";port_range=1;timeout="+pingTimeout+"):" +//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "pbcast.FLUSH(timeout=60000)"; //$NON-NLS-1$
+ LogManager.logInfo(LogCommonConstants.CTX_MESSAGE_BUS, "JGroups using Unicast with TCP with initial members configured as "+ resolvedClusterMemebers + " with local process port "+this.unicastPort); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
+
properties += otherSettings;
if (useEncrypt) {
properties += ENCRYPT_ALL;
@@ -187,11 +195,7 @@
}
private final String getBindAddress() {
- // check for command line system property being set from vm.starter.command for jgroup
- String bindAddress = System.getProperty(JGroupsProvider.BIND_ADDRESS_PROPERTY);
- if (bindAddress == null) {
- bindAddress = CurrentConfiguration.getInstance().getBindAddress();
- }
+ String bindAddress = CurrentConfiguration.getInstance().getBindAddress();
if (bindAddress == null) {
LogManager.logWarning(LogCommonConstants.CTX_MESSAGE_BUS,"WARNING: Unable to set " + JGroupsProvider.BIND_ADDRESS_PROPERTY + ", will set to 127.0.0.1"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -199,4 +203,71 @@
}
return bindAddress;
}
+
+ private String getMulticastAddress(String clusterAddress, String bindAddress){
+ if (clusterAddress == null || clusterAddress.length() == 0) {
+ if (bindAddress.indexOf('.') != -1) {
+ String lastNode = bindAddress.substring(bindAddress.indexOf('.')+1);
+ return DEFAULT_UDP_MCAST_ADDR_PREFIX + lastNode;
+ }
+ }
+ return clusterAddress;
+ }
+
+ private String getGossipHost(String clusterMembers) {
+ StringTokenizer st = new StringTokenizer(clusterMembers, ","); //$NON-NLS-1$
+ // the string must be in the format "hostA[port]"
+ String hostPort = st.nextToken();
+ int idx = hostPort.indexOf('[');
+ if (idx == -1) {
+ throw new MetaMatrixRuntimeException("Gossip Router information is not specified correctly. This must property must be in the form 'gossipHost[port]'"); //$NON-NLS-1$
+ }
+ return hostPort.substring(0, idx);
+ }
+
+ private String getGossipPort(String clusterMembers) {
+ StringTokenizer st = new StringTokenizer(clusterMembers, ","); //$NON-NLS-1$
+ // the string must be in the format "hostA[port]"
+ String hostPort = st.nextToken();
+ return hostPort.substring(hostPort.indexOf('[')+1, hostPort.lastIndexOf(']'));
+ }
+
+ String resolveClusterMembers(String members) {
+ try {
+ com.metamatrix.common.config.api.Configuration config = CurrentConfiguration.getInstance().getConfiguration();
+ if (members != null && members.trim().length() > 0) {
+ StringBuilder sb = new StringBuilder();
+ StringTokenizer st = new StringTokenizer(members.trim(), ","); //$NON-NLS-1$
+
+ while(st.hasMoreTokens()) {
+ String member = st.nextToken();
+ int idx = member.indexOf('|');
+ if (idx != -1) {
+ String hostConfigName = member.substring(0, idx);
+ String hostAddr = member.substring(idx+1);
+
+ Host host = config.getHost(hostConfigName);
+ if (host != null) {
+ Collection<VMComponentDefn> allProcesses = config.getVMsForHost((HostID)host.getID());
+ for (VMComponentDefn process:allProcesses) {
+ String strPort = process.getProperty(VMComponentDefnType.CLUSTER_PORT);
+ if (strPort != null && strPort.length() > 0) {
+ sb.append(hostAddr).append("[").append(Integer.parseInt(strPort)).append("],"); //$NON-NLS-1$ //$NON-NLS-2$
+ // this for host controller; will be removed when the hostcontroller is no longer
+ // be a member.
+ sb.append(hostAddr).append("[").append(5556).append("],"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ }
+ }
+ return sb.toString();
+ }
+ } catch (ConfigurationException e) {
+ throw new MetaMatrixRuntimeException(e);
+ } catch (NumberFormatException e) {
+ throw new MetaMatrixRuntimeException(e);
+ }
+ return ""; //$NON-NLS-1$
+ }
}
Modified: trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -22,6 +22,10 @@
package com.metamatrix.server;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
import org.jboss.cache.Cache;
import org.jgroups.mux.Multiplexer;
import org.teiid.dqp.internal.cache.DQPContextCache;
@@ -34,11 +38,15 @@
import com.metamatrix.common.comm.platform.socket.SocketVMController;
import com.metamatrix.common.config.CurrentConfiguration;
import com.metamatrix.common.config.api.Host;
+import com.metamatrix.common.config.api.HostID;
+import com.metamatrix.common.config.api.VMComponentDefn;
+import com.metamatrix.common.config.api.VMComponentDefnType;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
import com.metamatrix.common.log.LogConfiguration;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.messaging.MessageBus;
import com.metamatrix.common.messaging.jgroups.JGroupsMessageBus;
+import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.log.LogListener;
import com.metamatrix.core.util.StringUtil;
import com.metamatrix.platform.registry.ClusteredRegistryState;
@@ -49,7 +57,7 @@
import com.metamatrix.platform.vm.controller.ServerEvents;
class ServerGuiceModule extends AbstractModule {
-
+
Host host;
String processName;
@@ -74,7 +82,8 @@
bindConstant().annotatedWith(Names.named(Configuration.CLUSTERNAME)).to(systemName);
bindConstant().annotatedWith(Names.named(Configuration.LOGFILE)).to(StringUtil.replaceAll(host.getFullName(), ".", "_")+"_"+this.processName+".log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
bindConstant().annotatedWith(Names.named(Configuration.LOGDIR)).to(host.getLogDirectory());
-
+ bindConstant().annotatedWith(Names.named(Configuration.UNICAST_PORT)).to(getUnicastClusterPort());
+
Names.bindProperties(binder(), CurrentConfiguration.getInstance().getProperties());
bind(Multiplexer.class).toProvider(JGroupsProvider.class).in(Scopes.SINGLETON);
@@ -100,5 +109,20 @@
binder().requestStaticInjection(LogManager.class);
}
-
+
+ int getUnicastClusterPort() {
+ try {
+ com.metamatrix.common.config.api.Configuration config = CurrentConfiguration.getInstance().getConfiguration();
+ VMComponentDefn process = config.getVMForHost(this.host.getFullName(), this.processName);
+ String strPort = process.getProperties().getProperty(VMComponentDefnType.CLUSTER_PORT);
+ if (strPort != null && strPort.length() > 0) {
+ return Integer.parseInt(strPort);
+ }
+ } catch (ConfigurationException e) {
+ throw new MetaMatrixRuntimeException(e);
+ } catch (NumberFormatException e) {
+ throw new MetaMatrixRuntimeException(e);
+ }
+ return 5555;
+ }
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -440,8 +440,7 @@
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#executeTransaction(com.metamatrix.common.actions.ActionDefinition, java.lang.String)
*/
public Set executeTransaction(ActionDefinition action,
- String principalName) throws ModificationException,
- ConfigurationException {
+ String principalName) throws ConfigurationException {
return null;
}
@@ -449,8 +448,7 @@
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#executeTransaction(java.util.List, java.lang.String)
*/
public Set executeTransaction(List actions,
- String principalName) throws ModificationException,
- ConfigurationException {
+ String principalName) throws ConfigurationException {
if (actions != null) {
for (Iterator it=actions.iterator(); it.hasNext();) {
Object o = it.next();
@@ -564,8 +562,7 @@
*/
public Object modify(ComponentObject theObject,
Properties theProperties,
- String principalName) throws ConfigurationException,
- ModificationException {
+ String principalName) throws ConfigurationException{
return null;
}
@@ -638,16 +635,14 @@
*/
public void delete(ComponentObject theObject,
boolean theDeleteDependenciesFlag,
- String principalName) throws ConfigurationException,
- ModificationException {
+ String principalName) throws ConfigurationException {
}
/**
* @see com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#delete(com.metamatrix.common.config.api.ComponentType, java.lang.String)
*/
public void delete(ComponentType componentType,
- String principalName) throws ConfigurationException,
- ModificationException{
+ String principalName) throws ConfigurationException{
}
@@ -656,7 +651,7 @@
@Override
public DeployedComponent deployService(VMComponentDefnID theProcessID,
String serviceName, String principalName)
- throws ConfigurationException, ModificationException {
+ throws ConfigurationException{
// TODO Auto-generated method stub
return null;
}
Modified: trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigImportExport.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigImportExport.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigImportExport.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -126,107 +126,12 @@
pc.close();
}
-
-
- /**
- * This test the Console process for importing a new binding
-
- public void testImportConnector() throws Exception {
- printMsg("Starting testImportConnector"); //$NON-NLS-1$
-
- // file should not have the example connector in it
-// initializeConfig(CONFIG_WITH_CONNECTOR_FILE);
- initializeConfig(CONFIG_FILE);
- this.initTransactions(new Properties());
-
-
- helperImportConnectorType();
- helperImportConnectorBinding(CDK_FILE);
-
- printMsg("Completed testImportConnector"); //$NON-NLS-1$
-
- }
- */
-// public void testImportJDBCConnector() {
-// printMsg("Starting testImportJDBCConnector"); //$NON-NLS-1$
-//
-// try {
-// // file should not have the example connector in it
-// initializeConfig(CONFIG_FILE);
-//
-// helperImportConnectorBinding(JDBC_FILE);
-// } catch (Exception e) {
-// // e.printStackTrace();
-//
-// fail(e.getMessage());
-// }
-//
-// printMsg("Completed testImportJDBCConnector"); //$NON-NLS-1$
-//
-// }
-
-
- private void helperImportConnectorType() throws Exception {
- printMsg("Starting helperImportConnectorType"); //$NON-NLS-1$
-
-// initializeConfig(CONFIG_FILE);
-
-
- // XMLConfigurationConnector writer = (XMLConfigurationConnector) factory.createTransaction(conn, false);
-
- File cdkFile = new File(getPath(), CDK_FILE);
-
-
- InputStream inputStream = readFile(cdkFile.getPath());
-
-
- XMLConfigurationImportExportUtility io = new XMLConfigurationImportExportUtility();
-
-
- // ConfigurationObjectEditor editor = new BasicConfigurationObjectEditor(true);
-
- ComponentType type = io.importComponentType(inputStream, getEditor(), null);
-
-
-// editor.getDestination().popActions();
-
-// editor.createComponentType(type);
-
- commit();
-
-
-// List actions = editor.getDestination().popActions();
-//
-// printMsg("Executing # of Actions: " + actions.size()); //$NON-NLS-1$
-//
-// try {
-// writer.executeActions(actions, PRINCIPAL);
-//
-//
-// writer.commit();
-// } catch (Exception e) {
-// writer.rollback();
-// throw e;
-// }
-
- ComponentType newType = getWriter().getComponentType((ComponentTypeID) type.getID());
- if (newType == null) {
- fail("Import of connector type " + type.getID() + " was not successfull."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- HelperTestConfiguration.validateComponentType(newType);
-
- printMsg("Completed helperImportConnectorType"); //$NON-NLS-1$
-
- }
-
/**
* This test the import operation that the console will be doing
* when importing a new configuration
*/
private void helperImportConnectorBinding(String file) throws Exception {
printMsg("Starting helperImportConnectorBinding"); //$NON-NLS-1$
-
-// XMLConfigurationConnector writer = (XMLConfigurationConnector) factory.createTransaction(conn, false);
File connFile = new File(getPath(), file);
@@ -244,55 +149,20 @@
if (defn == null) {
fail("No connector binding was imported"); //$NON-NLS-1$
}
-
-// ConfigurationObjectEditor reditor = new BasicConfigurationObjectEditor(true);
- ConfigurationModelContainer config = getWriter().getConfigurationModel(Configuration.NEXT_STARTUP);
+ ConfigurationModelContainer config = getWriter().getConfigurationModel();
-
-
-
-
ConnectorBinding newdefn = getEditor().createConnectorComponent(Configuration.NEXT_STARTUP_ID, defn, defn.getFullName(), defn.getRoutingUUID());
-// reditor.setEnabled(newdefn, true);
commit();
- // ProductServiceConfig psc = com.metamatrix.common.config.util.ConfigUtil.getFirstDeployedConnectorProductTypePSC(config);
-
-// ProductServiceConfigID pscID = null;
-
-// ComponentDefn defn = null;
-// if (psc != null) {
-// pscID = (ProductServiceConfigID)psc.getID();
-//
-// } else {
-// psc = helperTestAddPSC("TestPSC_" + String.valueOf( (new Date()).getTime()), (ServiceComponentDefnID) newdefn.getID(), Configuration.NEXT_STARTUP_ID ); //$NON-NLS-1$
-// pscID = (ProductServiceConfigID)psc.getID();
-//
-// }
- // add to the psc, but does not deploy
- // psc = getEditor().addServiceComponentDefn(psc, (ServiceComponentDefnID) newdefn.getID());
VMComponentDefn vmdefn = (VMComponentDefn) config.getConfiguration().getVMComponentDefns().iterator().next();
// deploys the binding if the psc is deployed
getEditor().deployServiceDefn(config.getConfiguration(), newdefn, (VMComponentDefnID) vmdefn.getID());
commit();
-// List actions = reditor.getDestination().popActions();
-//
-//
-// printMsg("Executing # of Actions: " + actions.size() + " for # of Connector: " + newdefn.getFullName()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// try {
-// writer.executeActions(actions, PRINCIPAL);
-//
-// writer.commit();
-// } catch (Exception e) {
-// writer.rollback();
-// throw e;
-// }
- ConnectorBinding newDefn = (ConnectorBinding) getWriter().getComponentDefinition((ComponentDefnID) defn.getID(), Configuration.NEXT_STARTUP_ID);
+ ConnectorBinding newDefn = (ConnectorBinding) getWriter().getConfigurationModel().getConfiguration().getComponentDefn((ComponentDefnID)defn.getID());
if (newDefn == null) {
fail("Import of connector binding was not successfull, no obect found when reading."); //$NON-NLS-1$
}
@@ -303,100 +173,6 @@
}
-
-//
-// private ProductServiceConfig helperTestAddPSC(String pscName, ServiceComponentDefnID id, ConfigurationID configID) {
-// printMsg("Starting helperTestAddPSC"); //$NON-NLS-1$
-// ProductServiceConfig newDefn = null;
-// try {
-//
-//
-// Configuration config = this.getConfigModel().getConfiguration();
-//
-// Collection types = this.getConfigModel().getProductTypes();
-//
-// ConnectorBinding defn = config.getConnectorBinding(id) ;
-//
-// newDefn = addPSC(pscName, defn, config, types, getEditor());
-//
-//
-// printMsg("helperTestAddPSC actions committed"); //$NON-NLS-1$
-//
-//
-// HelperTestConfiguration.validateComponentDefn(newDefn);
-//
-//// ConfigurationPrinter.printComponentObject(h, false, System.out);
-//
-//
-//
-// } catch (Exception e) {
-// e.printStackTrace();
-// fail(e.getMessage());
-// }
-// printMsg("Completed helperTestAddPSC"); //$NON-NLS-1$
-// return newDefn;
-// }
-
-
-// private ProductServiceConfig addPSC(String name, ServiceComponentDefn svc, Configuration config, Collection types, BasicConfigurationObjectEditor editor) throws Exception {
-//
-// ProductType connType = BasicProductType.PRODUCT_TYPE;
-//
-//
-// printMsg("addPSC found product type " + connType.getFullName()); //$NON-NLS-1$
-//
-// ProductServiceConfig newPSC = getEditor().createProductServiceConfig((ConfigurationID) config.getID(), (ProductTypeID) connType.getID(), name);
-//
-// if (newPSC == null) {
-// throw new ConfigurationException("AddPSC Error - editor is unable to create new PSC " + name + " of type " + connType.getFullName()); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-//
-// newPSC = (ProductServiceConfig) getEditor().setLastChangedHistory(newPSC, PRINCIPAL, DateUtil.getCurrentDateAsString());
-// newPSC = (ProductServiceConfig) getEditor().setCreationChangedHistory(newPSC, PRINCIPAL, DateUtil.getCurrentDateAsString());
-//
-// printMsg("addPSC created new PSC " + newPSC.getFullName()); //$NON-NLS-1$
-//
-// this.getEditor().addServiceComponentDefn(config, newPSC, (ServiceComponentDefnID) svc.getID());
-// printMsg("addPSC add service to PSC "); //$NON-NLS-1$
-//
-// commit();
-//
-// ProductServiceConfig psc = CurrentConfiguration.getInstance().getConfiguration().getPSC((ProductServiceConfigID) newPSC.getID());
-// assertNotNull(psc);
-//
-// return newPSC;
-// }
-
-
-// public ProductType findProductType(String name, Collection types) {
-// ProductType connType = null;
-// for (Iterator it=types.iterator(); it.hasNext(); ) {
-// connType = (ProductType) it.next();
-// if (connType.getFullName().equals(name)) {
-// return connType;
-// }
-//
-// connType = null;
-// }
-//
-// return connType;
-// }
-
-
-
-// private boolean compare(String fileName1, ConfigurationID id1, String fileName2, ConfigurationID id2, String logFile) throws Exception {
-//
-// ConfigurationModelContainer model1 = TestFilePersistence.readModel(fileName1, id1);
-//
-// ConfigurationModelContainer model2 = TestFilePersistence.readModel(fileName2, id2);
-//
-//
-// boolean isEqual = TestFilePersistence.compareModels(model1, model2, logFile);
-//
-// return isEqual;
-//
-// }
-
private InputStream readFile(String fileName) throws ConfigurationException {
InputStream inputStream = null;
@@ -414,20 +190,6 @@
}
}
-// private void designateNextStartupConfiguration(Collection configObjects,
-// ConfigurationObjectEditor editor) throws Exception{
-// Iterator iterator = configObjects.iterator();
-// while (iterator.hasNext()) {
-// Object obj = iterator.next();
-// if (obj instanceof Configuration) {
-// Configuration config = (Configuration)obj;
-// ConfigurationID configID = (ConfigurationID)config.getID();
-// editor.setNextStartupConfiguration(configID);
-// }
-// }
-// }
-
-
}
Modified: trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigReader.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigReader.java 2009-05-05 18:01:19 UTC (rev 863)
+++ trunk/server/src/test/java/com/metamatrix/platform/config/spi/xml/TestXMLConfigReader.java 2009-05-05 19:09:01 UTC (rev 864)
@@ -57,7 +57,7 @@
XMLConfigurationConnector reader = XMLConfigurationMgr.getInstance().getTransaction(PRINCIPAL);
printMsg("Validate ComponentTypes Exists"); //$NON-NLS-1$
- Collection compTypes = reader.getAllComponentTypes(true);
+ Collection compTypes = reader.getConfigurationModel().getComponentTypes().values();
HelperTestConfiguration.validateComponentTypes(compTypes);
@@ -81,15 +81,15 @@
}
printMsg("Validate Resources Exists"); //$NON-NLS-1$
- Collection resources = reader.getResources();
+ Collection resources = reader.getConfigurationModel().getResources();
HelperTestConfiguration.validateResources(resources);
printMsg("Validate NextStartup Config"); //$NON-NLS-1$
- Configuration ns = reader.getDesignatedConfiguration(Configuration.NEXT_STARTUP);
+ Configuration ns = reader.getConfigurationModel().getConfiguration();
- HelperTestConfiguration.validateConfigContents(ns);
+// HelperTestConfiguration.validateConfigContents(ns);
int cnt = 0;
Collection bindingsCollection = ns.getConnectorBindings();
@@ -106,7 +106,7 @@
printMsg("Validate Hosts"); //$NON-NLS-1$
- Collection hosts = reader.getHosts();
+ Collection hosts = reader.getConfigurationModel().getConfiguration().getHosts();
HelperTestConfiguration.validateHosts(hosts);
}
15 years, 7 months
teiid SVN: r863 - trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base.
by teiid-commits@lists.jboss.org
Author: jdoyle
Date: 2009-05-05 14:01:19 -0400 (Tue, 05 May 2009)
New Revision: 863
Modified:
trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/ParameterDescriptor.java
Log:
TEIID-551.
XML-Relational relational request-response joins fail and produce no result.
Modified: trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/ParameterDescriptor.java
===================================================================
--- trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/ParameterDescriptor.java 2009-05-05 17:05:16 UTC (rev 862)
+++ trunk/connectors/connector-xml/src/main/java/com/metamatrix/connector/xml/base/ParameterDescriptor.java 2009-05-05 18:01:19 UTC (rev 863)
@@ -20,15 +20,13 @@
* 02110-1301 USA.
*/
-
package com.metamatrix.connector.xml.base;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.metadata.runtime.Element;
-
public abstract class ParameterDescriptor {
-
+
private String m_xPath;
private boolean m_param;
private boolean m_responseId;
@@ -36,124 +34,123 @@
private String m_columnName;
private int m_columnNumber = -1;
private Element m_element;
-
+
public static final String PARM_INPUT_COLUMN_PROPERTY_NAME = "IsInputParameter"; //$NON-NLS-1$
public static final String ROLE_COLUMN_PROPERTY_NAME = "Role"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN = "Response In"; //$NON-NLS-1$
- public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT = "Response Out"; //$NON-NLS-1$
+ public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN = "ResponseIn"; //$NON-NLS-1$
+ public static final String ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT = "ResponseOut"; //$NON-NLS-1$
public static final String ROLE_COLUMN_PROPERTY_NAME_LOCATION = "Location"; //$NON-NLS-1$
public static final String ROLE_COLUMN_PROPERTY_NAME_DATA = "Data"; //$NON-NLS-1$
- public ParameterDescriptor(Element element) throws ConnectorException {
- setElement(element);
+ public ParameterDescriptor( Element element ) throws ConnectorException {
+ setElement(element);
setIsParameter(testForParam(m_element));
testRole();
- if(getElement().getNameInSource() != null) {
- setColumnName(getElement().getNameInSource());
+ if (getElement().getNameInSource() != null) {
+ setColumnName(getElement().getNameInSource());
} else {
- setColumnName(getElement().getName().trim());
+ setColumnName(getElement().getName().trim());
}
- String nis = getElement().getNameInSource();
- if (nis != null) {
- nis = nis.trim();
- }
- setXPath(nis);
+ String nis = getElement().getNameInSource();
+ if (nis != null) {
+ nis = nis.trim();
+ }
+ setXPath(nis);
}
-
+
protected ParameterDescriptor() {
setIsParameter(false);
setIsResponseId(false);
setIsLocation(false);
setColumnName(null);
- setXPath(null);
+ setXPath(null);
}
-
- public final void setXPath(String xPath) {
+
+ public final void setXPath( String xPath ) {
m_xPath = xPath;
}
-
+
public String getXPath() {
return m_xPath;
}
-
- public final void setIsParameter(boolean param) {
+
+ public final void setIsParameter( boolean param ) {
m_param = param;
}
-
- public final void setIsResponseId(boolean responseId) {
+
+ public final void setIsResponseId( boolean responseId ) {
m_responseId = responseId;
}
-
- public final void setIsLocation(boolean location) {
+
+ public final void setIsLocation( boolean location ) {
m_location = location;
}
-
+
public final boolean isParameter() {
return m_param;
}
+
public final boolean isResponseId() {
return m_responseId;
}
+
public final boolean isLocation() {
return m_location;
}
- public final void setColumnName(String columnName) {
- m_columnName = columnName;
- }
-
- public final String getColumnName() {
- return m_columnName;
- }
-
- public final void setColumnNumber(int columnNumber) {
- m_columnNumber = columnNumber;
- }
-
- public final int getColumnNumber() {
- return m_columnNumber;
- }
-
- protected void setElement(Element elem) {
- m_element = elem;
+
+ public final void setColumnName( String columnName ) {
+ m_columnName = columnName;
}
-
+
+ public final String getColumnName() {
+ return m_columnName;
+ }
+
+ public final void setColumnNumber( int columnNumber ) {
+ m_columnNumber = columnNumber;
+ }
+
+ public final int getColumnNumber() {
+ return m_columnNumber;
+ }
+
+ protected void setElement( Element elem ) {
+ m_element = elem;
+ }
+
protected Element getElement() {
- return m_element;
+ return m_element;
}
-
- protected static boolean testForParam(Element element) throws ConnectorException {
+
+ protected static boolean testForParam( Element element ) throws ConnectorException {
boolean param = false;
- param = Boolean.valueOf(element.getProperties().getProperty(PARM_INPUT_COLUMN_PROPERTY_NAME)).booleanValue();
+ param = Boolean.valueOf(element.getProperties().getProperty(PARM_INPUT_COLUMN_PROPERTY_NAME)).booleanValue();
return param;
}
-
+
public String getRole() throws ConnectorException {
- return m_element.getProperties().getProperty(ROLE_COLUMN_PROPERTY_NAME);
+ return m_element.getProperties().getProperty(ROLE_COLUMN_PROPERTY_NAME);
}
-
- protected void testRole() throws ConnectorException
- {
+
+ protected void testRole() throws ConnectorException {
String role = getRole();
- if(role == null) {
- setIsResponseId(false);
- setIsLocation(false);
+ if (role == null) {
+ setIsResponseId(false);
+ setIsLocation(false);
} else {
- if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN)) {
- setIsResponseId(true);
- setIsLocation(false);
- }
- else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT)) {
- setIsResponseId(true);
- setIsLocation(false);
- }
- else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_LOCATION)) {
- setIsResponseId(false);
- setIsLocation(true);
- }
- else { //if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_DATA))
- setIsResponseId(false);
- setIsLocation(false);
- }
+ if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_IN)) {
+ setIsResponseId(true);
+ setIsLocation(false);
+ } else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_RESPONSE_OUT)) {
+ setIsResponseId(true);
+ setIsLocation(false);
+ } else if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_LOCATION)) {
+ setIsResponseId(false);
+ setIsLocation(true);
+ } else { // if (role.equalsIgnoreCase(ROLE_COLUMN_PROPERTY_NAME_DATA))
+ setIsResponseId(false);
+ setIsLocation(false);
+ }
}
}
}
15 years, 7 months