Author: shawkins
Date: 2011-03-28 16:16:39 -0400 (Mon, 28 Mar 2011)
New Revision: 3046
Modified:
trunk/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1533 adding back the ability to set maxin for all translators
Modified:
trunk/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
===================================================================
---
trunk/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -128,10 +128,6 @@
return delegate.getMaxFromGroups();
}
@Override
- public int getMaxInCriteriaSize() {
- return delegate.getMaxInCriteriaSize();
- }
- @Override
public void getMetadata(MetadataFactory metadataFactory, C conn)
throws TranslatorException {
delegate.getMetadata(metadataFactory, conn);
@@ -157,43 +153,6 @@
return delegate.isSourceRequired();
}
@Override
- public void setImmutable(boolean arg0) {
- delegate.setImmutable(arg0);
- }
- @Override
- public void setRequiresCriteria(boolean requiresCriteria) {
- delegate.setRequiresCriteria(requiresCriteria);
- }
- @Override
- public void setSourceRequired(boolean value) {
- delegate.setSourceRequired(value);
- }
- @Override
- public void setSupportedJoinCriteria(
- SupportedJoinCriteria supportedJoinCriteria) {
- delegate.setSupportedJoinCriteria(supportedJoinCriteria);
- }
- @Override
- public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins) {
- delegate.setSupportsFullOuterJoins(supportsFullOuterJoins);
- }
- @Override
- public void setSupportsInnerJoins(boolean supportsInnerJoins) {
- delegate.setSupportsInnerJoins(supportsInnerJoins);
- }
- @Override
- public void setSupportsOrderBy(boolean supportsOrderBy) {
- delegate.setSupportsOrderBy(supportsOrderBy);
- }
- @Override
- public void setSupportsOuterJoins(boolean supportsOuterJoins) {
- delegate.setSupportsOuterJoins(supportsOuterJoins);
- }
- @Override
- public void setSupportsSelectDistinct(boolean supportsSelectDistinct) {
- delegate.setSupportsSelectDistinct(supportsSelectDistinct);
- }
- @Override
public boolean supportsAggregatesAvg() {
return delegate.supportsAggregatesAvg();
}
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-03-28 17:37:26
UTC (rev 3045)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-03-28 20:16:39
UTC (rev 3046)
@@ -105,6 +105,7 @@
private boolean supportsInnerJoins;
private boolean supportsFullOuterJoins;
private boolean requiresCriteria;
+ private int maxInSize = DEFAULT_MAX_IN_CRITERIA_SIZE;
/**
* Initialize the connector with supplied configuration
@@ -658,9 +659,14 @@
* in the WHERE clause of a query
* @since 5.0
*/
- public int getMaxInCriteriaSize() {
- return DEFAULT_MAX_IN_CRITERIA_SIZE;
+ @TranslatorProperty(display="Max number of IN predicate entries",
advanced=true)
+ public final int getMaxInCriteriaSize() {
+ return maxInSize;
}
+
+ public void setMaxInCriteriaSize(int maxInSize) {
+ this.maxInSize = maxInSize;
+ }
/**
* <p>Support indicates that the connector supports functions in GROUP BY, such
as:
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -42,6 +42,10 @@
public static final int YAHOO_MAX_SET_SIZE = 100;
+ public YahooExecutionFactory() {
+ setMaxInCriteriaSize(YAHOO_MAX_SET_SIZE);
+ }
+
@Override
public void start() throws TranslatorException {
}
@@ -64,10 +68,6 @@
return true;
}
- public int getMaxInCriteriaSize() {
- return YAHOO_MAX_SET_SIZE;
- }
-
@Override
public boolean isSourceRequired() {
return false;
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -281,11 +281,6 @@
}
@Override
- public int getMaxInCriteriaSize() {
- return DEFAULT_MAX_IN_CRITERIA;
- }
-
- @Override
public boolean supportsGroupBy() {
return true;
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -40,14 +40,10 @@
setSupportsOuterJoins(false);
setSupportsFullOuterJoins(false);
setSupportsOrderBy(false);
+ setMaxInCriteriaSize(250);
}
@Override
- public int getMaxInCriteriaSize() {
- return 250;
- }
-
- @Override
public boolean supportsCompareCriteriaEquals() {
return true;
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -39,6 +39,7 @@
public AccessExecutionFactory() {
setSupportsOrderBy(false);
setDatabaseVersion("2003"); //$NON-NLS-1$
+ setMaxInCriteriaSize(JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA);
}
@Override
@@ -92,11 +93,6 @@
}
@Override
- public int getMaxInCriteriaSize() {
- return JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA;
- }
-
- @Override
public int getMaxFromGroups() {
return DEFAULT_MAX_FROM_GROUPS;
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -50,6 +50,7 @@
//TEIID-31 remove mod modifier for SQL Server 2008
public SQLServerExecutionFactory() {
setDatabaseVersion(V_2005);
+ setMaxInCriteriaSize(JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA);
}
@Override
@@ -186,11 +187,6 @@
}
@Override
- public int getMaxInCriteriaSize() {
- return JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA;
- }
-
- @Override
public boolean supportsAggregatesEnhancedNumeric() {
return true;
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -64,6 +64,7 @@
public SybaseExecutionFactory() {
setDatabaseVersion(TWELVE_5);
setSupportsFullOuterJoins(false);
+ setMaxInCriteriaSize(250);
}
public void start() throws TranslatorException {
@@ -242,11 +243,6 @@
}
@Override
- public int getMaxInCriteriaSize() {
- return 250;
- }
-
- @Override
public List<String> getSupportedFunctions() {
List<String> supportedFunctions = new ArrayList<String>();
supportedFunctions.addAll(super.getSupportedFunctions());
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -54,6 +54,10 @@
private boolean restrictToObjectClass;
private SearchDefaultScope searchDefaultScope = SearchDefaultScope.ONELEVEL_SCOPE;
+ public LDAPExecutionFactory() {
+ this.setMaxInCriteriaSize(1000);
+ }
+
@TranslatorProperty(display="Default Search Base DN",
description="Default Base DN for LDAP Searches")
public String getSearchDefaultBaseDN() {
return searchDefaultBaseDN;
@@ -94,11 +98,6 @@
}
@Override
- public int getMaxInCriteriaSize() {
- return 1000;
- }
-
- @Override
public boolean supportsCompareCriteriaEquals() {
return true;
}
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2011-03-28
20:16:39 UTC (rev 3046)
@@ -60,7 +60,6 @@
private static final String INCLUDES = "includes";//$NON-NLS-1$
private String connectorStateClass;
private boolean auditModelFields = false;
- private int maxInSize = 300;
public SalesForceExecutionFactory() {
//
http://jira.jboss.org/jira/browse/JBEDSP-306
@@ -124,16 +123,6 @@
processor.processMetadata();
}
- @Override
- @TranslatorProperty(display="Max number of IN predicate entries",
advanced=true)
- public int getMaxInCriteriaSize() {
- return maxInSize;
- }
-
- public void setMaxInCriteriaSize(int maxInSize) {
- this.maxInSize = maxInSize;
- }
-
@Override
public List getSupportedFunctions() {
return Collections.EMPTY_LIST;
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
---
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-03-28
17:37:26 UTC (rev 3045)
+++
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-03-28
20:16:39 UTC (rev 3046)
@@ -109,14 +109,18 @@
<entry>If joins are supported, defines what criteria may be
used as the join criteria. May be one of (ANY, THETA, EQUI, or KEY).</entry>
<entry>ANY</entry>
</row>
+ <row>
+ <entry>MaxInCriteriaSize</entry>
+ <entry>If in criteria are supported, defines what the
maximum number of in entries are per predicate. -1 indicates no limit.</entry>
+ <entry>-1</entry>
+ </row>
</tbody>
</tgroup>
</table>
<note>
<para>
- Only a subset of the metadata as to what SQL constructs the source supports
- can be set through execution properties. If more control is needed, please
+ Only a subset of the supports metadata can be set through execution
properties. If more control is needed, please
consult the Teiid Developers Guide.
</para>
</note>