teiid SVN: r2129 - in trunk: engine/src/main/javacc/org/teiid/query/parser and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-17 18:00:40 -0400 (Mon, 17 May 2010)
New Revision: 2129
Modified:
trunk/api/src/main/java/org/teiid/language/SQLReservedWords.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/test/java/org/teiid/query/sql/visitor/TestSQLStringVisitor.java
Log:
TEIID-1005 fully updating reserved words to sql 2003
Modified: trunk/api/src/main/java/org/teiid/language/SQLReservedWords.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLReservedWords.java 2010-05-17 20:33:01 UTC (rev 2128)
+++ trunk/api/src/main/java/org/teiid/language/SQLReservedWords.java 2010-05-17 22:00:40 UTC (rev 2129)
@@ -81,11 +81,15 @@
public static final String ADD = "ADD"; //$NON-NLS-1$
public static final String ANY = "ANY"; //$NON-NLS-1$
public static final String ALL = "ALL"; //$NON-NLS-1$
+ public static final String ALLOCATE = "ALLOCATE"; //$NON-NLS-1$
public static final String ALTER = "ALTER"; //$NON-NLS-1$
public static final String AND = "AND"; //$NON-NLS-1$
+ public static final String ARE = "ARE"; //$NON-NLS-1$
public static final String ARRAY = "ARRAY"; //$NON-NLS-1$s
public static final String AS = "AS"; //$NON-NLS-1$
public static final String ASC = "ASC"; //$NON-NLS-1$
+ public static final String ASENSITIVE = "ASENSITIVE"; //$NON-NLS-1$
+ public static final String ASYMETRIC = "ASYMETRIC"; //$NON-NLS-1$
public static final String ATOMIC = "ATOMIC"; //$NON-NLS-1$
public static final String AUTHORIZATION = "AUTHORIZATION"; //$NON-NLS-1$
public static final String AVG = "AVG"; //$NON-NLS-1$
@@ -122,13 +126,16 @@
public static final String CURRENT_TIMESTAMP = "CURRENT_TIMESTAMP"; //$NON-NLS-1$
public static final String CURRENT_USER = "CURRENT_USER"; //$NON-NLS-1$
public static final String CURSOR = "CURSOR"; //$NON-NLS-1$
+ public static final String CYCLE = "CYCLE"; //$NON-NLS-1$
public static final String DATE = "DATE"; //$NON-NLS-1$
public static final String DAY = "DAY"; //$NON-NLS-1$
public static final String DEALLOCATE = "DEALLOCATE"; //$NON-NLS-1$
+ public static final String DEC = "DEC"; //$NON-NLS-1$
public static final String DECIMAL = "DECIMAL"; //$NON-NLS-1$
public static final String DECLARE = "DECLARE"; //$NON-NLS-1$
public static final String DEFAULT = "DEFAULT"; //$NON-NLS-1$
public static final String DELETE = "DELETE"; //$NON-NLS-1$
+ public static final String DEREF = "DEREF"; //$NON-NLS-1$
public static final String DESC = "DESC"; //$NON-NLS-1$
public static final String DESCRIBE = "DESCRIBE"; //$NON-NLS-1$
public static final String DETERMINISTIC = "DETERMINISTIC"; //$NON-NLS-1$
@@ -136,7 +143,9 @@
public static final String DISTINCT = "DISTINCT"; //$NON-NLS-1$
public static final String DOUBLE = "DOUBLE"; //$NON-NLS-1$
public static final String DROP = "DROP"; //$NON-NLS-1$
+ public static final String DYNAMIC = "DYNAMIC"; //$NON-NLS-1$
public static final String EACH = "EACH"; //$NON-NLS-1$
+ public static final String ELEMENT = "ELEMENT"; //$NON-NLS-1$
public static final String ELSE = "ELSE"; //$NON-NLS-1$
public static final String END = "END"; //$NON-NLS-1$
public static final String ESCAPE = "ESCAPE"; //$NON-NLS-1$
@@ -151,6 +160,7 @@
public static final String FLOAT = "FLOAT"; //$NON-NLS-1$
public static final String FOR = "FOR"; //$NON-NLS-1$
public static final String FOREIGN = "FOREIGN"; //$NON-NLS-1$
+ public static final String FREE = "FREE"; //$NON-NLS-1$
public static final String FROM = "FROM"; //$NON-NLS-1$
public static final String FULL = "FULL"; //$NON-NLS-1$
public static final String FUNCTION = "FUNCTION"; //$NON-NLS-1$
@@ -176,31 +186,41 @@
public static final String INTEGER = "INTEGER"; //$NON-NLS-1$
public static final String INTERSECT = "INTERSECT"; //$NON-NLS-1$
public static final String INTERVAL = "INTERVAL"; //$NON-NLS-1$
+ public static final String INT = "INT"; //$NON-NLS-1$
public static final String INTO = "INTO"; //$NON-NLS-1$
public static final String IS = "IS"; //$NON-NLS-1$
public static final String ISOLATION = "ISOLATION"; //$NON-NLS-1$
public static final String JOIN = "JOIN"; //$NON-NLS-1$
public static final String LANGUAGE = "LANGUAGE"; //$NON-NLS-1$
public static final String LARGE = "LARGE"; //$NON-NLS-1$
+ public static final String LATERAL = "LATERAL"; //$NON-NLS-1$
public static final String LEADING = "LEADING"; //$NON-NLS-1$
public static final String LEFT = "LEFT"; //$NON-NLS-1$
public static final String LIKE = "LIKE"; //$NON-NLS-1$
public static final String LOCAL = "LOCAL"; //$NON-NLS-1$
+ public static final String LOCALTIME = "LOCALTIME"; //$NON-NLS-1$
+ public static final String LOCALTIMESTAMP = "LOCALTIMESTAMP"; //$NON-NLS-1$
public static final String MATCH = "MATCH"; //$NON-NLS-1$
public static final String MAX = "MAX"; //$NON-NLS-1$
public static final String MIN = "MIN"; //$NON-NLS-1$
+ public static final String MEMBER = "MEMBER"; //$NON-NLS-1$
public static final String MERGE = "MERGE"; //$NON-NLS-1$
public static final String METHOD = "METHOD"; //$NON-NLS-1$
public static final String MINUTE = "MINUTE"; //$NON-NLS-1$
public static final String MODIFIES = "MODIFIES"; //$NON-NLS-1$
public static final String MODULE = "MODULE"; //$NON-NLS-1$
public static final String MONTH = "MONTH"; //$NON-NLS-1$
+ public static final String MULTISET = "MULTISET"; //$NON-NLS-1$
+ public static final String NATIONAL = "NATIONAL"; //$NON-NLS-1$
public static final String NATURAL = "NATURAL"; //$NON-NLS-1$
+ public static final String NCHAR = "NCHAR"; //$NON-NLS-1$
+ public static final String NCLOB = "NCLOB"; //$NON-NLS-1$
public static final String NEW = "NEW"; //$NON-NLS-1$
public static final String NO = "NO"; //$NON-NLS-1$
public static final String NONE = "NONE"; //$NON-NLS-1$
public static final String NOT = "NOT"; //$NON-NLS-1$
public static final String NULL = "NULL"; //$NON-NLS-1$
+ public static final String NUMERIC = "NUMERIC"; //$NON-NLS-1$
public static final String OBJECT = "OBJECT"; //$NON-NLS-1$
public static final String OF = "OF"; //$NON-NLS-1$
public static final String OLD = "OLD"; //$NON-NLS-1$
@@ -227,6 +247,7 @@
public static final String RECURSIVE = "RECURSIVE"; //$NON-NLS-1$
public static final String REFERENCES = "REFERENCES"; //$NON-NLS-1$
public static final String REFERENCING = "REFERENCING"; //$NON-NLS-1$
+ public static final String RELEASE = "RELEASE"; //$NON-NLS-1$
public static final String RETURN = "RETURN"; //$NON-NLS-1$
public static final String RETURNS = "RETURNS"; //$NON-NLS-1$
public static final String REVOKE = "REVOKE"; //$NON-NLS-1$
@@ -235,25 +256,28 @@
public static final String ROLLUP = "ROLLUP"; //$NON-NLS-1$
public static final String ROW = "ROW"; //$NON-NLS-1$
public static final String ROWS = "ROWS"; //$NON-NLS-1$
- public static final String SAVEPOINT = "ROWS"; //$NON-NLS-1$
- public static final String SCROLL = "ROWS"; //$NON-NLS-1$
- public static final String SEARCH = "ROWS"; //$NON-NLS-1$
- public static final String SECOND = "ROWS"; //$NON-NLS-1$
+ public static final String SAVEPOINT = "SAVEPOINT"; //$NON-NLS-1$
+ public static final String SCROLL = "SCROLL"; //$NON-NLS-1$
+ public static final String SEARCH = "SEARCH"; //$NON-NLS-1$
+ public static final String SECOND = "SECOND"; //$NON-NLS-1$
public static final String SELECT = "SELECT"; //$NON-NLS-1$
- public static final String SENSITIVE = "ROWS"; //$NON-NLS-1$
+ public static final String SENSITIVE = "SENSITIVE"; //$NON-NLS-1$
public static final String SESSION_USER = "SESSION_USER"; //$NON-NLS-1$
public static final String SET = "SET"; //$NON-NLS-1$
public static final String SHORT = "SHORT"; //$NON-NLS-1$
- public static final String SIILAR = "ROWS"; //$NON-NLS-1$
- public static final String SMALLINT = "ROWS"; //$NON-NLS-1$
+ public static final String SIILAR = "SIMILAR"; //$NON-NLS-1$
+ public static final String SMALLINT = "SMALLINT"; //$NON-NLS-1$
public static final String SOME = "SOME"; //$NON-NLS-1$
- public static final String SPECIFIC = "ROWS"; //$NON-NLS-1$
- public static final String SQL = "ROWS"; //$NON-NLS-1$
+ public static final String SPECIFIC = "SPECIFIC"; //$NON-NLS-1$
+ public static final String SPECIFICTYPE = "SPECIFICTYPE"; //$NON-NLS-1$
+ public static final String SQL = "SQL"; //$NON-NLS-1$
public static final String SQLEXCEPTION = "SQLEXCEPTION"; //$NON-NLS-1$
public static final String SQLSTATE = "SQLSTATE"; //$NON-NLS-1$
public static final String SQLWARNING = "SQLWARNING"; //$NON-NLS-1$
+ public static final String SUBMULTILIST = "SUBMULTILIST"; //$NON-NLS-1$
public static final String START = "START"; //$NON-NLS-1$
public static final String STATIC = "STATIC"; //$NON-NLS-1$
+ public static final String SYMETRIC = "SYMETRIC"; //$NON-NLS-1$
public static final String SYSTEM = "SYSTEM"; //$NON-NLS-1$
public static final String SYSTEM_USER = "SYSTEM_USER"; //$NON-NLS-1$
public static final String SUM = "SUM"; //$NON-NLS-1$
@@ -265,8 +289,10 @@
public static final String TIMEZONE_HOUR = "TIMEZONE_HOUR"; //$NON-NLS-1$
public static final String TIMEZONE_MINUTE = "TIMEZONE_MINUTE"; //$NON-NLS-1$
public static final String TO = "TO"; //$NON-NLS-1$
+ public static final String TREAT = "TREAT"; //$NON-NLS-1$
public static final String TRAILING = "TRAILING"; //$NON-NLS-1$
public static final String TRANSLATE = "TRANSLATE"; //$NON-NLS-1$
+ public static final String TRANSLATION = "TRANSLATION"; //$NON-NLS-1$
public static final String TRIGGER = "TRIGGER"; //$NON-NLS-1$
public static final String TRUE = "TRUE"; //$NON-NLS-1$
public static final String UNION = "UNION"; //$NON-NLS-1$
@@ -278,6 +304,7 @@
public static final String VALUE = "VALUE"; //$NON-NLS-1$
public static final String VALUES = "VALUES"; //$NON-NLS-1$
public static final String VARCHAR = "VARCHAR"; //$NON-NLS-1$
+ public static final String VARYING = "VARYING"; //$NON-NLS-1$
public static final String WHEN = "WHEN"; //$NON-NLS-1$
public static final String WHENEVER = "WHENEVER"; //$NON-NLS-1$
public static final String WHERE = "WHERE"; //$NON-NLS-1$
@@ -317,7 +344,7 @@
public static final String DLURLSCHEME = "DLURLSCHEME"; //$NON-NLS-1$
public static final String DLURLSERVER = "DLURLSEVER"; //$NON-NLS-1$
public static final String DLVALUE = "DLVALUE"; //$NON-NLS-1$
- public static final String IMPORT = "XMLPI"; //$NON-NLS-1$
+ public static final String IMPORT = "IMPORT"; //$NON-NLS-1$
/**
* Set of CAPITALIZED reserved words for checking whether a string is a reserved word.
@@ -329,8 +356,10 @@
Field[] fields = SQLReservedWords.class.getDeclaredFields();
for (Field field : fields) {
if (field.getType() == String.class) {
- try {
- RESERVED_WORDS.add((String)field.get(null));
+ try {
+ if (!RESERVED_WORDS.add((String)field.get(null))) {
+ throw new AssertionError("Duplicate value for " + field.getName()); //$NON-NLS-1$
+ }
} catch (Exception e) {
}
}
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-05-17 20:33:01 UTC (rev 2128)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2010-05-17 22:00:40 UTC (rev 2129)
@@ -296,6 +296,34 @@
| <WITHIN: "within">
| <WITHOUT: "without">
| <YEAR: "year">
+
+| <ALLOCATE: "allocate">
+| <ARE: "are">
+| <ASENSITIVE: "asensitive">
+| <ASYMETRIC: "asymetric">
+| <CYCLE: "cycle">
+| <DEC: "dec">
+| <DEREF: "deref">
+| <DYNAMIC: "dynamic">
+| <ELEMENT: "element">
+| <FREE: "free">
+| <INT: "int">
+| <LATERAL: "lateral">
+| <LOCALTIME: "localtime">
+| <LOCALTIMESTAMP: "localtimestamp">
+| <MEMBER: "member">
+| <MULTISET: "multiset">
+| <NATIONAL: "national">
+| <NCHAR: "nchar">
+| <NCLOB: "nclob">
+| <NUMERIC: "numeric">
+| <RELEASE: "release">
+| <SPECIFICTYPE: "specifictype">
+| <SYMETRIC: "symetric">
+| <SUBMULTILIST: "submultilist">
+| <TRANSLATION: "translation">
+| <TREAT: "treat">
+| <VARYING: "varying">
}
TOKEN : /* SQL/XML Reserved words */
Modified: trunk/engine/src/test/java/org/teiid/query/sql/visitor/TestSQLStringVisitor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/sql/visitor/TestSQLStringVisitor.java 2010-05-17 20:33:01 UTC (rev 2128)
+++ trunk/engine/src/test/java/org/teiid/query/sql/visitor/TestSQLStringVisitor.java 2010-05-17 22:00:40 UTC (rev 2129)
@@ -1033,14 +1033,14 @@
}
public void testAliasSymbol1() {
- AliasSymbol as = new AliasSymbol("x", new ElementSymbol("element")); //$NON-NLS-1$ //$NON-NLS-2$
- helpTest(as, "element AS x"); //$NON-NLS-1$
+ AliasSymbol as = new AliasSymbol("x", new ElementSymbol("y")); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTest(as, "y AS x"); //$NON-NLS-1$
}
// Test alias symbol with reserved word
public void testAliasSymbol2() {
- AliasSymbol as = new AliasSymbol("select", new ElementSymbol("element")); //$NON-NLS-1$ //$NON-NLS-2$
- helpTest(as, "element AS \"select\""); //$NON-NLS-1$
+ AliasSymbol as = new AliasSymbol("select", new ElementSymbol("y")); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTest(as, "y AS \"select\""); //$NON-NLS-1$
}
public void testAllSymbol() {
13 years, 11 months
teiid SVN: r2128 - trunk/runtime/src/main/java/org/teiid/deployers.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-17 16:33:01 -0400 (Mon, 17 May 2010)
New Revision: 2128
Modified:
trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
Log:
TEIID-1056 refining connector changes to remove capabilities interface. also ensuring that property annotation processing is simplified
Modified: trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java 2010-05-17 20:23:50 UTC (rev 2127)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java 2010-05-17 20:33:01 UTC (rev 2128)
@@ -37,12 +37,11 @@
import org.teiid.translator.TranslatorProperty;
public class ManagedPropertyUtil {
- private static final String[] EMPTY_ALLOWED = new String[0];
private static final String TEIID_PROPERTY = "teiid-property"; //$NON-NLS-1$
public static ManagedProperty convert(Object instance, Method method, TranslatorProperty prop) {
Class<?> type = method.getReturnType();
- String[] allowedValues = EMPTY_ALLOWED;
+ String[] allowedValues = null;
Method getter = null;
boolean readOnly = false;
if (type == Void.TYPE) { //check for setter
@@ -71,7 +70,11 @@
}
}
Object defaultValue = null;
- if (!prop.required() && getter != null) {
+ if (prop.required()) {
+ if (prop.advanced()) {
+ throw new TeiidRuntimeException("TranslatorProperty annotation should not both be advanced and required " + method); //$NON-NLS-1$
+ }
+ } else if (getter != null) {
try {
defaultValue = getter.invoke(instance, (Object[])null);
} catch (Exception e) {
13 years, 11 months
teiid SVN: r2127 - in trunk: client/src/main/java/org/teiid/adminapi and 18 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-05-17 16:23:50 -0400 (Mon, 17 May 2010)
New Revision: 2127
Added:
trunk/runtime/src/test/java/org/teiid/deployers/TestManagedPropertyUtil.java
Removed:
trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
Modified:
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/api/src/main/java/org/teiid/translator/TranslatorProperty.java
trunk/client/src/main/java/org/teiid/adminapi/Translator.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.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/derby/DerbyExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
trunk/runtime/src/main/java/org/teiid/templates/TranslatorTemplateInfoFactory.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1056 refining connector changes to remove capabilities interface. also ensuring that property annotation processing is simplified
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -24,10 +24,12 @@
import java.util.List;
+import org.teiid.language.BatchedUpdates;
import org.teiid.language.Call;
import org.teiid.language.Command;
import org.teiid.language.LanguageFactory;
import org.teiid.language.QueryExpression;
+import org.teiid.language.SetQuery;
import org.teiid.metadata.RuntimeMetadata;
@@ -38,18 +40,54 @@
* The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
* the "start" method is called. This class represents the basic capabilities of the translator.
*/
-public class ExecutionFactory implements TranslatorCapabilities{
+public class ExecutionFactory {
+
+ 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
+ }
public static final int DEFAULT_MAX_FROM_GROUPS = -1;
+ public static final int DEFAULT_MAX_IN_CRITERIA_SIZE = -1;
+ public static final int DEFAULT_MAX_ROWS = -1;
private static final TypeFacility TYPE_FACILITY = new TypeFacility();
- private boolean immutable = false;
- private boolean exceptionOnMaxRows = false;
- private int maxResultRows = DEFAULT_MAX_FROM_GROUPS;
+ /*
+ * Managed execution properties
+ */
+ private boolean immutable;
+ private boolean exceptionOnMaxRows = true;
+ private int maxResultRows = DEFAULT_MAX_ROWS;
private boolean xaCapable;
private boolean sourceRequired = true;
+ /*
+ * Support properties
+ */
+ private boolean supportsSelectDistinct;
+ private boolean supportsOuterJoins;
+ private SupportedJoinCriteria supportedJoinCriteria = SupportedJoinCriteria.ANY;
+ private boolean supportsOrderBy;
+ private boolean supportsInnerJoins;
+ private boolean supportsFullOuterJoins;
+ private boolean requiresCriteria;
+
/**
* Initialize the connector with supplied configuration
*/
@@ -60,7 +98,7 @@
* Defines if the Connector is read-only connector
* @return
*/
- @TranslatorProperty(name="immutable", display="Is Immutable",description="Is Immutable, True if the source never changes.",advanced=true, defaultValue="false")
+ @TranslatorProperty(managed=true, display="Is Immutable",description="Is Immutable, True if the source never changes.",advanced=true)
public boolean isImmutable() {
return immutable;
}
@@ -73,7 +111,7 @@
* Throw exception if there are more rows in the result set than specified in the MaxResultRows setting.
* @return
*/
- @TranslatorProperty(name="exception-on-max-rows", display="Exception on Exceeding Max Rows",description="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",advanced=true, defaultValue="true")
+ @TranslatorProperty(managed=true, display="Exception on Exceeding Max Rows",description="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",advanced=true)
public boolean isExceptionOnMaxRows() {
return exceptionOnMaxRows;
}
@@ -86,9 +124,9 @@
* Maximum result set rows to fetch
* @return
*/
- @TranslatorProperty(name="max-result-rows", display="Maximum Result Rows", description="Maximum Result Rows allowed", advanced=true, defaultValue="-1")
+ @TranslatorProperty(managed=true, display="Maximum Result Rows", description="Maximum Result Rows allowed", advanced=true)
public int getMaxResultRows() {
- return maxResultRows;
+ return maxResultRows = DEFAULT_MAX_ROWS;
}
public void setMaxResultRows(int arg0) {
@@ -99,7 +137,7 @@
* Shows the XA transaction capability of the Connector.
* @return
*/
- @TranslatorProperty(name="xa-capable", display="Is XA Capable", description="True, if this connector supports XA Transactions", defaultValue="false")
+ @TranslatorProperty(managed=true, display="Is XA Capable", description="True, if this connector supports XA Transactions")
public boolean isXaCapable() {
return xaCapable;
}
@@ -168,263 +206,481 @@
throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
- @Override
- public boolean supportsSelectDistinct() {
- return false;
+ /**
+ * Support indicates connector can accept queries with SELECT DISTINCT
+ * @since 3.1 SP2
+ */
+ @TranslatorProperty(display="Supports Select Distinct", description="True, if this connector supports SELECT DISTINCT", advanced=true)
+ public final boolean supportsSelectDistinct() {
+ return supportsSelectDistinct;
}
+
+ public void setSupportsSelectDistinct(boolean supportsSelectDistinct) {
+ this.supportsSelectDistinct = supportsSelectDistinct;
+ }
- @Override
- public boolean supportsAliasedGroup() {
- return false;
+ /**
+ * 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
+ */
+ public boolean supportsSelectExpression() {
+ return false;
}
- @Override
- public boolean supportsSelfJoins() {
- return false;
+ /**
+ * Support indicates connector can accept groups with aliases
+ * @since 3.1 SP2
+ */
+ public boolean supportsAliasedTable() {
+ return false;
}
- @Override
- public boolean supportsOuterJoins() {
- return false;
+ /**
+ * Get the supported join criteria. A null return value will be treated
+ * as {@link SupportedJoinCriteria#ANY}
+ * @since 6.1.0
+ */
+ @TranslatorProperty(display="Supported Join Criteria", description="Returns one of any, theta, equi, or key", advanced=true)
+ public final SupportedJoinCriteria getSupportedJoinCriteria() {
+ return supportedJoinCriteria;
}
+
+ public void setSupportedJoinCriteria(
+ SupportedJoinCriteria supportedJoinCriteria) {
+ this.supportedJoinCriteria = supportedJoinCriteria;
+ }
+
+ /**
+ * Support indicates connector can accept inner or cross joins
+ * @since 6.1.0
+ */
+ @TranslatorProperty(display="Supports Inner Joins", description="True, if this connector supports inner joins", advanced=true)
+ public final boolean supportsInnerJoins() {
+ return supportsInnerJoins;
+ }
+
+ public void setSupportsInnerJoins(boolean supportsInnerJoins) {
+ this.supportsInnerJoins = supportsInnerJoins;
+ }
+
+ /**
+ * Support indicates connector can accept self-joins where a
+ * group is joined to itself with aliases. Connector must also support
+ * {@link #supportsAliasedTable()}.
+ * @since 3.1 SP2
+ */
+ public boolean supportsSelfJoins() {
+ return false;
+ }
+
+ /**
+ * Support indicates connector can accept left outer joins
+ * @since 3.1 SP2
+ */
+ @TranslatorProperty(display="Supports Outer Joins", description="True, if this connector supports outer joins", advanced=true)
+ public final boolean supportsOuterJoins() {
+ return supportsOuterJoins;
+ }
+
+ public void setSupportsOuterJoins(boolean supportsOuterJoins) {
+ this.supportsOuterJoins = supportsOuterJoins;
+ }
+
+ /**
+ * Support indicates connector can accept full outer joins
+ * @since 3.1 SP2
+ */
+ @TranslatorProperty(display="Supports Full Outer Joins", description="True, if this connector supports full outer joins", advanced=true)
+ public final boolean supportsFullOuterJoins() {
+ return supportsFullOuterJoins;
+ }
+
+ public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins) {
+ this.supportsFullOuterJoins = supportsFullOuterJoins;
+ }
- @Override
- public boolean supportsFullOuterJoins() {
- return false;
+ /**
+ * Support indicates connector can accept inline views (subqueries
+ * in the FROM clause).
+ * @since 4.1
+ */
+ public boolean supportsInlineViews() {
+ return false;
}
- @Override
+ /**
+ * 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
+ */
public boolean supportsBetweenCriteria() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector accepts criteria of form (element = constant)
+ * @since 3.1 SP2
+ */
public boolean supportsCompareCriteriaEquals() {
- return false;
+ return false;
}
- @Override
+ /**
+ * 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
+ */
+ public boolean supportsCompareCriteriaOrdered() {
+ return false;
+ }
+
+ /**
+ * Support indicates connector accepts criteria of form (element LIKE constant)
+ * @since 3.1 SP2
+ */
public boolean supportsLikeCriteria() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector accepts criteria of form (element LIKE constant ESCAPE char)
+ * @since 3.1 SP2
+ */
public boolean supportsLikeCriteriaEscapeCharacter() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts criteria of form (element IN set)
+ * @since 3.1 SP2
+ */
public boolean supportsInCriteria() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts IN criteria with a subquery on the right side
+ * @since 4.0
+ */
public boolean supportsInCriteriaSubquery() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts criteria of form (element IS NULL)
+ * @since 3.1 SP2
+ */
public boolean supportsIsNullCriteria() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts logical criteria connected by OR
+ * @since 3.1 SP2
+ */
public boolean supportsOrCriteria() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts logical criteria NOT
+ * @since 3.1 SP2
+ */
public boolean supportsNotCriteria() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts the EXISTS criteria
+ * @since 4.0
+ */
public boolean supportsExistsCriteria() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use SOME
+ * @since 4.0
+ */
public boolean supportsQuantifiedCompareCriteriaSome() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use ALL
+ * @since 4.0
+ */
public boolean supportsQuantifiedCompareCriteriaAll() {
- return false;
+ return false;
}
- @Override
- public boolean supportsOrderBy() {
- return false;
+ /**
+ * Support indicates connector accepts ORDER BY clause, including multiple elements
+ * and ascending and descending sorts.
+ * @since 3.1 SP2
+ */
+ @TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true)
+ public final boolean supportsOrderBy() {
+ return supportsOrderBy;
}
+
+ public void setSupportsOrderBy(boolean supportsOrderBy) {
+ this.supportsOrderBy = supportsOrderBy;
+ }
+
+ /**
+ * Support indicates connector accepts ORDER BY clause with columns not from the select
+ * @since 6.2
+ * @return
+ */
+ public boolean supportsOrderByUnrelated() {
+ return false;
+ }
+
+ /**
+ * Whether the source supports an explicit GROUP BY clause
+ * @since 6.1
+ */
+ public boolean supportsGroupBy() {
+ return false;
+ }
- @Override
+ /**
+ * Whether the source supports the HAVING clause
+ * @since 6.1
+ */
+ public boolean supportsHaving() {
+ return false;
+ }
+
+ /**
+ * Support indicates connector can accept the SUM aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesSum() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept the AVG aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesAvg() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept the MIN aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesMin() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept the MAX aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesMax() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept the COUNT aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesCount() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept the COUNT(*) aggregate function
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesCountStar() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Support indicates connector can accept DISTINCT within aggregate functions
+ * @since 3.1 SP2
+ */
public boolean supportsAggregatesDistinct() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
+ * HAVING clauses
+ * @since 4.0
+ */
public boolean supportsScalarSubqueries() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector can accept correlated subqueries wherever subqueries
+ * are accepted
+ * @since 4.0
+ */
public boolean supportsCorrelatedSubqueries() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * 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
+ */
public boolean supportsCaseExpressions() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
+ * @since 4.0
+ */
public boolean supportsSearchedCaseExpressions() {
- return false;
+ return false;
}
-
- @Override
- public List<String> getSupportedFunctions() {
- return null;
+
+ /**
+ * Support indicates that the connector supports the UNION of two queries.
+ * @since 4.2
+ */
+ public boolean supportsUnions() {
+ return false;
}
- public boolean supportsInlineViews() {
- return false;
+ /**
+ * Support indicates that the connector supports an ORDER BY on a SetQuery.
+ * @since 5.6
+ */
+ public boolean supportsSetQueryOrderBy() {
+ return false;
}
- @Override
- public boolean supportsUnions() {
- return false;
+ /**
+ * Support indicates that the connector supports the INTERSECT of two queries.
+ * @since 5.6
+ */
+ public boolean supportsIntersect() {
+ return false;
}
- @Override
+ /**
+ * Support indicates that the connector supports the EXCEPT of two queries.
+ * @since 5.6
+ */
+ public boolean supportsExcept() {
+ return false;
+ }
+
+ /**
+ * Get list of all supported function names. Arithmetic functions have names like
+ * "+".
+ * @since 3.1 SP3
+ */
+ public List<String> getSupportedFunctions() {
+ return null;
+ }
+
+ /**
+ * Get the integer value representing the number of values allowed in an IN criteria
+ * in the WHERE clause of a query
+ * @since 5.0
+ */
public int getMaxInCriteriaSize() {
- return DEFAULT_MAX_FROM_GROUPS;
+ return DEFAULT_MAX_IN_CRITERIA_SIZE;
}
- @Override
+ /**
+ * <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>
+ *
+ * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
+ * @since 5.0
+ */
public boolean supportsFunctionsInGroupBy() {
- return false;
+ return false;
}
- @Override
+ /**
+ * Gets whether the connector can limit the number of rows returned by a query.
+ * @since 5.0 SP1
+ */
public boolean supportsRowLimit() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
+ * result sets that start in the middle of the resulting rows returned by a query
+ * @since 5.0 SP1
+ */
public boolean supportsRowOffset() {
- return false;
+ return false;
}
-
- @Override
+
+ /**
+ * The number of groups supported in the from clause. Added for a Sybase limitation.
+ * @since 5.6
+ * @return the number of groups supported in the from clause, or -1 if there is no limit
+ */
public int getMaxFromGroups() {
- return DEFAULT_MAX_FROM_GROUPS; //-1 indicates no max
+ return DEFAULT_MAX_FROM_GROUPS;
}
-
- @Override
- public boolean supportsExcept() {
- return false;
+
+ /**
+ * Whether the source prefers to use ANSI style joins.
+ * @since 6.0
+ */
+ public boolean useAnsiJoin() {
+ return false;
}
-
- @Override
- public boolean supportsIntersect() {
- return false;
+
+ /**
+ * Whether the source supports queries without criteria.
+ * @since 6.0
+ */
+ @TranslatorProperty(display="Requries Criteria", description="True, if this connector requires criteria on source queries", advanced=true)
+ public final boolean requiresCriteria() {
+ return requiresCriteria;
}
-
- @Override
- public boolean supportsSetQueryOrderBy() {
- return false;
- }
+
+ public void setRequiresCriteria(boolean requiresCriteria) {
+ this.requiresCriteria = requiresCriteria;
+ }
- @Override
- public boolean useAnsiJoin() {
+ /**
+ * Whether the source supports {@link BatchedUpdates}
+ * @since 6.0
+ */
+ public boolean supportsBatchedUpdates() {
return false;
}
-
- @Override
- public boolean requiresCriteria() {
+
+ /**
+ * Whether the source supports updates with multiple value sets
+ * @since 6.0
+ */
+ public boolean supportsBulkUpdate() {
return false;
}
-
- @Override
- public boolean supportsBatchedUpdates() {
- return false;
- }
-
- @Override
- public boolean supportsGroupBy() {
- return false;
- }
-
- @Override
- public boolean supportsHaving() {
- return false;
- }
-
- @Override
- public boolean supportsInnerJoins() {
- return false;
- }
-
- @Override
- public boolean supportsSelectExpression() {
- return false;
- }
+
+ /**
+ * Support indicates that the connector can accept INSERTs with
+ * values specified by an {@link SetQuery}.
+ * @since 6.1
+ */
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
- @Override
- public SupportedJoinCriteria getSupportedJoinCriteria() {
- return SupportedJoinCriteria.ANY;
- }
-
- @Override
- public boolean supportsCompareCriteriaOrdered() {
- return false;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false;
- }
-
- @Override
- public boolean supportsBulkUpdate() {
- return false;
- }
-
- @Override
- public boolean supportsOrderByUnrelated() {
- return false;
- }
-
}
Deleted: trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -1,394 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.SetQuery;
-
-
-/**
- * Allows a connector to specify the capabilities that a connector
- * supports.
- */
-public interface TranslatorCapabilities {
-
- 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
- */
- boolean supportsSelectDistinct();
-
- /**
- * 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 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 inner or cross joins
- * @since 6.1.0
- */
- boolean supportsInnerJoins();
-
- /**
- * Support indicates connector can accept self-joins where a
- * group is joined to itself with aliases. Connector must also support
- * {@link #supportsAliasedGroup()}.
- * @since 3.1 SP2
- */
- boolean supportsSelfJoins();
-
- /**
- * Support indicates connector can accept left outer joins
- * @since 3.1 SP2
- */
- boolean supportsOuterJoins();
-
- /**
- * Support indicates connector can accept full outer joins
- * @since 3.1 SP2
- */
- boolean supportsFullOuterJoins();
-
- /**
- * Support indicates connector can accept inline views (subqueries
- * in the FROM clause).
- * @since 4.1
- */
- boolean supportsInlineViews();
-
- /**
- * 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 = constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaEquals();
-
- /**
- * 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 supportsCompareCriteriaOrdered();
-
- /**
- * 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)
- * @since 3.1 SP2
- */
- boolean supportsLikeCriteriaEscapeCharacter();
-
- /**
- * Support indicates connector accepts criteria of form (element IN set)
- * @since 3.1 SP2
- */
- boolean supportsInCriteria();
-
- /**
- * Support indicates connector accepts IN criteria with a subquery on the right side
- * @since 4.0
- */
- boolean supportsInCriteriaSubquery();
-
- /**
- * Support indicates connector accepts criteria of form (element IS NULL)
- * @since 3.1 SP2
- */
- boolean supportsIsNullCriteria();
-
- /**
- * Support indicates connector accepts logical criteria connected by OR
- * @since 3.1 SP2
- */
- boolean supportsOrCriteria();
-
- /**
- * Support indicates connector accepts logical criteria NOT
- * @since 3.1 SP2
- */
- boolean supportsNotCriteria();
-
- /**
- * Support indicates connector accepts the EXISTS criteria
- * @since 4.0
- */
- boolean supportsExistsCriteria();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use SOME
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaSome();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use ALL
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaAll();
-
- /**
- * Support indicates connector accepts ORDER BY clause, including multiple elements
- * and ascending and descending sorts.
- * @since 3.1 SP2
- */
- boolean supportsOrderBy();
-
- /**
- * Support indicates connector accepts ORDER BY clause with columns not from the select
- * @since 6.2
- * @return
- */
- boolean supportsOrderByUnrelated();
-
- /**
- * Whether the source supports an explicit GROUP BY clause
- * @since 6.1
- */
- 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
- */
- boolean supportsAggregatesSum();
-
- /**
- * Support indicates connector can accept the AVG aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesAvg();
-
- /**
- * Support indicates connector can accept the MIN aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMin();
-
- /**
- * Support indicates connector can accept the MAX aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMax();
-
- /**
- * Support indicates connector can accept the COUNT aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCount();
-
- /**
- * Support indicates connector can accept the COUNT(*) aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCountStar();
-
- /**
- * Support indicates connector can accept DISTINCT within aggregate functions
- * @since 3.1 SP2
- */
- boolean supportsAggregatesDistinct();
-
- /**
- * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
- * HAVING clauses
- * @since 4.0
- */
- boolean supportsScalarSubqueries();
-
- /**
- * Support indicates connector can accept correlated subqueries wherever subqueries
- * are accepted
- * @since 4.0
- */
- boolean supportsCorrelatedSubqueries();
-
- /**
- * 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();
-
- /**
- * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
- * @since 4.0
- */
- boolean supportsSearchedCaseExpressions();
-
- /**
- * Support indicates that the connector supports the UNION of two queries.
- * @since 4.2
- */
- boolean supportsUnions();
-
- /**
- * Support indicates that the connector supports an ORDER BY on a SetQuery.
- * @since 5.6
- */
- boolean supportsSetQueryOrderBy();
-
- /**
- * Support indicates that the connector supports the INTERSECT of two queries.
- * @since 5.6
- */
- boolean supportsIntersect();
-
- /**
- * Support indicates that the connector supports the EXCEPT of two queries.
- * @since 5.6
- */
- boolean supportsExcept();
-
- /**
- * Get list of all supported function names. Arithmetic functions have names like
- * "+".
- * @since 3.1 SP3
- */
- List<String> getSupportedFunctions();
-
- /**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
- */
- int getMaxInCriteriaSize();
-
- /**
- * <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>
- *
- * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
- * @since 5.0
- */
- boolean supportsFunctionsInGroupBy();
-
- /**
- * Gets whether the connector can limit the number of rows returned by a query.
- * @since 5.0 SP1
- */
- boolean supportsRowLimit();
-
- /**
- * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
- * result sets that start in the middle of the resulting rows returned by a query
- * @since 5.0 SP1
- */
- boolean supportsRowOffset();
-
- /**
- * The number of groups supported in the from clause. Added for a Sybase limitation.
- * @since 5.6
- * @return the number of groups supported in the from clause, or -1 if there is no limit
- */
- int getMaxFromGroups();
-
- /**
- * Whether the source prefers to use ANSI style joins.
- * @since 6.0
- */
- boolean useAnsiJoin();
-
- /**
- * Whether the source supports queries without criteria.
- * @since 6.0
- */
- boolean requiresCriteria();
-
- /**
- * Whether the source supports {@link BatchedUpdates}
- * @since 6.0
- */
- boolean supportsBatchedUpdates();
-
- /**
- * Whether the source supports updates with multiple value sets
- * @since 6.0
- */
- boolean supportsBulkUpdate();
-
- /**
- * Support indicates that the connector can accept INSERTs with
- * values specified by an {@link SetQuery}.
- * @since 6.1
- */
- boolean supportsInsertWithQueryExpression();
-
-}
Modified: trunk/api/src/main/java/org/teiid/translator/TranslatorProperty.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/TranslatorProperty.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/api/src/main/java/org/teiid/translator/TranslatorProperty.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -21,6 +21,7 @@
*/
package org.teiid.translator;
+import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
@@ -31,38 +32,44 @@
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
+@Documented
public @interface TranslatorProperty {
public static final String EMPTY_STRING = ""; //$NON-NLS-1$
- public static final String GENERATED = "%GENERATED%"; //$NON-NLS-1$
- // name of the property
- String name() default GENERATED;
-
- // type of the property
- Class type() default java.lang.String.class;
+ /**
+ * Description to be shown in tools
+ * @return
+ */
+ String description() default EMPTY_STRING;
- // description
- String description() default GENERATED;
+ /**
+ * Display name to be shown in tools
+ * @return
+ */
+ String display() default EMPTY_STRING;
- // display name to be used in tools
- String display() default GENERATED;
-
- // is this mandatory property
+ /**
+ * True if a non-null value must be supplied
+ * @return
+ */
boolean required() default false;
- // is it modifiable
- boolean readOnly() default false;
-
- // is advanced?
+ /**
+ * True if this property should be shown in an advanced panel of properties.
+ * @return
+ */
boolean advanced() default false;
- // should mask the values of this property in the tools
+ /**
+ * True if this is property should be masked when displayed - this has no effect on how the value is persisted.
+ * @return
+ */
boolean masked() default false;
- // if this represents a enum what are the legal values?
- String[] allowed() default {};
-
- // what is the default in the string form
- String defaultValue() default EMPTY_STRING;
+ /**
+ * True if this is a full managed property, rather than just a name value pair
+ * @return
+ */
+ boolean managed() default false;
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/Translator.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -26,8 +26,6 @@
public String getExecutionFactoryClass();
- public String getCapabilitiesClass();
-
public boolean isImmutable();
public boolean isExceptionOnMaxRows();
@@ -36,9 +34,5 @@
public boolean isXaCapable();
- public String getOverrideCapabilitiesFile();
-
- public void setOverrideCapabilitiesFile(String propsFile);
-
public String getTemplateName();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -21,7 +21,6 @@
*/
package org.teiid.adminapi.impl;
-import java.io.Serializable;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@@ -38,27 +37,23 @@
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="translator"), properties=ManagementProperties.EXPLICIT)
@XmlAccessorType(XmlAccessType.NONE)
-public class TranslatorMetaData extends AdminObjectImpl implements Translator, Serializable {
+public class TranslatorMetaData extends AdminObjectImpl implements Translator {
private static final long serialVersionUID = 1680003620274793056L;
public static final String EXECUTION_FACTORY_CLASS = "execution-factory-class"; //$NON-NLS-1$
- public static final String CAPBILITIES_CLASS = "capabilities-class"; //$NON-NLS-1$
public static final String IMMUTABLE = "immutable"; //$NON-NLS-1$
public static final String EXCEPTION_ON_MAX_ROWS = "exception-on-max-rows"; //$NON-NLS-1$
public static final String MAX_RESULT_ROWS = "max-result-rows"; //$NON-NLS-1$
public static final String XA_CAPABLE = "xa-capable"; //$NON-NLS-1$
- public static final String OVERRIDE_CAPABILITIES_FILE = "override-capabilities-file"; //$NON-NLS-1$
public static final String NAME = "name"; //$NON-NLS-1$
public static final String TEMPLATE_NAME = "template-name"; //$NON-NLS-1$
// objects are used to keep the jaxb putting verbose xml elements when they are not defined.
private String executionFactoryClass;
- private String capabilitiesClass;
private boolean immutable = false;
private boolean exceptionOnMaxRows = false;
private int maxResultRows = -1;
private boolean xaCapable = false;
- private String overrideCapabilitiesFile;
private String templateName;
@Override
@@ -74,7 +69,7 @@
}
@Override
- @ManagementProperty(name=EXECUTION_FACTORY_CLASS, description="Connector Class", mandatory = true)
+ @ManagementProperty(name=EXECUTION_FACTORY_CLASS, description="Execution Factory Class", mandatory = true)
public String getExecutionFactoryClass() {
return executionFactoryClass;
}
@@ -85,17 +80,6 @@
}
@Override
- @ManagementProperty(name=CAPBILITIES_CLASS, description="The class to use to provide the Connector Capabilities")
- public String getCapabilitiesClass() {
- return capabilitiesClass;
- }
-
- @XmlElement(name = CAPBILITIES_CLASS)
- public void setCapabilitiesClass(String arg0) {
- this.capabilitiesClass = arg0;
- }
-
- @Override
@ManagementProperty(name=IMMUTABLE, description="Is Immutable, True if the source never changes.",mandatory=true, defaultValue="false")
public boolean isImmutable() {
return immutable;
@@ -140,17 +124,6 @@
}
@Override
- @ManagementProperty(name=OVERRIDE_CAPABILITIES_FILE, description="Property file that defines the override capability properties")
- public String getOverrideCapabilitiesFile() {
- return this.overrideCapabilitiesFile;
- }
-
- @XmlElement(name = OVERRIDE_CAPABILITIES_FILE)
- public void setOverrideCapabilitiesFile(String propsFile) {
- this.overrideCapabilitiesFile = propsFile;
- }
-
- @Override
@XmlElement(name = "translator-property", type = PropertyMetadata.class)
@ManagementProperty(name="translator-property", description = "Translator Properties", managed=true)
@ManagementPropertyFactory(TranslatorPropertyFactory.class)
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 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -142,9 +142,17 @@
private String databaseTimeZone;
private boolean trimStrings;
private boolean useCommentsInSourceQuery;
- private int fetchSize;
+ private int fetchSize = 1024;
boolean initialConnection = true;
+
+ public JDBCExecutionFactory() {
+ setSupportsFullOuterJoins(true);
+ setSupportsOrderBy(true);
+ setSupportsOuterJoins(true);
+ setSupportsSelectDistinct(true);
+ setSupportsInnerJoins(true);
+ }
@Override
public void start() throws TranslatorException {
@@ -159,8 +167,8 @@
}
}
- @TranslatorProperty(name="UseBindVariables", display="Use Bind Variables", description="Use prepared statements and bind variables",advanced=true, defaultValue="false")
- public boolean isUseBindVariables() {
+ @TranslatorProperty(display="Use Bind Variables", description="Use prepared statements and bind variables",advanced=true)
+ public boolean useBindVariables() {
return this.useBindVariables;
}
@@ -168,7 +176,7 @@
this.useBindVariables = useBindVariables;
}
- @TranslatorProperty(name="DatabaseTimeZone", display="Database time zone", description="Time zone of the database, if different than Integration Server", advanced=true)
+ @TranslatorProperty(display="Database time zone", description="Time zone of the database, if different than Integration Server", advanced=true)
public String getDatabaseTimeZone() {
return this.databaseTimeZone;
}
@@ -177,7 +185,7 @@
this.databaseTimeZone = databaseTimeZone;
}
- @TranslatorProperty(name="TrimStrings",display="Trim string flag", description="Right Trim fixed character types returned as Strings - note that the native type must be char or nchar and the source must support the rtrim function.",advanced=true, defaultValue="false")
+ @TranslatorProperty(display="Trim string flag", description="Right Trim fixed character types returned as Strings - note that the native type must be char or nchar and the source must support the rtrim function.",advanced=true)
public boolean isTrimStrings() {
return this.trimStrings;
}
@@ -186,8 +194,8 @@
this.trimStrings = trimStrings;
}
- @TranslatorProperty(name="UseCommentsInSourceQuery", display="Use informational comments in Source Queries", description="This will embed /*comment*/ style comment with session/request id in source SQL query for informational purposes", advanced=true, defaultValue="false")
- public boolean isUseCommentsInSourceQuery() {
+ @TranslatorProperty(display="Use informational comments in Source Queries", description="This will embed /*comment*/ style comment with session/request id in source SQL query for informational purposes", advanced=true)
+ public boolean useCommentsInSourceQuery() {
return this.useCommentsInSourceQuery;
}
@@ -196,7 +204,7 @@
}
- @TranslatorProperty(name="FetchSize", display="FetCh Size", description="fetch size used from the connector to its underlying source.", advanced=true, defaultValue="1024")
+ @TranslatorProperty(display="Fetch Size", description="fetch size used from the connector to its underlying source.", advanced=true)
public int getFetchSize() {
return this.fetchSize;
}
@@ -329,7 +337,7 @@
}
@Override
- public boolean supportsAliasedGroup() {
+ public boolean supportsAliasedTable() {
return true;
}
@@ -359,11 +367,6 @@
}
@Override
- public boolean supportsFullOuterJoins() {
- return true;
- }
-
- @Override
public boolean supportsInCriteria() {
return true;
}
@@ -399,21 +402,11 @@
}
@Override
- public boolean supportsOrderBy() {
- return true;
- }
-
- @Override
public boolean supportsOrderByUnrelated() {
return true;
}
@Override
- public boolean supportsOuterJoins() {
- return true;
- }
-
- @Override
public boolean supportsQuantifiedCompareCriteriaAll() {
return true;
}
@@ -429,11 +422,6 @@
}
@Override
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- @Override
public boolean supportsSelfJoins() {
return true;
}
@@ -474,21 +462,11 @@
}
@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;
}
@@ -661,7 +639,7 @@
* indicating the session and request ids.
*/
public boolean addSourceComment() {
- return isUseCommentsInSourceQuery();
+ return useCommentsInSourceQuery();
}
/**
@@ -682,7 +660,7 @@
* can be used to force a literal to be a bind value.
*/
public boolean usePreparedStatements() {
- return isUseBindVariables();
+ return useBindVariables();
}
/**
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 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -33,6 +33,12 @@
*/
public class SimpleJDBCExecutionFactory extends JDBCExecutionFactory {
+ public SimpleJDBCExecutionFactory() {
+ setSupportsOuterJoins(false);
+ setSupportsFullOuterJoins(false);
+ setSupportsOrderBy(false);
+ }
+
@Override
public int getMaxInCriteriaSize() {
return 250;
@@ -69,12 +75,7 @@
}
@Override
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- @Override
- public boolean supportsAliasedGroup() {
+ public boolean supportsAliasedTable() {
return false;
}
@@ -84,16 +85,6 @@
}
@Override
- public boolean supportsOuterJoins() {
- return false;
- }
-
- @Override
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- @Override
public boolean supportsBetweenCriteria() {
return false;
}
@@ -125,11 +116,6 @@
}
@Override
- public boolean supportsOrderBy() {
- return false;
- }
-
- @Override
public boolean supportsAggregatesSum() {
return false;
}
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 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -32,6 +32,10 @@
public class AccessExecutionFactory extends SybaseExecutionFactory {
+ public AccessExecutionFactory() {
+ setSupportsOrderBy(false);
+ }
+
@Override
public String translateLiteralBoolean(Boolean booleanValue) {
if(booleanValue.booleanValue()) {
@@ -46,11 +50,6 @@
}
@Override
- public boolean supportsOrderBy() {
- return false;
- }
-
- @Override
public boolean supportsRowLimit() {
return true;
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -46,6 +46,10 @@
private String version = TEN_1;
+ public DerbyExecutionFactory() {
+ setSupportsFullOuterJoins(false); //Derby supports only left and right outer joins.
+ }
+
@Override
public void start() throws TranslatorException {
super.start();
@@ -68,7 +72,7 @@
return version.compareTo(TEN_4) >= 0;
}
- @TranslatorProperty(name="DatabaseVersion", description= "Version of the postgres", defaultValue=TEN_1)
+ @TranslatorProperty(display="Database Version", description= "Derby Database Version")
public String getDatabaseVersion() {
return this.version;
}
@@ -183,16 +187,7 @@
return false;
}
- /**
- * Derby supports only left and right outer joins.
- * @since 5.0
- */
@Override
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- @Override
public boolean supportsRowLimit() {
return this.version.compareTo(TEN_5) >= 0;
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -49,6 +49,10 @@
*/
public class MySQLExecutionFactory extends JDBCExecutionFactory {
+ public MySQLExecutionFactory() {
+ setSupportsFullOuterJoins(false);
+ }
+
/**
* Adds support for the 2 argument form of padding
*/
@@ -378,11 +382,8 @@
// supportedFunctions.add("VALUES"); //$NON-NLS-1$
return supportedFunctions;
}
+
@Override
- public boolean supportsFullOuterJoins() {
- return false;
- }
- @Override
public boolean supportsAggregatesDistinct() {
return false;
}
@@ -391,6 +392,7 @@
public boolean supportsRowLimit() {
return true;
}
+
@Override
public boolean supportsRowOffset() {
return true;
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -462,7 +462,7 @@
return true;
}
- @TranslatorProperty(name="DatabaseVersion", description= "Version of the postgres", defaultValue=EIGHT_0)
+ @TranslatorProperty(description= "PostgreSQL Database Version")
public String getDatabaseVersion() {
return this.version;
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -35,15 +35,9 @@
public class TeradataExecutionFactory extends JDBCExecutionFactory {
public TeradataExecutionFactory() {
+ setSupportsOuterJoins(false);
}
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
@Override
public List getSupportedFunctions() {
List supportedFunctions = new ArrayList();
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -75,6 +75,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.Table;
import org.teiid.translator.TranslatorException;
+import org.teiid.translator.ldap.LDAPExecutionFactory.SearchDefaultScope;
@@ -326,7 +327,10 @@
// if there is no search scope specified
// try the default in the connector properties
if(searchScopeString.equals("")) { //$NON-NLS-1$
- searchScopeString = this.executionFactory.getSearchDefaultScope();
+ SearchDefaultScope searchDefaultScope = this.executionFactory.getSearchDefaultScope();
+ if (searchDefaultScope != null) {
+ searchScopeString = searchDefaultScope.name();
+ }
// protect against getting null back from the property
if(searchScopeString == null) {
searchScopeString = ""; //$NON-NLS-1$
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 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -43,12 +43,17 @@
*/
public class LDAPExecutionFactory extends ExecutionFactory {
+ public enum SearchDefaultScope {
+ SUBTREE_SCOPE,
+ OBJECT_SCOPE,
+ ONELEVEL_SCOPE
+ }
+
private String searchDefaultBaseDN;
- private boolean restrictToObjectClass = false;
- private String searchDefaultScope = "SUBTREE_SCOPE"; //$NON-NLS-1$
+ private boolean restrictToObjectClass;
+ private SearchDefaultScope searchDefaultScope = SearchDefaultScope.ONELEVEL_SCOPE;
-
- @TranslatorProperty(name="SearchDefaultBaseDN", display="Default Search Base DN", description="Default Base DN for LDAP Searches",advanced=true, defaultValue="")
+ @TranslatorProperty(display="Default Search Base DN", description="Default Base DN for LDAP Searches",required=true)
public String getSearchDefaultBaseDN() {
return searchDefaultBaseDN;
}
@@ -57,7 +62,7 @@
this.searchDefaultBaseDN = searchDefaultBaseDN;
}
- @TranslatorProperty(name="RestrictToObjectClass", display="Restrict Searches To Named Object Class", description="Restrict Searches to objectClass named in the Name field for a table", advanced=true, defaultValue="false")
+ @TranslatorProperty(display="Restrict Searches To Named Object Class", description="Restrict Searches to objectClass named in the Name field for a table", advanced=true)
public boolean isRestrictToObjectClass() {
return restrictToObjectClass;
}
@@ -66,12 +71,12 @@
this.restrictToObjectClass = restrictToObjectClass;
}
- @TranslatorProperty(name="SearchDefaultScope", display="Default Search Scope", description="Default Scope for LDAP Searches", allowed={"OBJECT_SCOPE","ONELEVEL_SCOPE","SUBTREE_SCOPE"},required=true, defaultValue="SUBTREE_SCOPE")
- public String getSearchDefaultScope() {
+ @TranslatorProperty(display="Default Search Scope", description="Default Scope for LDAP Searches")
+ public SearchDefaultScope getSearchDefaultScope() {
return searchDefaultScope;
}
- public void setSearchDefaultScope(String searchDefaultScope) {
+ public void setSearchDefaultScope(SearchDefaultScope searchDefaultScope) {
this.searchDefaultScope = searchDefaultScope;
}
@@ -123,12 +128,6 @@
}
@Override
- public boolean supportsOrderBy() {
- // Removed this support -- see LDAPSyncQueryExecution comments for details.
- return false;
- }
-
- @Override
public boolean supportsRowLimit() {
// GHH 20080408 - turned this on, because I fixed issue
// in nextBatch that was causing this to fail
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -43,7 +43,15 @@
private boolean throwError = false;
private long pollIntervalInMilli = -1;
- @TranslatorProperty(name="wait-time", display="Max Random Wait Time",required=true, advanced=true, defaultValue="0")
+ public LoopbackExecutionFactory() {
+ setSupportsFullOuterJoins(true);
+ setSupportsOrderBy(true);
+ setSupportsOuterJoins(true);
+ setSupportsSelectDistinct(true);
+ setSupportsInnerJoins(true);
+ }
+
+ @TranslatorProperty(display="Max Random Wait Time", advanced=true)
public int getWaitTime() {
return waitTime;
}
@@ -52,7 +60,7 @@
this.waitTime = waitTime.intValue();
}
- @TranslatorProperty(name="row-count", display="Rows Per Query",required=true, advanced=true, defaultValue="1")
+ @TranslatorProperty(display="Rows Per Query", advanced=true)
public int getRowCount() {
return rowCount;
}
@@ -61,7 +69,7 @@
this.rowCount = rowCount;
}
- @TranslatorProperty(name="throw-error", display="Always Throw Error", defaultValue="false")
+ @TranslatorProperty(display="Always Throw Error")
public boolean isThrowError() {
return this.throwError;
}
@@ -70,7 +78,7 @@
this.throwError = error.booleanValue();
}
- @TranslatorProperty(name="poll-intervel", display="Poll interval if using a Asynchronous Connector", defaultValue="-1")
+ @TranslatorProperty(display="Poll interval if using a Asynchronous Connector")
public long getPollIntervalInMilli() {
return this.pollIntervalInMilli;
}
@@ -154,7 +162,7 @@
}
@Override
- public boolean supportsAliasedGroup() {
+ public boolean supportsAliasedTable() {
return true;
}
@@ -184,11 +192,6 @@
}
@Override
- public boolean supportsFullOuterJoins() {
- return true;
- }
-
- @Override
public boolean supportsInCriteria() {
return true;
}
@@ -224,16 +227,6 @@
}
@Override
- public boolean supportsOrderBy() {
- return true;
- }
-
- @Override
- public boolean supportsOuterJoins() {
- return true;
- }
-
- @Override
public boolean supportsQuantifiedCompareCriteriaAll() {
return true;
}
@@ -249,14 +242,10 @@
}
@Override
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- @Override
public boolean supportsSelfJoins() {
return true;
}
+
@Override
public boolean supportsInlineViews() {
return true;
@@ -292,11 +281,6 @@
}
@Override
- public boolean supportsInnerJoins() {
- return true;
- }
-
- @Override
public boolean supportsExcept() {
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 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -51,8 +51,15 @@
private String connectorStateClass;
private boolean auditModelFields = false;
-
+ public SalesForceExecutionFactory() {
+ // http://jira.jboss.org/jira/browse/JBEDSP-306
+ // Salesforce supports ORDER BY, but not on all column types
+ setSupportsOrderBy(false);
+ setSupportsOuterJoins(true);
+ setSupportedJoinCriteria(SupportedJoinCriteria.KEY);
+ }
+
public String getConnectorStateClass() {
return this.connectorStateClass;
}
@@ -60,7 +67,7 @@
this.connectorStateClass = connectorStateClass;
}
- @TranslatorProperty(name="ModelAuditFields", display="Audit Model Fields", advanced=true, defaultValue="false")
+ @TranslatorProperty(display="Audit Model Fields", advanced=true)
public boolean isModelAuditFields() {
return this.auditModelFields;
}
@@ -140,14 +147,7 @@
return true;
}
- // http://jira.jboss.org/jira/browse/JBEDSP-306
- // Salesforce supports ORDER BY, but not on all column types
@Override
- public boolean supportsOrderBy() {
- return false;
- }
-
- @Override
public boolean supportsAggregatesCountStar() {
return true;
}
@@ -167,13 +167,4 @@
return true;
}
- @Override
- public SupportedJoinCriteria getSupportedJoinCriteria() {
- return SupportedJoinCriteria.KEY;
- }
-
- @Override
- public boolean supportsOuterJoins() {
- return true;
- }
}
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -72,7 +72,7 @@
initMetaDataProps();
}
- @TranslatorProperty(name="EnforceColumnCount", display="Enforce Column Count",description="This forces the number of columns in text file to match what was modeled", defaultValue="false")
+ @TranslatorProperty(display="Enforce Column Count",description="This forces the number of columns in text file to match what was modeled")
public boolean isEnforceColumnCount() {
return enforceColumnCount;
}
@@ -81,7 +81,7 @@
this.enforceColumnCount = enforceColumnCount.booleanValue();
}
- @TranslatorProperty(name="DateResultFormatsDelimiter", display="Date Result Formats Delimiter", advanced=true)
+ @TranslatorProperty(display="Date Result Formats Delimiter", advanced=true)
public String getDateResultFormatsDelimiter() {
return dateResultFormatsDelimiter;
}
@@ -90,7 +90,7 @@
this.dateResultFormatsDelimiter = dateResultFormatsDelimiter;
}
- @TranslatorProperty(name="DateResultFormats", display="Date Result Formats",advanced=true)
+ @TranslatorProperty(display="Date Result Formats",advanced=true)
public String getDateResultFormats() {
return dateResultFormats;
}
@@ -99,7 +99,7 @@
this.dateResultFormats = dateResultFormats;
}
- @TranslatorProperty(name="DescriptorFile", display="Descriptor File",required=true)
+ @TranslatorProperty(display="Descriptor File",required=true)
public String getDescriptorFile() {
return descriptorFile;
}
@@ -108,7 +108,7 @@
this.descriptorFile = descriptorFile;
}
- @TranslatorProperty(name="Encoding", display="File Encoding",advanced=true)
+ @TranslatorProperty(display="File Encoding",advanced=true)
public String getEncoding() {
return encoding;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -28,7 +28,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
-import org.teiid.translator.TranslatorCapabilities;
+import org.teiid.translator.ExecutionFactory;
/**
@@ -40,16 +40,16 @@
private CapabilitiesConverter() {
}
- public static SourceCapabilities convertCapabilities(TranslatorCapabilities srcCaps) {
+ public static SourceCapabilities convertCapabilities(ExecutionFactory srcCaps) {
return convertCapabilities(srcCaps, null, false);
}
- public static BasicSourceCapabilities convertCapabilities(TranslatorCapabilities srcCaps, String connectorID, boolean isXa) {
+ public static BasicSourceCapabilities convertCapabilities(ExecutionFactory 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_FROM_GROUP_ALIAS, srcCaps.supportsAliasedGroup());
+ tgtCaps.setCapabilitySupport(Capability.QUERY_FROM_GROUP_ALIAS, srcCaps.supportsAliasedTable());
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());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -56,11 +56,10 @@
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Scope;
import org.teiid.query.sql.lang.Command;
-import org.teiid.translator.TranslatorCapabilities;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
+import org.teiid.translator.TranslatorException;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -45,7 +45,7 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.ExecutionFactory.SupportedJoinCriteria;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -52,7 +52,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.util.CommandContext;
import org.teiid.query.util.Permutation;
-import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.ExecutionFactory.SupportedJoinCriteria;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -54,7 +54,7 @@
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.util.CommandContext;
-import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.ExecutionFactory.SupportedJoinCriteria;
public final class RuleRaiseAccess implements OptimizerRule {
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -27,7 +27,7 @@
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.ExecutionFactory.SupportedJoinCriteria;
public class TestJoinPushdownRestrictions {
Modified: trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ManagedPropertyUtil.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -21,6 +21,8 @@
*/
package org.teiid.deployers;
+import java.io.Serializable;
+import java.lang.reflect.Method;
import java.util.HashSet;
import org.jboss.managed.api.Fields;
@@ -31,15 +33,68 @@
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.MetaValue;
import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.teiid.core.TeiidRuntimeException;
import org.teiid.translator.TranslatorProperty;
public class ManagedPropertyUtil {
+ private static final String[] EMPTY_ALLOWED = new String[0];
private static final String TEIID_PROPERTY = "teiid-property"; //$NON-NLS-1$
- public static ManagedProperty convert(TranslatorProperty prop) {
- return createProperty(prop.name(), SimpleMetaType.resolve(prop.type().getName()),
- prop.display(), prop.description(), prop.required(), prop.readOnly(), prop.defaultValue(),
- prop.advanced(), prop.masked(), prop.allowed());
+ public static ManagedProperty convert(Object instance, Method method, TranslatorProperty prop) {
+ Class<?> type = method.getReturnType();
+ String[] allowedValues = EMPTY_ALLOWED;
+ Method getter = null;
+ boolean readOnly = false;
+ if (type == Void.TYPE) { //check for setter
+ Class<?>[] types = method.getParameterTypes();
+ if (types.length != 1) {
+ throw new TeiidRuntimeException("TranslatorProperty annotation should be placed on valid getter or setter method, " + method + " is not valid."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ type = types[0];
+ try {
+ getter = instance.getClass().getMethod("get" + method.getName(), (Class[])null); //$NON-NLS-1$
+ } catch (Exception e) {
+ try {
+ getter = instance.getClass().getMethod("get" + method.getName().substring(3), (Class[])null); //$NON-NLS-1$
+ } catch (Exception e1) {
+ //can't find getter, won't set the default value
+ }
+ }
+ } else if (method.getParameterTypes().length != 0) {
+ throw new TeiidRuntimeException("TranslatorProperty annotation should be placed on valid getter or setter method, " + method + " is not valid."); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ getter = method;
+ try {
+ TranslatorDeployer.getSetter(instance.getClass(), method);
+ } catch (Exception e) {
+ readOnly = true;
+ }
+ }
+ Object defaultValue = null;
+ if (!prop.required() && getter != null) {
+ try {
+ defaultValue = getter.invoke(instance, (Object[])null);
+ } catch (Exception e) {
+ //no simple default value
+ }
+ }
+ if (type.isEnum()) {
+ Object[] constants = type.getEnumConstants();
+ allowedValues = new String[constants.length];
+ for( int i=0; i<constants.length; i++ ) {
+ allowedValues[i] = ((Enum<?>)constants[i]).name();
+ }
+ type = String.class;
+ if (defaultValue != null) {
+ defaultValue = ((Enum<?>)defaultValue).name();
+ }
+ }
+ if (!(defaultValue instanceof Serializable)) {
+ defaultValue = null; //TODO
+ }
+ return createProperty(TranslatorDeployer.getPropertyName(method), SimpleMetaType.resolve(type.getName()),
+ prop.display(), prop.description(), prop.required(), readOnly, (Serializable)defaultValue,
+ prop.advanced(), prop.masked(), allowedValues);
}
public static ManagedProperty convert(ExtendedPropertyMetadata prop) {
@@ -50,7 +105,7 @@
public static ManagedProperty createProperty(String name,
MetaType type, String displayName, String description,
- boolean mandatory, boolean readOnly, String defaultValue) {
+ boolean mandatory, boolean readOnly, Serializable defaultValue) {
DefaultFieldsImpl fields = new DefaultFieldsImpl(name);
fields.setDescription(description);
@@ -68,7 +123,7 @@
public static ManagedProperty createProperty(String name,
SimpleMetaType type, String displayName, String description,
- boolean mandatory, boolean readOnly, String defaultValue, boolean advanced,
+ boolean mandatory, boolean readOnly, Serializable defaultValue, boolean advanced,
boolean masked, String[] allowed) {
ManagedProperty mp = createProperty(name, type, displayName, description, mandatory, readOnly, defaultValue);
Modified: trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -28,10 +28,10 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.adminapi.impl.TranslatorMetaData;
import org.teiid.core.TeiidException;
import org.teiid.core.util.ReflectionHelper;
+import org.teiid.core.util.StringUtil;
import org.teiid.dqp.internal.datamgr.impl.TranslatorRepository;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -108,43 +108,58 @@
throw new DeploymentException(e);
} catch (IllegalAccessException e) {
throw new DeploymentException(e);
+ }
+ }
+
+ public static String getPropertyName(Method method) {
+ String result = method.getName();
+ if (result.startsWith("get") || result.startsWith("set")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return result.substring(3);
+ }
+ else if (result.startsWith("is")) { //$NON-NLS-1$
+ return result.substring(2);
+ }
+ return result;
+ }
+
+ public static Method getSetter(Class<?> clazz, Method method) throws SecurityException, DeploymentException {
+ String setter = method.getName();
+ if (method.getName().startsWith("get")) { //$NON-NLS-1$
+ setter = "set"+setter.substring(3);//$NON-NLS-1$
+ }
+ else if (method.getName().startsWith("is")) { //$NON-NLS-1$
+ setter = "set"+setter.substring(2); //$NON-NLS-1$
+ }
+ try {
+ return clazz.getMethod(setter, method.getReturnType());
} catch (NoSuchMethodException e) {
- throw new DeploymentException(e);
+ throw new DeploymentException(RuntimePlugin.Util.getString("no_set_method", setter, method.getName())); //$NON-NLS-1$
}
}
-
- private void injectProperties(ExecutionFactory ef, final TranslatorMetaData data) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException, DeploymentException{
+
+ private void injectProperties(ExecutionFactory ef, final TranslatorMetaData data) throws InvocationTargetException, IllegalAccessException, DeploymentException{
Map<Method, TranslatorProperty> props = TranslatorPropertyUtil.getTranslatorProperties(ef.getClass());
for (Method method:props.keySet()) {
TranslatorProperty tp = props.get(method);
- Object value = data.getPropertyValue(tp.name());
- if (value == null) {
- Method[] sourceMethods = data.getClass().getMethods();
- for (Method sm:sourceMethods) {
- ManagementProperty mp = sm.getAnnotation(ManagementProperty.class);
- if (mp != null && mp.name().equals(tp.name())) {
- value = sm.invoke(data);
- break;
- }
- }
+ if (tp.managed()) {
+ continue;
}
+ String propertyName = getPropertyName(method);
+ Object value = data.getPropertyValue(propertyName);
if (value != null) {
- String setter = method.getName();
- if (method.getName().startsWith("get")) { //$NON-NLS-1$
- setter = "set"+method.getName().substring(3);//$NON-NLS-1$
- }
- else if (method.getName().startsWith("is")) { //$NON-NLS-1$
- setter = "set"+method.getName().substring(2); //$NON-NLS-1$
- }
- Method setterMethod = ef.getClass().getMethod(setter, method.getReturnType());
- if (setterMethod == null) {
- throw new DeploymentException(RuntimePlugin.Util.getString("no_set_method", setter, tp.name())); //$NON-NLS-1$
- }
+ Method setterMethod = getSetter(ef.getClass(), method);
setterMethod.invoke(ef, convert(value, method.getReturnType()));
+ } else if (tp.required()) {
+ throw new DeploymentException(RuntimePlugin.Util.getString("required_property_not_exists", tp.display())); //$NON-NLS-1$
}
}
+
+ ef.setExceptionOnMaxRows(data.isExceptionOnMaxRows());
+ ef.setImmutable(data.isImmutable());
+ ef.setMaxResultRows(data.getMaxResultRows());
+ ef.setXaCapable(data.isXaCapable());
}
public void setTranslatorRepository(TranslatorRepository repo) {
@@ -155,31 +170,14 @@
this.vdbChecker = checker;
}
- Object convert(Object value, Class type) {
+ Object convert(Object value, Class<?> type) {
if(value.getClass() == type) {
return value;
}
if (value instanceof String) {
String str = (String)value;
- if (type == int.class || type == Integer.class) {
- return Integer.parseInt(str);
- }
- else if (type == boolean.class || type == Boolean.class) {
- return Boolean.parseBoolean(str);
- }
- else if (type == long.class || type == Long.class) {
- return Long.parseLong(str);
- }
- else if (type == byte.class || type == Byte.class) {
- return Byte.parseByte(str);
- }
- else if (type == short.class || type == Short.class) {
- return Short.parseShort(str);
- }
- else if (type == float.class || type == Float.class) {
- return Float.parseFloat(str);
- }
+ return StringUtil.valueOf(str, type);
}
return value;
}
Modified: trunk/runtime/src/main/java/org/teiid/templates/TranslatorTemplateInfoFactory.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/templates/TranslatorTemplateInfoFactory.java 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/runtime/src/main/java/org/teiid/templates/TranslatorTemplateInfoFactory.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -23,7 +23,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@@ -48,20 +47,26 @@
*/
public DeploymentTemplateInfo createTemplateInfo(Class<? extends DeploymentTemplateInfo> infoClass, Class<?> attachmentClass, String name, String description) throws Exception {
+ Map<String, ManagedProperty> infoProps = getProperties(attachmentClass);
+ Class<?>[] parameterTypes = { String.class, String.class, Map.class };
+ Constructor<? extends DeploymentTemplateInfo> ctor = infoClass.getConstructor(parameterTypes);
+ DeploymentTemplateInfo info = ctor.newInstance(name, description,infoProps);
+ return info;
+ }
+
+ public static Map<String, ManagedProperty> getProperties(
+ Class<?> attachmentClass)
+ throws InstantiationException, IllegalAccessException {
Map<Method, TranslatorProperty> props = TranslatorPropertyUtil.getTranslatorProperties(attachmentClass);
Map<String, ManagedProperty> infoProps = new HashMap<String, ManagedProperty>();
- Collection<TranslatorProperty> propertyInfos = props.values();
- if (propertyInfos != null && !propertyInfos.isEmpty()) {
- for (TranslatorProperty propertyInfo : propertyInfos) {
- ManagedProperty mp = ManagedPropertyUtil.convert(propertyInfo);
- infoProps.put(mp.getName(), mp);
- }
+ Object factory = attachmentClass.newInstance();
+
+ for (Map.Entry<Method, TranslatorProperty> entry : props.entrySet()) {
+ ManagedProperty mp = ManagedPropertyUtil.convert(factory, entry.getKey(), entry.getValue());
+ infoProps.put(mp.getName(), mp);
}
- Class<?>[] parameterTypes = { String.class, String.class, Map.class };
- Constructor<? extends DeploymentTemplateInfo> ctor = infoClass.getConstructor(parameterTypes);
- DeploymentTemplateInfo info = ctor.newInstance(name, description,infoProps);
- return info;
+ return infoProps;
}
}
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-05-13 19:04:27 UTC (rev 2126)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-05-17 20:23:50 UTC (rev 2127)
@@ -303,6 +303,6 @@
class_not_found=Class {0} not found.
translator_stopped=Teiid translator "{0}" stopped
no_set_method=No {0} method found for translator property {1}
-required_property_not_exists=Required property "{0}" and its value not specified. Deployment is incomplete.
+required_property_not_exists=Required property "{0}" has no value. Deployment is incomplete.
name_not_found=Translator property "name" not defined for the deployment "{0}"
executionfactory_not_found=Translator "execution-factory-class" property not defined for deployment "{0}"
\ No newline at end of file
Added: trunk/runtime/src/test/java/org/teiid/deployers/TestManagedPropertyUtil.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestManagedPropertyUtil.java (rev 0)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestManagedPropertyUtil.java 2010-05-17 20:23:50 UTC (rev 2127)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.deployers;
+
+import static org.junit.Assert.*;
+
+import java.util.Map;
+
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.junit.Test;
+import org.teiid.deployers.TestManagedPropertyUtil.FakeExecutionFactory.PropEnum;
+import org.teiid.templates.TranslatorTemplateInfoFactory;
+import org.teiid.translator.TranslatorProperty;
+
+@SuppressWarnings("nls")
+public class TestManagedPropertyUtil {
+
+ public static class FakeExecutionFactory {
+
+ public enum PropEnum {
+ A, B, C
+ }
+
+ private PropEnum val = PropEnum.A;
+
+ @TranslatorProperty(display="Read Only")
+ public int readonly() {
+ return 1;
+ }
+
+ @TranslatorProperty(display="Setter Property")
+ public void x(@SuppressWarnings("unused") String y) {
+
+ }
+
+ @TranslatorProperty(display="Enum Property")
+ public PropEnum getEnum() {
+ return val;
+ }
+
+ public void setEnum(PropEnum value) {
+ this.val = value;
+ }
+
+ }
+
+ @Test public void testAnnotationProcessing() throws Exception {
+ FakeExecutionFactory ef = new FakeExecutionFactory();
+
+ Map<String, ManagedProperty> properties = TranslatorTemplateInfoFactory.getProperties(ef.getClass());
+ ManagedProperty mp = properties.get("readonly");
+ assertTrue(mp.isReadOnly());
+ assertEquals(Integer.valueOf(1), MetaValueFactory.getInstance().unwrap(mp.getDefaultValue()));
+
+ mp = properties.get("x");
+ assertFalse(mp.isReadOnly());
+ assertNull(mp.getDefaultValue());
+
+ mp = properties.get("Enum");
+ assertFalse(mp.isReadOnly());
+ assertEquals(PropEnum.A.name(), MetaValueFactory.getInstance().unwrap(mp.getDefaultValue()));
+ }
+
+}
Property changes on: trunk/runtime/src/test/java/org/teiid/deployers/TestManagedPropertyUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 11 months
teiid SVN: r2126 - in trunk: client/src/main/java/org/teiid/adminapi and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-05-13 15:04:27 -0400 (Thu, 13 May 2010)
New Revision: 2126
Modified:
trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
trunk/client/src/main/java/org/teiid/adminapi/Translator.java
trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java
trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java
trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
Log:
TEIID-1079: adding an addtional property called "template-name", that includes the template name with which the translator created.
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-13 19:04:27 UTC (rev 2126)
@@ -3,54 +3,63 @@
<translator>
<name>access</name>
<execution-factory-class>org.teiid.translator.jdbc.access.AccessExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>db2</name>
<execution-factory-class>org.teiid.translator.jdbc.db2.DB2ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>derby</name>
<execution-factory-class>org.teiid.translator.jdbc.derby.DerbyExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>h2</name>
<execution-factory-class>org.teiid.translator.jdbc.h2.H2ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>hsql</name>
<execution-factory-class>org.teiid.translator.jdbc.hsql.HsqlExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>mysql</name>
<execution-factory-class>org.teiid.translator.jdbc.mysql.MySQLExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>mysql5</name>
<execution-factory-class>org.teiid.translator.jdbc.mysql.MySQL5ExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>oracle</name>
<execution-factory-class>org.teiid.translator.jdbc.oracle.OracleExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>postgresql</name>
<execution-factory-class>org.teiid.translator.jdbc.postgresql.PostgreSQLExecutionFactory</execution-factory-class>
+ <template-name>translator-jdbc-${project.version}</template-name>
<xa-capable>true</xa-capable>
</translator>
@@ -58,11 +67,13 @@
<name>sqlserver</name>
<execution-factory-class>org.teiid.translator.jdbc.sqlserver.SQLServerExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
+ <template-name>translator-jdbc-${project.version}</template-name>
</translator>
<translator>
<name>sybase</name>
<execution-factory-class>org.teiid.translator.jdbc.sybase.SybaseExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
+ <template-name>translator-jdbc-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-13 19:04:27 UTC (rev 2126)
@@ -3,6 +3,7 @@
<translator>
<name>ldap</name>
<execution-factory-class>org.teiid.translator.ldap.LDAPExecutionFactory</execution-factory-class>
+ <template-name>translator-ldap-${project.version}</template-name>
<translator-property name="SearchDefaultBaseDN" value="" />
<translator-property name="SearchDefaultScope" value="SUBTREE_SCOPE" />
<translator-property name="RestrictToObjectClass" value="false" />
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-13 19:04:27 UTC (rev 2126)
@@ -3,5 +3,6 @@
<translator>
<name>loopback</name>
<execution-factory-class>org.teiid.translator.loopback.LoopbackExecutionFactory</execution-factory-class>
+ <template-name>translator-loopback-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-13 19:04:27 UTC (rev 2126)
@@ -3,5 +3,6 @@
<translator>
<name>salesforce</name>
<execution-factory-class>org.teiid.translator.salesforce.SalesForceExecutionFactory</execution-factory-class>
+ <template-name>translator-salesforce-${project.version}</template-name>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/client/src/main/java/org/teiid/adminapi/Translator.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/client/src/main/java/org/teiid/adminapi/Translator.java 2010-05-13 19:04:27 UTC (rev 2126)
@@ -39,4 +39,6 @@
public String getOverrideCapabilitiesFile();
public void setOverrideCapabilitiesFile(String propsFile);
+
+ public String getTemplateName();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/TranslatorMetaData.java 2010-05-13 19:04:27 UTC (rev 2126)
@@ -49,6 +49,7 @@
public static final String XA_CAPABLE = "xa-capable"; //$NON-NLS-1$
public static final String OVERRIDE_CAPABILITIES_FILE = "override-capabilities-file"; //$NON-NLS-1$
public static final String NAME = "name"; //$NON-NLS-1$
+ public static final String TEMPLATE_NAME = "template-name"; //$NON-NLS-1$
// objects are used to keep the jaxb putting verbose xml elements when they are not defined.
private String executionFactoryClass;
@@ -58,6 +59,7 @@
private int maxResultRows = -1;
private boolean xaCapable = false;
private String overrideCapabilitiesFile;
+ private String templateName;
@Override
@ManagementProperty(name="name", description="Name of the Translator", mandatory = true)
@@ -156,6 +158,17 @@
return super.getJAXBProperties();
}
+ @Override
+ @ManagementProperty(name=TEMPLATE_NAME, description = "Template with which this Translator is created")
+ public String getTemplateName() {
+ return templateName;
+ }
+
+ @XmlElement(name = TEMPLATE_NAME)
+ public void setTemplateName(String templateName) {
+ this.templateName = templateName;
+ }
+
public String toString() {
return getName();
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java 2010-05-13 19:04:27 UTC (rev 2126)
@@ -193,8 +193,6 @@
throw new AdminProcessingException(IntegrationPlugin.Util.getString("translator_template_not_found", typeName)); //$NON-NLS-1$
}
- properties.setProperty("name", deploymentName); //$NON-NLS-1$
-
// template properties specific to the template
Map<String, ManagedProperty> propertyMap = info.getProperties();
@@ -208,6 +206,9 @@
}
}
}
+ propertyMap.get(TranslatorMetaData.NAME).setValue(SimpleValueSupport.wrap(deploymentName));
+ propertyMap.get(TranslatorMetaData.TEMPLATE_NAME).setValue(SimpleValueSupport.wrap(typeName));
+
getView().applyTemplate(deploymentName, info);
} catch (NoSuchDeploymentException e) {
throw new AdminComponentException(e.getMessage(), e);
Modified: trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorMetadata.java 2010-05-13 19:04:27 UTC (rev 2126)
@@ -48,6 +48,7 @@
tm.setExecutionFactoryClass("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory");
tm.setXaCapable(true);
tm.setName("Oracle");
+ tm.setTemplateName("template name");
tm.addProperty("ExtensionTranslationClassName", "org.teiid.translator.jdbc.oracle.OracleSQLTranslator");
JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {TranslatorMetaDataGroup.class});
@@ -67,6 +68,7 @@
assertEquals("Oracle", tm.getName());
assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory", tm.getExecutionFactoryClass());
assertEquals("org.teiid.translator.jdbc.oracle.OracleSQLTranslator", tm.getPropertyValue("ExtensionTranslationClassName"));
+ assertEquals("template name", tm.getTemplateName());
}
}
Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-05-13 18:31:49 UTC (rev 2125)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java 2010-05-13 19:04:27 UTC (rev 2126)
@@ -385,15 +385,15 @@
}
// test minimal correct add
- props.setProperty("execution-factory-class", "org.teiid.resource.adapter.jdbc.JDBCExecutionFactory");
+ props.setProperty("execution-factory-class", "org.teiid.translator.jdbc.JDBCExecutionFactory");
admin.addTranslator("foo", "translator-jdbc"+VERSION, props);
// test set property
admin.setTranslatorProperty("foo", "TrimStrings", "true");
Translator t = admin.getTranslator("foo");
- assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory", t.getExecutionFactoryClass());
- assertEquals("org.teiid.resource.adapter.jdbc.JDBCExecutionFactory", t.getExecutionFactoryClass());
+ assertEquals("org.teiid.translator.jdbc.JDBCExecutionFactory", t.getExecutionFactoryClass());
+ assertEquals("org.teiid.translator.jdbc.JDBCExecutionFactory", t.getExecutionFactoryClass());
admin.setTranslatorProperty("foo", "any-thing", "every-thing");
13 years, 11 months
teiid SVN: r2125 - in trunk/console/src/main: java/org/teiid/rhq/plugin/util and 1 other directories.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-05-13 14:31:49 -0400 (Thu, 13 May 2010)
New Revision: 2125
Added:
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
Removed:
trunk/console/src/main/java/org/teiid/rhq/plugin/ModelComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java
Modified:
trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
Added Translator discovery and configuration
Deleted: trunk/console/src/main/java/org/teiid/rhq/plugin/ModelComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/ModelComponent.java 2010-05-13 16:19:04 UTC (rev 2124)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/ModelComponent.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -1,101 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.rhq.plugin;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.MeasurementReport;
-import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
-import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
-import org.teiid.rhq.comm.ConnectionConstants;
-
-
-/**
- * Component class for the MetaMatrix Host Controller process.
- *
- */
-public class ModelComponent extends Facet {
- private final Log LOG = LogFactory
- .getLog(ModelComponent.class);
-
-
- /**
- * @see org.teiid.rhq.plugin.Facet#getComponentType()
- * @since 1.0
- */
- @Override
- String getComponentType() {
- return ConnectionConstants.ComponentType.Resource.Model.TYPE;
- }
-
- /**
- * The plugin container will call this method when your resource component
- * has been scheduled to collect some measurements now. It is within this
- * method that you actually talk to the managed resource and collect the
- * measurement data that is has emitted.
- *
- * @see MeasurementFacet#getValues(MeasurementReport, Set)
- */
- public void getValues(MeasurementReport report,
- Set<MeasurementScheduleRequest> requests) {
- for (MeasurementScheduleRequest request : requests) {
- String name = request.getName();
-
- // TODO: based on the request information, you must collect the
- // requested measurement(s)
- // you can use the name of the measurement to determine what you
- // actually need to collect
- try {
- Number value = new Integer(1); // dummy measurement value -
- // this should come from the
- // managed resource
- report.addData(new MeasurementDataNumeric(request, value
- .doubleValue()));
- } catch (Exception e) {
- LOG.error("Failed to obtain measurement [" + name //$NON-NLS-1$
- + "]. Cause: " + e); //$NON-NLS-1$
- }
- }
-
- return;
- }
-
- protected void setOperationArguments(String name, Configuration configuration,
- Map argumentMap) {
-
- if (name.equals(ConnectionConstants.ComponentType.Operation.GET_PROPERTIES)){
- String key = ConnectionConstants.IDENTIFIER;
- argumentMap.put(key, getComponentIdentifier());
- }
-
- }
-
-}
\ No newline at end of file
Deleted: trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java 2010-05-13 16:19:04 UTC (rev 2124)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -1,126 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.rhq.plugin;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.managed.api.ComponentType;
-import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.managed.plugins.ManagedObjectImpl;
-import org.jboss.metatype.api.values.CollectionValueSupport;
-import org.jboss.metatype.api.values.GenericValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValueSupport;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.Property;
-import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.configuration.PropertyMap;
-import org.rhq.core.domain.configuration.PropertySimple;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
-import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
-import org.teiid.rhq.plugin.util.PluginConstants;
-import org.teiid.rhq.plugin.util.ProfileServiceUtil;
-
-/**
- * Discovery component for the MetaMatrix Host controller process
- *
- */
-public class ModelDiscoveryComponent implements ResourceDiscoveryComponent {
-
- private final Log log = LogFactory.getLog(this.getClass());
-
- public Set<DiscoveredResourceDetails> discoverResources(
- ResourceDiscoveryContext discoveryContext)
- throws InvalidPluginConfigurationException, Exception {
- Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
-
- for (int i = 0; i < 3; i++) {
- String modelName = "myModel" + i;
-
- DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
- discoveryContext.getResourceType(), // ResourceType
- modelName, // Resource Key
- modelName, // Resource Name
- null, // Version TODO can we get that from discovery ?
- PluginConstants.ComponentType.Model.DESCRIPTION, // Description
- discoveryContext.getDefaultPluginConfiguration(), // Plugin
- // Config
- null // Process info from a process scan
- );
-
- Configuration c = detail.getPluginConfiguration();
- c.put(new PropertySimple(modelName, "name"));
-
- PropertyList list = new PropertyList("multisourceModels");
- PropertyMap map = new PropertyMap("model",
- new PropertySimple("oraclesource", "sourceName"),
- new PropertySimple("JNDINameOracle", "jndiName"),
- new PropertySimple("MySQLsource", "sourceName"),
- new PropertySimple("JNDINameMySQL", "jndiName"));
- list.add(map);
-
- detail.setPluginConfiguration(c);
- // Add to return values
- discoveredResources.add(detail);
- log.info("Discovered Teiid Model: " + modelName);
- }
-
- return discoveredResources;
- }
-
- /**
- * @param mcVdb
- * @param configuration
- */
- private void getConnectors(ManagedComponent model,
- Configuration configuration) {
- // Get Connector(s) from Model
- ManagedProperty property = model.getProperty("connectorBindingNames");
- CollectionValueSupport valueSupport = (CollectionValueSupport) property
- .getValue();
- MetaValue[] metaValues = valueSupport.getElements();
-
- PropertyList connectorsList = new PropertyList("connectors");
- configuration.put(connectorsList);
-
- for (MetaValue value : metaValues) {
- SimpleValueSupport simpleValueSupport = (SimpleValueSupport) value;
- String connectorName = (String) simpleValueSupport.getValue();
-
- PropertyMap connector = new PropertyMap("connector",
- new PropertySimple("name", connectorName));
- connectorsList.add(connector);
- }
- }
-
-}
\ No newline at end of file
Copied: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java (from rev 2015, trunk/console/src/main/java/org/teiid/rhq/plugin/ModelComponent.java)
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java (rev 0)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.rhq.plugin;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.teiid.rhq.comm.ConnectionConstants;
+
+
+/**
+ * Component class for the MetaMatrix Host Controller process.
+ *
+ */
+public class TranslatorComponent extends Facet {
+ private final Log LOG = LogFactory
+ .getLog(TranslatorComponent.class);
+
+
+ /**
+ * @see org.teiid.rhq.plugin.Facet#getComponentType()
+ * @since 1.0
+ */
+ @Override
+ String getComponentType() {
+ return ConnectionConstants.ComponentType.Resource.Model.TYPE;
+ }
+
+ /**
+ * The plugin container will call this method when your resource component
+ * has been scheduled to collect some measurements now. It is within this
+ * method that you actually talk to the managed resource and collect the
+ * measurement data that is has emitted.
+ *
+ * @see MeasurementFacet#getValues(MeasurementReport, Set)
+ */
+ public void getValues(MeasurementReport report,
+ Set<MeasurementScheduleRequest> requests) {
+ for (MeasurementScheduleRequest request : requests) {
+ String name = request.getName();
+
+ // TODO: based on the request information, you must collect the
+ // requested measurement(s)
+ // you can use the name of the measurement to determine what you
+ // actually need to collect
+ try {
+ Number value = new Integer(1); // dummy measurement value -
+ // this should come from the
+ // managed resource
+ report.addData(new MeasurementDataNumeric(request, value
+ .doubleValue()));
+ } catch (Exception e) {
+ LOG.error("Failed to obtain measurement [" + name //$NON-NLS-1$
+ + "]. Cause: " + e); //$NON-NLS-1$
+ }
+ }
+
+ return;
+ }
+
+ protected void setOperationArguments(String name, Configuration configuration,
+ Map argumentMap) {
+
+ if (name.equals(ConnectionConstants.ComponentType.Operation.GET_PROPERTIES)){
+ String key = ConnectionConstants.IDENTIFIER;
+ argumentMap.put(key, getComponentIdentifier());
+ }
+
+ }
+
+}
\ No newline at end of file
Copied: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java (from rev 2064, trunk/console/src/main/java/org/teiid/rhq/plugin/ModelDiscoveryComponent.java)
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java (rev 0)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.rhq.plugin;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.teiid.adminapi.impl.PropertyMetadata;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+
+/**
+ * Discovery component for Teiid Translator instances
+ *
+ */
+public class TranslatorDiscoveryComponent implements ResourceDiscoveryComponent {
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ public Set<DiscoveredResourceDetails> discoverResources(
+ ResourceDiscoveryContext discoveryContext)
+ throws InvalidPluginConfigurationException, Exception {
+ Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
+
+ Set<ManagedComponent> translators = ProfileServiceUtil
+ .getManagedComponents(new ComponentType(
+ PluginConstants.ComponentType.Translator.TYPE,
+ PluginConstants.ComponentType.Translator.SUBTYPE));
+
+ for (ManagedComponent translator : translators) {
+
+ Map<String, ManagedProperty> managedPropertyMap = translator
+ .getProperties();
+ String translatorKey = translator.getName();
+ String translatorName = ProfileServiceUtil.getSimpleValue(
+ translator, "name", String.class);
+ /**
+ *
+ * A discovered resource must have a unique key, that must stay the
+ * same when the resource is discovered the next time
+ */
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ discoveryContext.getResourceType(), // ResourceType
+ translatorKey, // Resource Key
+ translatorName, // Resource Name
+ null, // Version
+ PluginConstants.ComponentType.Translator.DESCRIPTION, // Description
+ discoveryContext.getDefaultPluginConfiguration(), // Plugin
+ // Config
+ null // Process info from a process scan
+ );
+
+ Configuration c = detail.getPluginConfiguration();
+ PropertyList list = new PropertyList("translatorList");
+ PropertyMap propMap = null;
+ c.put(list);
+
+ for (ManagedProperty prop : managedPropertyMap.values()) {
+ propMap = new PropertyMap("translatorMap");
+ String name = prop.getName();
+ if (name.equals("translator-property")) {
+ getTranslatorValues(prop.getValue(), propMap, list);
+ } else {
+ propMap.put(new PropertySimple("name", name));
+ propMap.put(new PropertySimple("value", ProfileServiceUtil
+ .stringValue(prop.getValue())));
+ propMap.put(new PropertySimple("description", prop
+ .getDescription()));
+ list.add(propMap);
+ }
+ }
+
+ detail.setPluginConfiguration(c);
+ // Add to return values
+ discoveredResources.add(detail);
+ log.info("Discovered Teiid Translator: " + translatorName);
+ }
+
+ return discoveredResources;
+ }
+
+ public static <T> void getTranslatorValues(MetaValue pValue,
+ PropertyMap map, PropertyList list) {
+ MetaType metaType = pValue.getMetaType();
+ PropertyMetadata unwrappedvalue = null;
+ if (metaType.isCollection()) {
+ for (MetaValue value : ((CollectionValueSupport) pValue)
+ .getElements()) {
+ if (value.getMetaType().isComposite()) {
+ map = new PropertyMap("translatorMap");
+ unwrappedvalue = (PropertyMetadata) MetaValueFactory
+ .getInstance().unwrap(value);
+ map
+ .put(new PropertySimple("name", unwrappedvalue
+ .getName()));
+ map.put(new PropertySimple("value", unwrappedvalue
+ .getValue()));
+ map
+ .put(new PropertySimple("description",
+ "Custom property"));
+ list.add(map);
+ } else {
+ throw new IllegalStateException(pValue
+ + " is not a Composite type");
+ }
+ }
+ }
+ }
+
+}
\ No newline at end of file
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-13 16:19:04 UTC (rev 2124)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -331,7 +331,6 @@
String jndiName = (String) sourceMap.get("jndiName");
String translatorName = (String) sourceMap.get("translatorName");
PropertyMap multiSourceModel = null;
- PropertyMap multiSourceModel2 = null;
PropertyMap model = null;
if (supportMultiSource){
@@ -352,13 +351,7 @@
new PropertySimple("visibility", visibility),
new PropertySimple("supportsMultiSource",
true));
- sourceModelsList.add(model);
- multiSourceModel = new PropertyMap("model",
- new PropertySimple("name", modelName),
- new PropertySimple("sourceName", sourceName),
- new PropertySimple("jndiName", jndiName),
- new PropertySimple("translatorName", translatorName));
- multiSourceModelsList.add(multiSourceModel);
+ sourceModelsList.add(model);
}else{
model = new PropertyMap("model",
new PropertySimple("name", modelName),
Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-05-13 16:19:04 UTC (rev 2124)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java 2010-05-13 18:31:49 UTC (rev 2125)
@@ -121,6 +121,22 @@
}
+ public interface Translator {
+
+ public final static String TYPE = "teiid"; //$NON-NLS-1$
+ public final static String SUBTYPE = "translator"; //$NON-NLS-1$
+ public final static String NAME = "Translator"; //$NON-NLS-1$
+ public final static String DESCRIPTION = "Teiid Translator"; //$NON-NLS-1$
+
+ public static interface Operations {
+
+ }
+
+ public static interface Metrics {
+
+ }
+
+ }
public interface Model {
public final static String TYPE = "teiid"; //$NON-NLS-1$
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-13 16:19:04 UTC (rev 2124)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2010-05-13 18:31:49 UTC (rev 2125)
@@ -16,7 +16,758 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
02110-1301 USA. */
-->
+
+ <!DOCTYPE plugin [
+<!ENTITY managedObjectMetrics '
+ <metric property="runState" displayType="summary"
+ defaultOn="true" defaultInterval="30000" dataType="trait" category="performance"/>
+'>
+
+<!ENTITY translatorConfiguration '
+ <resource-configuration>
+ <c:list-property name="translatorList" description="Properties for this translator"
+ readOnly="true">
+ <c:map-property name="translatorMap">
+ <c:simple-property name="name" displayName="Name"
+ description="Name of this property" readOnly="true" />
+ <c:simple-property name="value" displayName="Value"
+ description="Value of this property" readOnly="true" />
+ <c:simple-property name="description" displayName="Description"
+ description="Description of this property" readOnly="true" />
+ </c:map-property>
+ </c:list-property>
+ </resource-configuration>
+
+
+'>
+
+
+<!ENTITY datasourceAndConnectionFactoryOperations '
+ <operation name="flush" displayName="Flush"
+ description="Flush the connections in the pool"/>
+
+ <operation name="listFormattedSubPoolStatistics" displayName="List Formatted Sub Pool Statistics"
+ description="Obtain a formatted sub pool statistics report">
+ <parameters>
+ <c:simple-property required="false" name="formatClassName"
+ defaultValue="org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter">
+ <c:description>
+ The fully qualified name of the Java class to use to format the the sub pool statistics. The default
+ is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
+ </c:description>
+ </c:simple-property>
+ </parameters>
+ <results>
+ <c:simple-property name="result" type="longString">
+ <c:description>
+ A formatted sub pool statistics report.
+ </c:description>
+ </c:simple-property>
+ </results>
+ </operation>
+
+ <operation name="listStatistics" displayName="List Statistics" description="Obtain a statistics report">
+ <results>
+ <c:map-property name="result"/>
+ </results>
+ </operation>
+'>
+
+<!-- TODO: Use one shared XML entity for datasource and connection factory metrics. -->
+<!ENTITY datasourceMetrics '
+ <!-- Traits -->
+ <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name"
+ defaultOn="true" defaultInterval="60000" dataType="trait" category="performance"
+ description="the JNDI name of the connection pool for this datasource"/>
+
+ <!-- Numerics -->
+ <metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the maximum number of connections that are available"/>
+
+ <metric property="connectionCount" measurementType="dynamic" displayType="summary"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the number of connections that are currently in the pool"/>
+
+ <metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the number of connections that have been created since the datasource was last started"/>
+
+ <metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the number of connections that have been destroyed since the datasource was last started"/>
+
+ <metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the number of connections that are currently in use"/>
+
+ <metric property="local-transaction" displayType="summary"
+ defaultOn="true" defaultInterval="60000" dataType="trait" category="performance"/>
+
+ <metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"
+ description="the most connections that have been simultaneously in use since this datasource was started"/>
+
+ <metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+
+ <metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+'>
+
+<!-- NOTE: For Datasource ManagedProperty annotations, see:
+ https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
+ Descriptions of datasource config props can also be culled from the following locations:
+ https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/resources/dtd...
+ http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Ad...
+ http://www.jboss.org/community/wiki/ConfigDataSources
+ http://www.jboss.org/community/wiki/ConfigJCACommon
+ -->
+
+<!ENTITY datasourceAndConnectionFactoryConnectionResourceConfigProps '
+ <c:simple-property name="min-pool-size"
+ displayName="Minimum Pool Size"
+ type="integer"
+ required="false"
+ defaultValue="0">
+ <c:description>
+ The minimum number of connections the pool should hold. The default is 0.
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="max-pool-size"
+ displayName="Maximum Pool Size"
+ type="integer"
+ required="false"
+ defaultValue="10">
+ <c:description>
+ The maximum number of connections the pool should hold. The default is 10.
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+'>
+
+<!ENTITY datasourceConnectionResourceConfigProps '
+ <c:simple-property name="jndi-name"
+ displayName="JNDI Name"
+ description="The global JNDI Name under which to bind the datasource"
+ type="string"/>
+
+ <c:simple-property name="user-name"
+ displayName="Username"
+ description="The default username when creating a new connection."
+ type="string"
+ activationPolicy="immediate"
+ required="false"/>
+
+ <c:simple-property name="password"
+ displayName="Password"
+ description="The default password when creating a new connection."
+ type="password"
+ activationPolicy="immediate"
+ required="false"/>
+'>
+
+<!ENTITY datasourceAndConnectionFactoryAdvancedResourceConfigProps '
+ <c:simple-property name="allocation-retry" type="integer" required="false"
+ defaultValue="0">
+ <c:description>
+ The number of times that allocating a connection should be tried before throwing an exception. The default
+ is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="allocation-retry-wait-millis" type="long" required="false" units="milliseconds"
+ defaultValue="5000">
+ <c:description>
+ The time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds).
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="background-validation" type="boolean" required="false" defaultValue="false">
+ <c:description>
+ Specify if connections should be validated on a background thread versus being validated
+ prior to use. Background validation is meant to reduce the overall load on the RDBMS system when validating
+ a connection. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="background-validation-millis" type="long" required="false" units="milliseconds"
+ defaultValue="0">
+ <c:description>
+ The interval, in milliseconds, at which the ConnectionValidator will run. Set to 0 to disable background
+ validation. The default is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="blocking-timeout-millis" displayName="Blocking Timeout in Milliseconds"
+ units="milliseconds" defaultValue="30000"
+ type="integer" required="false">
+ <c:description>
+ Indicates the maximum time in milliseconds to block while waiting for a connection before throwing
+ an exception. Note that this blocks only while waiting for a permit for a connection, and will never
+ throw an exception if creating a new connection takes an inordinately long time. The default is 30000
+ (30 seconds).
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="idle-timeout-minutes" type="integer" activationPolicy="immediate"
+ displayName="Idle Timeout" units="minutes" required="false" defaultValue="30">
+ <c:description>
+ The maximum time, in minutes, a connection may be idle before being closed. The default is 30.
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="isSameRM-override-value" type="boolean" required="false">
+ <c:description>
+ If set, unconditionally sets the boolean return value of javax.transaction.xa.XAResource.isSameRM(XAResource).
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="jmx-invoker-name" required="false">
+ <c:description>
+ The ObjectName of the JMX Invoker MBean associated with this datasource.
+ </c:description>
+ </c:simple-property>
+
+ <c:map-property name="metadata" required="false" description="Metadata properties.">
+ <c:simple-property required="false" name="typeMapping">
+ <c:description>
+ The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+ </c:description>
+ <c:property-options>
+ <c:option name="Cloudscape" value="Cloudscape"/>
+ <c:option name="DB2" value="DB2"/>
+ <c:option name="DB2/400" value="DB2/400"/>
+ <c:option name="Derby" value="Derby"/>
+ <c:option name="Firebird" value="Firebird"/>
+ <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+ <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+ <c:option name="InformixDB" value="InformixDB"/>
+ <c:option name="Ingres" value="Ingres"/>
+ <c:option name="InterBase" value="InterBase"/>
+ <c:option name="MaxDB" value="MaxDB"/>
+ <c:option name="McKoi" value="McKoi"/>
+ <c:option name="Mimer SQL" value="Mimer SQL"/>
+ <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+ <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+ <c:option name="Oracle7" value="Oracle7"/>
+ <c:option name="Oracle8" value="Oracle8"/>
+ <c:option name="Oracle9i" value="Oracle9i"/>
+ <c:option name="PointBase" value="PointBase"/>
+ <c:option name="PostgreSQL" value="PostgreSQL"/>
+ <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+ <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+ <c:option name="SapDB" value="SapDB"/>
+ <c:option name="SOLID" value="SOLID"/>
+ <c:option name="Sybase" value="Sybase"/>
+ </c:property-options>
+ </c:simple-property>
+ </c:map-property>
+
+ <c:simple-property name="no-tx-separate-pools" type="boolean"
+ displayName="No Tx Separate Pools" required="false">
+ <c:description>Whether or not to use separate pools. The default is Yes.</c:description>
+ <c:property-options>
+ <c:option name="True" value="true"/>
+ <c:option name="False" value="false"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="prefill" type="boolean" required="false">
+ <c:description>
+ Whether to attempt to prefill the connection pool to the minimum number of connections. NOTE: Only
+ supporting pools (OnePool) support this feature. A warning can be found in the logs if the pool does not
+ support this. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:map-property name="security-domain" displayName="Security Settings" required="false">
+ <c:description>
+ Security settings for connections in the pool.
+ </c:description>
+
+ <c:simple-property name="securityDeploymentType" type="string"
+ required="false" defaultValue="NONE">
+ <c:description>
+ Indicates whether Subject (from security domain), application-supplied parameters
+ (such as from getConnection(user, pw)), both Subject and app-supplied parameters,
+ or neither Subject nor app-supplied parameters are used to distinguish connections
+ in the pool. The default is "NONE".
+ </c:description>
+ <c:property-options>
+ <c:option name="None" value="NONE"/>
+ <c:option name="Application" value="APPLICATION"/>
+ <c:option name="Domain" value="DOMAIN"/>
+ <c:option name="Domain and Application" value="DOMAIN_AND_APPLICATION"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="domain" type="string"
+ required="false">
+ <c:description>
+ The name of the JAAS security manager that will handle authentication (only required if security
+ deployment type is DOMAIN or DOMAIN_AND_APPLICATION). This name correlates to the JAAS login-config.xml
+ descriptor application-policy/name attribute.
+ </c:description>
+ </c:simple-property>
+ </c:map-property>
+
+ <c:simple-property name="statistics-formatter" required="false">
+ <c:description>
+ The fully qualified class name of the class to use for formatting managed connection pool statistics for
+ this datasource. The class must implement the org.jboss.resource.statistic.formatter.StatisticsFormatter.
+ interface. The default is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="type-mapping" displayName="Type Mapping" required="false">
+ <c:description>
+ The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+ </c:description>
+ <c:property-options>
+ <c:option name="Cloudscape" value="Cloudscape"/>
+ <c:option name="DB2" value="DB2"/>
+ <c:option name="DB2/400" value="DB2/400"/>
+ <c:option name="Derby" value="Derby"/>
+ <c:option name="Firebird" value="Firebird"/>
+ <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+ <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+ <c:option name="InformixDB" value="InformixDB"/>
+ <c:option name="Ingres" value="Ingres"/>
+ <c:option name="InterBase" value="InterBase"/>
+ <c:option name="MaxDB" value="MaxDB"/>
+ <c:option name="McKoi" value="McKoi"/>
+ <c:option name="Mimer SQL" value="Mimer SQL"/>
+ <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+ <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+ <c:option name="Oracle7" value="Oracle7"/>
+ <c:option name="Oracle8" value="Oracle8"/>
+ <c:option name="Oracle9i" value="Oracle9i"/>
+ <c:option name="PointBase" value="PointBase"/>
+ <c:option name="PostgreSQL" value="PostgreSQL"/>
+ <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+ <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+ <c:option name="SapDB" value="SapDB"/>
+ <c:option name="SOLID" value="SOLID"/>
+ <c:option name="Sybase" value="Sybase"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="use-java-context"
+ displayName="Use Java Context"
+ type="boolean" defaultValue="true"
+ required="false">
+ <c:description>
+ Indicates whether the JNDI name should be bound under the "java" context,
+ which causes the DataSource to only be accessible from within the JBossAS VM.
+ The default is Yes.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="use-strict-min" type="boolean" required="false">
+ <c:description>
+ Whether idle connections below the min-pool-size should be closed. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="validate-on-match" type="boolean" required="false" defaultValue="true">
+ <c:description>
+ The validate-on-match element indicates whether or not connection level validation should be done when a
+ connection factory attempts to match a managed connection for a given set. This is typically exclusive to
+ the use of background validation. The default is Yes.
+ </c:description>
+ </c:simple-property>
+'>
+
+<!ENTITY datasourceAdvancedResourceConfigProps '
+ <c:simple-property name="check-valid-connection-sql" type="longString"
+ displayName="Check Valid Connection SQL" required="false">
+ <c:description>The SQL statement to use to check the validity of a pool connection.</c:description>
+ </c:simple-property>
+
+ <c:simple-property required="false" name="connection-definition">
+ <c:description>
+ The connection definition inside the RAR deployment uniquely identified by the connection factory interface,
+ e.g. "javax.sql.DataSource".
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="exception-sorter-class-name" type="string" activationPolicy="immediate"
+ displayName="Exception Sorter Class Name" required="false">
+ <c:description>
+ The fully qualified name of a Java class to use to check if an exception should be broadcast.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="new-connection-sql" type="longString" activationPolicy="immediate"
+ displayName="New Connection SQL" required="false">
+ <c:description>
+ An SQL statement to execute whenever a new connection is added to the pool; this can be used to set the
+ connection schema, etc.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="prepared-statement-cache-size" type="integer"
+ displayName="Prepared Statement Cache Size" required="false" defaultValue="0">
+ <c:description>
+ The number of prepared statements per connection to be kept open and reused in subsequent requests. They are
+ stored in an LRU cache. Set to 0 to disable the cache. The default is 0.
+ </c:description>
+ <c:constraint>
+ <c:integer-constraint minimum="0"/>
+ </c:constraint>
+ </c:simple-property>
+
+ <c:simple-property name="query-timeout"
+ displayName="Query Timeout"
+ type="integer"
+ units="seconds"
+ required="false">
+ <c:description>
+ Any configured query timeout in seconds. A value of 0 means no timeout. The default is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="rar-name" required="false">
+ <c:description>
+ The RAR deployment to associate with the connection manager MBean. e.g. jms-ra.rar or
+ myapplication.ear#my.rar for nested rars.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="set-tx-query-timeout"
+ displayName="Set Tx Query Timeout"
+ type="boolean"
+ required="false"
+ defaultValue="false">
+ <c:description>
+ Whether to set the query timeout based on the time remaining until transaction timeout;
+ any configured query timeout will be used if there is no transaction. The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="share-prepared-statements" displayName="Share Prepared Statements"
+ type="boolean"
+ required="false" defaultValue="false">
+ <c:description>
+ Should prepared statements be shared? The default is No.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="stale-connection-checker-class-name"
+ displayName="Stale Connection Checker Class Name"
+ type="string"
+ required="false">
+ <c:description>
+ Fully qualified name of the Java class used to check if a connection has become stale.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="track-statements" type="string"
+ displayName="Track Statements" required="false">
+ <c:description>
+ Whether to check for unclosed Statements and ResultSets when connections are returned to the pool. The
+ default is "yes-no-warnings".
+ </c:description>
+ <c:property-options>
+ <c:option name="No" value="no"/>
+ <c:option name="Yes" value="yes"/>
+ <c:option name="Yes, but no warnings" value="yes-no-warnings" default="true"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="transaction-isolation" required="false"
+ description="The Transaction Isolation level. The default setting is to use whichever isolation level is provided by default by the database.">
+ <c:property-options>
+ <c:option value="TRANSACTION_READ_UNCOMMITTED" name="Read Uncommitted"/>
+ <c:option value="TRANSACTION_READ_COMMITTED" default="true" name="Read Committed"/>
+ <c:option value="TRANSACTION_REPEATABLE_READ" name="Repeatable Read"/>
+ <c:option value="TRANSACTION_SERIALIZABLE" name="Serializable"/>
+ <c:option value="TRANSACTION_NONE" name="None"/>
+ </c:property-options>
+ </c:simple-property>
+
+ <c:simple-property name="url-delimiter" required="false">
+ <c:description>
+ Specifies the delimiter for URLs in connection-url for HA datasources.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="url-selector-strategy-class-name" required="false">
+ <c:description>
+ The fully qualified class name of a class that implements the
+ org.jboss.resource.adapter.jdbc.URLSelectorStrategy interface.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="use-try-lock" type="long" required="false" defaultValue="0">
+ <c:description>
+ Any configured timeout, in milliseconds, for internal locks on the resource adapter objects. A value of 0
+ means no timeout. The default is 0.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property name="valid-connection-checker-class-name" type="string"
+ displayName="Valid Connection Checker Class Name" required="false">
+ <c:description>
+ Fully qualified name of the Java class used to validate if a connection is valid.
+ </c:description>
+ </c:simple-property>
+'>
+
+<!ENTITY nonXaDatasourceConnectionResourceConfigProps '
+ <c:simple-property name="driver-class"
+ displayName="JDBC Driver Class"
+ description="The fully qualified name of the JDBC driver class."
+ type="string"
+ activationPolicy="immediate"/>
+
+ <c:simple-property name="connection-url"
+ displayName="Connection URL"
+ description="The JDBC driver URL string."
+ type="string"
+ activationPolicy="immediate"/>
+
+ <c:map-property name="connection-properties" required="false"
+ description="Arbitrary connection properties that should be passed to the java.sql.Driver.connect(url, props) method."/>
+'>
+
+<!ENTITY nonXaDatasourceOracleTemplateProps '
+ <c:simple-property name="driver-class" default="oracle.jdbc.driver.OracleDriver"/>
+ <c:simple-property name="connection-url" default="jdbc:oracle:oci:@youroracle-tns-name"/>
+ <c:simple-property name="exception-sorter-class-name"
+ default="org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter"/>
+ <c:simple-property name="check-valid-connection-sql" default="SELECT * FROM DUAL"/>
+ <c:simple-property name="type-mapping" default="oracle.jdbc.driver.OracleDriver"/>
+ <c:simple-property name="use-try-lock" default="60000"/>
+ <c:map-property name="metadata">
+ <c:simple-property name="typeMapping" default="Oracle9i"/>
+ </c:map-property>
+ <c:simple-property name="type-mapping" default="Oracle9i"/>
+'>
+
+<!--
+ See:
+ https://anonsvn.jboss.org/repos/jbossas/trunk/connector/src/main/org/jbos...
+ http://www.jboss.org/community/wiki/ConfigJCACommon
+ -->
+
+<!ENTITY connectionFactoryConnectionResourceConfigProps '
+ <c:simple-property required="true" name="jndi-name" displayName="JNDI Name"
+ description="The global JNDI name to bind the connection factory under."/>
+
+ <c:simple-property required="true" name="rar-name" displayName="RAR Name">
+ <c:description>
+ The name of the RAR file that contains the definition for the resource we want to provide. For nested RAR
+ files, the name would look like myapplication.ear#my.rar.
+ </c:description>
+ </c:simple-property>
+
+ <c:simple-property required="true" name="connection-definition">
+ <c:description>
+ The connection factory interface class. It should match the connectionfactory-interface in the ra.xml file.
+ </c:description>
+ </c:simple-property>
+
+'>
+
+
+<!ENTITY connectionFactoryAdvancedResourceConfigProps '
+ <c:list-property required="false" name="config-property">
+ <c:description>
+ Properties to supply to the ManagedConnectionFactory (MCF) MBean service configuration.
+ </c:description>
+ <c:map-property name="config-property">
+ <c:simple-property name="name" description="The name of the configuration property." />
+ <c:simple-property name="type" description="The type of the configuration property.">
+ <c:property-options>
+ <c:option value="java.lang.String" default="true"/>
+ <c:option value="java.lang.Boolean"/>
+ <c:option value="java.lang.Integer"/>
+ <c:option value="java.lang.Double"/>
+ <c:option value="java.lang.Byte"/>
+ <c:option value="java.lang.Short"/>
+ <c:option value="java.lang.Long"/>
+ <c:option value="java.lang.Float"/>
+ <c:option value="java.lang.Character"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="value" required="false" description="The value of the configuration property." />
+ </c:map-property>
+ </c:list-property>
+'>
+
+<!ENTITY connectionFactoryMetrics '
+ <!-- Traits -->
+ <metric property="poolJndiName" displayType="summary" displayName="Pool JNDI Name" defaultOn="true"
+ defaultInterval="600000" dataType="trait" category="performance"/>
+
+ <!-- Numerics -->
+ <metric property="availableConnectionCount" measurementType="dynamic" displayType="summary"
+ displayName="Available Connection Count" description="Number of available connections."
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+
+ <metric property="connectionCount" measurementType="dynamic" displayType="summary"
+ displayName="Connection Count" defaultOn="true" defaultInterval="60000" dataType="measurement"
+ category="performance"/>
+
+ <metric property="connectionCreatedCount" measurementType="dynamic" displayType="detail"
+ displayName="Connection Created Count" defaultOn="true" defaultInterval="60000"
+ dataType="measurement" category="performance"/>
+
+ <metric property="connectionDestroyedCount" measurementType="dynamic" displayType="detail"
+ displayName="Connection Destroyed Count" defaultOn="true" defaultInterval="60000"
+ dataType="measurement" category="performance"/>
+
+ <metric property="inUseConnectionCount" measurementType="dynamic" displayType="detail"
+ displayName="In Use Connection Count" description="Mumber of connections currently in use."
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+
+ <metric property="maxConnectionsInUseCount" measurementType="dynamic" displayType="detail"
+ displayName="Max Connections In Use Count" description="Maximum number of maximum connections that have been in use."
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+
+ <metric property="maxSize" measurementType="dynamic" displayType="detail" displayName="Max Size"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+
+ <metric property="minSize" measurementType="dynamic" displayType="detail" displayName="Min Size"
+ defaultOn="true" defaultInterval="60000" dataType="measurement" category="performance"/>
+'>
+
+<!-- These are the operations that both Topics and Queues have. -->
+<!ENTITY destinationOperations '
+ <operation name="removeAllMessages" displayName="Remove All Messages" description="Remove all messages from the destination."/>
+
+ <operation name="start" displayName="Start" description="Start the destination."/>
+
+ <operation name="stop" displayName="Stop" description="Stop the destination."/>
+'>
+
+<!ENTITY deploymentResourceConfigProps '
+ <c:simple-property type="boolean" required="false" name="blackList"/>
+ <c:simple-property type="boolean" required="false" name="cache"/>
+ <c:simple-property required="false" name="domain"/>
+ <c:simple-property required="false" name="excluded"/>
+ <c:simple-property required="false" name="excludedExport"/>
+ <c:simple-property required="false" name="exportAll">
+ <c:property-options>
+ <c:option name="all" value="ALL"/>
+ <c:option name="non-empty" value="NON_EMPTY"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property type="boolean" required="false" name="importAll"/>
+ <c:simple-property required="false" name="included"/>
+ <c:simple-property required="false" name="name"/>
+ <c:simple-property required="false" name="parentDomain"/>
+ <c:simple-property type="boolean" required="false" name="parentFirst"/>
+ <c:simple-property required="false" name="version"/>
+'>
+
+<!--<c:simple-property name="deployDirectory" type="string" required="true" default="deploy"
+ description="Path of the directory where the EAR should be deployed (e.g. "deploy" or "farm") - relative to the AS configuration set directory (e.g. /opt/jboss-5.1.0.CR1/server/default)."/>-->
+
+<!ENTITY deploymentContentConfigProps '
+ <configuration>
+ <c:group name="deployment" displayName="Deployment Options">
+ <c:simple-property name="deployExploded" type="boolean" required="true" default="false"
+ description="Should the archive be deployed in exploded form (i.e. as a directory)"/>
+ </c:group>
+ </configuration>
+'>
+
+<!ENTITY webApplicationMetrics '
+ <metric property="contextRoot"
+ dataType="trait" displayType="summary"
+ description="this context root of this WAR - used as a unique path prefix for URLs corresponding to this WAR"/>
+
+ <metric property="virtualHosts"
+ dataType="trait" displayType="summary"
+ description="the virtual hosts to which this WAR is deployed"/>
+'>
+
+<!ENTITY webApplicationContextMetrics '
+ <metric property="virtualHost"
+ dataType="trait" displayType="summary"
+ description="the virtual host with which this context is associated"/>
+
+ <!--
+ <metric property="responseTime"
+ dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL"
+ description="the minimum, maximum, and average response times for requests serviced by this webapp"/>
+ -->
+
+ <metric property="activeSessions"
+ displayName="Currently Active Sessions"
+ units="none" description="the number of sessions that are currently active for this WAR" />
+
+ <metric property="maxActive" displayName="Maximum Active Sessions"
+ units="none" description="the maximum number of sessions that have been active for this WAR" />
+
+ <metric property="sessionCounter" displayName="Created Sessions"
+ units="none" description="the number of sessions created for this WAR"
+ measurementType="trendsup" />
+
+ <metric property="expiredSessions" displayName="Expired Sessions"
+ units="none" description="the number of expired sessions for this WAR"
+ measurementType="trendsup" />
+
+ <metric property="rejectedSessions" displayName="Rejected Sessions"
+ units="none" description="the number of sessions rejected for this WAR"
+ measurementType="trendsup" />
+
+ <metric property="sessionAverageAliveTime" displayName="Average Session Alive Time"
+ units="seconds" description="the average alive time of sessions for this WAR" />
+
+ <metric property="sessionMaxAliveTime" displayName="Max Session Alive Time"
+ units="seconds" description="the maximum alive time of sessions for this WAR" />
+
+ <metric property="Servlet.minimumResponseTime" displayName="Minimum Response Time"
+ units="milliseconds"
+ description="the minimum response time for requests serviced by this WAR"/>
+
+ <metric property="Servlet.averageResponseTime" displayName="Average Response Time"
+ units="milliseconds"
+ description="the average response time for requests serviced by this WAR"/>
+
+ <metric property="Servlet.maximumResponseTime" displayName="Maximum Response Time"
+ units="milliseconds"
+ description="the maximum response time for requests serviced by this WAR"/>
+
+ <metric property="Servlet.totalResponseTime" displayName="Total Response Time"
+ units="milliseconds" measurementType="trendsup"
+ description="the total response time for requests serviced by this WAR"/>
+
+ <metric property="Servlet.requestCount" displayName="Number of Requests Serviced"
+ units="none" description="the number of requests serviced by this WAR"
+ measurementType="trendsup" displayType="summary"/>
+
+ <metric property="Servlet.errorCount" displayName="Number of Error Responses"
+ units="none" description="the number of error responses sent by this WAR"
+ measurementType="trendsup" displayType="summary"/>
+'>
+
+]>
+
+ <!--
+ ############################################# END OF XML ENTITIES
+ ###############################################
+ -->
+
+
+
<plugin name="TeiidPlugin" displayName="Teiid Plugin" package="org.teiid.rhq.plugin"
version="2.0.0" description="Supports management and monitoring of JBoss Teiid"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
@@ -449,12 +1200,11 @@
<c:simple-property name="sourceName"
displayName="Source Name" description="Source name for this model"
required="false" readOnly="true" />
- <c:simple-property name="translatorName"
- displayName="Translator Name" description="Name of the translator"
- required="true" />
- <c:simple-property name="jndiName"
- displayName="Connection JNDI Name" description="JNDI name for this connection"
- required="false" />
+ <c:simple-property name="translatorName"
+ displayName="Translator Name" description="Name of the translator"
+ required="true" />
+ <c:simple-property name="jndiName" displayName="Connection JNDI Name"
+ description="JNDI name for this connection" required="false" />
<c:simple-property name="visibility"
displayName="Visible" description="Visibility of the model"
required="true" type="boolean">
@@ -465,6 +1215,20 @@
required="true" default="true" type="boolean" />
</c:map-property>
</c:list-property>
+
+ <c:list-property name="multisourceModels"
+ description="The multi-source model sources for this VDB">
+ <c:map-property name="model">
+ <c:simple-property name="name" displayName="Name"
+ description="Name of the model" required="true" />
+ <c:simple-property name="sourceName"
+ displayName="Source Name" description="Source name for this model" />
+ <c:simple-property name="jndiName"
+ displayName="Connector Binding JNDI Name" description="JNDI name for this connector binding"
+ required="false" />
+ </c:map-property>
+ </c:list-property>
+
<c:list-property name="logicalModels" readOnly="true"
description="The logical models for this VDB">
<c:map-property name="model">
@@ -491,7 +1255,13 @@
</c:group>
</resource-configuration>
+ </service>
+ <service name="Translators" description="Teiid Translators"
+ class="TranslatorComponent" discovery="TranslatorDiscoveryComponent">
+
+ &translatorConfiguration;
+
</service>
</server>
13 years, 11 months
teiid SVN: r2124 - in trunk: api and 18 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-05-13 12:19:04 -0400 (Thu, 13 May 2010)
New Revision: 2124
Added:
trunk/api/
trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
trunk/api/src/main/java/org/teiid/translator/Execution.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java
trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java
trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java
trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
trunk/api/src/main/java/org/teiid/translator/TranslatorException.java
trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java
Removed:
trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
trunk/api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
trunk/api/src/main/java/org/teiid/translator/ConnectorException.java
trunk/api/src/main/java/org/teiid/translator/Execution.java
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java
trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java
trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java
trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java
trunk/connector-api/
Modified:
trunk/api/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-text/pom.xml
trunk/connectors/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-text/pom.xml
trunk/engine/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/pom.xml
Log:
TEIID-1075: renaming the connector-api module as the teiid-api module
Copied: trunk/api (from rev 2122, trunk/connector-api)
Modified: trunk/api/pom.xml
===================================================================
--- trunk/connector-api/pom.xml 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -8,9 +8,9 @@
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>teiid-connector-api</artifactId>
- <name>Connector API</name>
- <description>API for creating connectors.</description>
+ <artifactId>teiid-api</artifactId>
+ <name>Teiid Translator API</name>
+ <description>API for creating Translators and other common extenders in Teiid</description>
<dependencies>
<dependency>
@@ -33,4 +33,4 @@
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Deleted: trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,280 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.metadata;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.teiid.connector.DataPlugin;
-import org.teiid.core.id.UUIDFactory;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.TypeFacility;
-
-
-/**
- * Allows connectors to build metadata for use by the engine.
- *
- * TODO: add support for datatype import
- * TODO: add support for unique constraints
- */
-public class MetadataFactory {
-
- private Schema schema;
- private UUIDFactory factory = new UUIDFactory();
- private Map<String, Datatype> dataTypes;
- private Properties importProperties;
- private MetadataStore store = new MetadataStore();
-
- public MetadataFactory(String modelName, Map<String, Datatype> dataTypes, Properties importProperties) {
- this.dataTypes = dataTypes;
- schema = new Schema();
- schema.setName(modelName);
- setUUID(schema);
- store.addSchema(schema);
- this.importProperties = importProperties;
- }
-
- public MetadataStore getMetadataStore() {
- return store;
- }
-
- public Properties getImportProperties() {
- return importProperties;
- }
-
- private void setUUID(AbstractMetadataRecord record) {
- record.setUUID(factory.create().toString());
- }
-
- /**
- * Add a table with the given name to the model.
- * @param name
- * @return
- * @throws ConnectorException
- */
- public Table addTable(String name) throws ConnectorException {
- Table table = new Table();
- table.setTableType(Table.Type.Table);
- table.setName(name);
- setUUID(table);
- this.schema.addTable(table);
- return table;
- }
-
- /**
- * Adds a column to the table with the given name and type.
- * @param name
- * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
- * @param table
- * @return
- * @throws ConnectorException
- */
- public Column addColumn(String name, String type, ColumnSet<?> table) throws ConnectorException {
- if (name.indexOf(AbstractMetadataRecord.NAME_DELIM_CHAR) != -1) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.invalid_name", name)); //$NON-NLS-1$
- }
- Column column = new Column();
- column.setName(name);
- table.addColumn(column);
- column.setPosition(table.getColumns().size()); //1 based indexing
- Datatype datatype = setColumnType(type, column);
- column.setCaseSensitive(datatype.isCaseSensitive());
- column.setAutoIncremented(datatype.isAutoIncrement());
- column.setSigned(datatype.isSigned());
- setUUID(column);
- return column;
- }
-
- private Datatype setColumnType(String type,
- BaseColumn column) throws ConnectorException {
- Datatype datatype = dataTypes.get(type);
- if (datatype == null) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
- }
- column.setDatatype(datatype);
- column.setDatatypeUUID(datatype.getUUID());
- column.setLength(datatype.getLength());
- column.setPrecision(datatype.getPrecisionLength());
- column.setRadix(datatype.getRadix());
- column.setRuntimeType(datatype.getRuntimeTypeName());
- return datatype;
- }
-
- /**
- * Adds a primary key to the given table. The column names should be in key order.
- * @param name
- * @param columnNames
- * @param table
- * @return
- * @throws ConnectorException
- */
- public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table) throws ConnectorException {
- KeyRecord primaryKey = new KeyRecord(KeyRecord.Type.Primary);
- primaryKey.setParent(table);
- primaryKey.setColumns(new ArrayList<Column>(columnNames.size()));
- primaryKey.setName(name);
- setUUID(primaryKey);
- assignColumns(columnNames, table, primaryKey);
- table.setPrimaryKey(primaryKey);
- return primaryKey;
- }
-
- /**
- * Adds an access pattern to the given table.
- * @param name
- * @param columnNames
- * @param table
- * @return
- * @throws ConnectorException
- */
- public KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws ConnectorException {
- KeyRecord ap = new KeyRecord(KeyRecord.Type.AccessPattern);
- ap.setParent(table);
- ap.setColumns(new ArrayList<Column>(columnNames.size()));
- ap.setName(name);
- setUUID(ap);
- assignColumns(columnNames, table, ap);
- table.getAccessPatterns().add(ap);
- return ap;
- }
-
- /**
- * Adds an index to the given table.
- * @param name
- * @param nonUnique true indicates that an index is being added.
- * @param columnNames
- * @param table
- * @return
- * @throws ConnectorException
- */
- public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws ConnectorException {
- KeyRecord index = new KeyRecord(nonUnique?KeyRecord.Type.NonUnique:KeyRecord.Type.Index);
- index.setParent(table);
- index.setColumns(new ArrayList<Column>(columnNames.size()));
- index.setName(name);
- setUUID(index);
- assignColumns(columnNames, table, index);
- table.getIndexes().add(index);
- return index;
- }
-
- /**
- * Adds a foreign key to the given table. The column names should be in key order.
- * @param name
- * @param columnNames
- * @param pkTable
- * @param table
- * @return
- * @throws ConnectorException
- */
- public ForeignKey addForiegnKey(String name, List<String> columnNames, Table pkTable, Table table) throws ConnectorException {
- ForeignKey foreignKey = new ForeignKey();
- foreignKey.setParent(table);
- foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
- foreignKey.setName(name);
- setUUID(foreignKey);
- if (pkTable.getPrimaryKey() == null) {
- throw new ConnectorException("No primary key defined for table " + pkTable); //$NON-NLS-1$
- }
- foreignKey.setPrimaryKey(pkTable.getPrimaryKey());
- foreignKey.setUniqueKeyID(pkTable.getPrimaryKey().getUUID());
- assignColumns(columnNames, table, foreignKey);
- table.getForeignKeys().add(foreignKey);
- return foreignKey;
- }
-
- /**
- * Add a procedure with the given name to the model.
- * @param name
- * @return
- * @throws ConnectorException
- */
- public Procedure addProcedure(String name) throws ConnectorException {
- Procedure procedure = new Procedure();
- procedure.setName(name);
- setUUID(procedure);
- procedure.setParameters(new LinkedList<ProcedureParameter>());
- this.schema.addProcedure(procedure);
- return procedure;
- }
-
- /**
- * Add a procedure parameter.
- * @param name
- * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
- * @param parameterType should be one of {@link ProcedureParameter.Type}
- * @param procedure
- * @return
- * @throws ConnectorException
- */
- public ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure) throws ConnectorException {
- ProcedureParameter param = new ProcedureParameter();
- param.setName(name);
- setUUID(param);
- param.setType(parameterType);
- param.setProcedure(procedure);
- setColumnType(type, param);
- procedure.getParameters().add(param);
- param.setPosition(procedure.getParameters().size()); //1 based indexing
- return param;
- }
-
- /**
- * Add a procedure resultset column to the given procedure.
- * @param name
- * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
- * @param procedure
- * @return
- * @throws ConnectorException
- */
- public Column addProcedureResultSetColumn(String name, String type, Procedure procedure) throws ConnectorException {
- if (procedure.getResultSet() == null) {
- ColumnSet<Procedure> resultSet = new ColumnSet<Procedure>();
- resultSet.setParent(procedure);
- resultSet.setName("RSParam"); //$NON-NLS-1$
- setUUID(resultSet);
- procedure.setResultSet(resultSet);
- }
- return addColumn(name, type, procedure.getResultSet());
- }
-
- private void assignColumns(List<String> columnNames, Table table,
- ColumnSet<?> columns) throws ConnectorException {
- for (String columnName : columnNames) {
- boolean match = false;
- for (Column column : table.getColumns()) {
- if (column.getName().equals(columnName)) {
- match = true;
- columns.getColumns().add(column);
- break;
- }
- }
- if (!match) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.no_column_found", columnName)); //$NON-NLS-1$
- }
- }
- }
-}
Copied: trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,280 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.metadata;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.teiid.connector.DataPlugin;
+import org.teiid.core.id.UUIDFactory;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+
+
+/**
+ * Allows connectors to build metadata for use by the engine.
+ *
+ * TODO: add support for datatype import
+ * TODO: add support for unique constraints
+ */
+public class MetadataFactory {
+
+ private Schema schema;
+ private UUIDFactory factory = new UUIDFactory();
+ private Map<String, Datatype> dataTypes;
+ private Properties importProperties;
+ private MetadataStore store = new MetadataStore();
+
+ public MetadataFactory(String modelName, Map<String, Datatype> dataTypes, Properties importProperties) {
+ this.dataTypes = dataTypes;
+ schema = new Schema();
+ schema.setName(modelName);
+ setUUID(schema);
+ store.addSchema(schema);
+ this.importProperties = importProperties;
+ }
+
+ public MetadataStore getMetadataStore() {
+ return store;
+ }
+
+ public Properties getImportProperties() {
+ return importProperties;
+ }
+
+ private void setUUID(AbstractMetadataRecord record) {
+ record.setUUID(factory.create().toString());
+ }
+
+ /**
+ * Add a table with the given name to the model.
+ * @param name
+ * @return
+ * @throws TranslatorException
+ */
+ public Table addTable(String name) throws TranslatorException {
+ Table table = new Table();
+ table.setTableType(Table.Type.Table);
+ table.setName(name);
+ setUUID(table);
+ this.schema.addTable(table);
+ return table;
+ }
+
+ /**
+ * Adds a column to the table with the given name and type.
+ * @param name
+ * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
+ * @param table
+ * @return
+ * @throws TranslatorException
+ */
+ public Column addColumn(String name, String type, ColumnSet<?> table) throws TranslatorException {
+ if (name.indexOf(AbstractMetadataRecord.NAME_DELIM_CHAR) != -1) {
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.invalid_name", name)); //$NON-NLS-1$
+ }
+ Column column = new Column();
+ column.setName(name);
+ table.addColumn(column);
+ column.setPosition(table.getColumns().size()); //1 based indexing
+ Datatype datatype = setColumnType(type, column);
+ column.setCaseSensitive(datatype.isCaseSensitive());
+ column.setAutoIncremented(datatype.isAutoIncrement());
+ column.setSigned(datatype.isSigned());
+ setUUID(column);
+ return column;
+ }
+
+ private Datatype setColumnType(String type,
+ BaseColumn column) throws TranslatorException {
+ Datatype datatype = dataTypes.get(type);
+ if (datatype == null) {
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
+ }
+ column.setDatatype(datatype);
+ column.setDatatypeUUID(datatype.getUUID());
+ column.setLength(datatype.getLength());
+ column.setPrecision(datatype.getPrecisionLength());
+ column.setRadix(datatype.getRadix());
+ column.setRuntimeType(datatype.getRuntimeTypeName());
+ return datatype;
+ }
+
+ /**
+ * Adds a primary key to the given table. The column names should be in key order.
+ * @param name
+ * @param columnNames
+ * @param table
+ * @return
+ * @throws TranslatorException
+ */
+ public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table) throws TranslatorException {
+ KeyRecord primaryKey = new KeyRecord(KeyRecord.Type.Primary);
+ primaryKey.setParent(table);
+ primaryKey.setColumns(new ArrayList<Column>(columnNames.size()));
+ primaryKey.setName(name);
+ setUUID(primaryKey);
+ assignColumns(columnNames, table, primaryKey);
+ table.setPrimaryKey(primaryKey);
+ return primaryKey;
+ }
+
+ /**
+ * Adds an access pattern to the given table.
+ * @param name
+ * @param columnNames
+ * @param table
+ * @return
+ * @throws TranslatorException
+ */
+ public KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws TranslatorException {
+ KeyRecord ap = new KeyRecord(KeyRecord.Type.AccessPattern);
+ ap.setParent(table);
+ ap.setColumns(new ArrayList<Column>(columnNames.size()));
+ ap.setName(name);
+ setUUID(ap);
+ assignColumns(columnNames, table, ap);
+ table.getAccessPatterns().add(ap);
+ return ap;
+ }
+
+ /**
+ * Adds an index to the given table.
+ * @param name
+ * @param nonUnique true indicates that an index is being added.
+ * @param columnNames
+ * @param table
+ * @return
+ * @throws TranslatorException
+ */
+ public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws TranslatorException {
+ KeyRecord index = new KeyRecord(nonUnique?KeyRecord.Type.NonUnique:KeyRecord.Type.Index);
+ index.setParent(table);
+ index.setColumns(new ArrayList<Column>(columnNames.size()));
+ index.setName(name);
+ setUUID(index);
+ assignColumns(columnNames, table, index);
+ table.getIndexes().add(index);
+ return index;
+ }
+
+ /**
+ * Adds a foreign key to the given table. The column names should be in key order.
+ * @param name
+ * @param columnNames
+ * @param pkTable
+ * @param table
+ * @return
+ * @throws TranslatorException
+ */
+ public ForeignKey addForiegnKey(String name, List<String> columnNames, Table pkTable, Table table) throws TranslatorException {
+ ForeignKey foreignKey = new ForeignKey();
+ foreignKey.setParent(table);
+ foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
+ foreignKey.setName(name);
+ setUUID(foreignKey);
+ if (pkTable.getPrimaryKey() == null) {
+ throw new TranslatorException("No primary key defined for table " + pkTable); //$NON-NLS-1$
+ }
+ foreignKey.setPrimaryKey(pkTable.getPrimaryKey());
+ foreignKey.setUniqueKeyID(pkTable.getPrimaryKey().getUUID());
+ assignColumns(columnNames, table, foreignKey);
+ table.getForeignKeys().add(foreignKey);
+ return foreignKey;
+ }
+
+ /**
+ * Add a procedure with the given name to the model.
+ * @param name
+ * @return
+ * @throws TranslatorException
+ */
+ public Procedure addProcedure(String name) throws TranslatorException {
+ Procedure procedure = new Procedure();
+ procedure.setName(name);
+ setUUID(procedure);
+ procedure.setParameters(new LinkedList<ProcedureParameter>());
+ this.schema.addProcedure(procedure);
+ return procedure;
+ }
+
+ /**
+ * Add a procedure parameter.
+ * @param name
+ * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
+ * @param parameterType should be one of {@link ProcedureParameter.Type}
+ * @param procedure
+ * @return
+ * @throws TranslatorException
+ */
+ public ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure) throws TranslatorException {
+ ProcedureParameter param = new ProcedureParameter();
+ param.setName(name);
+ setUUID(param);
+ param.setType(parameterType);
+ param.setProcedure(procedure);
+ setColumnType(type, param);
+ procedure.getParameters().add(param);
+ param.setPosition(procedure.getParameters().size()); //1 based indexing
+ return param;
+ }
+
+ /**
+ * Add a procedure resultset column to the given procedure.
+ * @param name
+ * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
+ * @param procedure
+ * @return
+ * @throws TranslatorException
+ */
+ public Column addProcedureResultSetColumn(String name, String type, Procedure procedure) throws TranslatorException {
+ if (procedure.getResultSet() == null) {
+ ColumnSet<Procedure> resultSet = new ColumnSet<Procedure>();
+ resultSet.setParent(procedure);
+ resultSet.setName("RSParam"); //$NON-NLS-1$
+ setUUID(resultSet);
+ procedure.setResultSet(resultSet);
+ }
+ return addColumn(name, type, procedure.getResultSet());
+ }
+
+ private void assignColumns(List<String> columnNames, Table table,
+ ColumnSet<?> columns) throws TranslatorException {
+ for (String columnName : columnNames) {
+ boolean match = false;
+ for (Column column : table.getColumns()) {
+ if (column.getName().equals(columnName)) {
+ match = true;
+ columns.getColumns().add(column);
+ break;
+ }
+ }
+ if (!match) {
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.no_column_found", columnName)); //$NON-NLS-1$
+ }
+ }
+ }
+}
Deleted: trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.metadata;
-
-import org.teiid.translator.ConnectorException;
-
-/**
- * Helper methods that can be used to access runtime metadata.
- */
-public interface RuntimeMetadata {
-
- /**
- * Look up an object by identifier
- * @param fullName
- * @return The object
- */
- Table getTable(String fullName) throws ConnectorException;
-
- /**
- * Look up an object by identifier
- * @param fullName
- * @return The object
- */
- Column getColumn(String fullName) throws ConnectorException;
-
- /**
- * Look up an object by identifier
- * @param fullName
- * @return The object
- */
- Procedure getProcedure(String fullName) throws ConnectorException;
-
- /**
- * Gets the contents of a VDB resource in binary form.
- * @param resourcePath a path returned by getVDBResourcePaths()
- * @return the binary contents of the resource in a byte[]
- * @throws ConnectorException if the operation fails
- * @since 4.3
- */
- public byte[] getBinaryVDBResource(String resourcePath) throws ConnectorException;
-
- /**
- * Gets the contents of a VDB resource as a String.
- * @param resourcePath a path returned by getVDBResourcePaths()
- * @return the contents of the resource as a String of characters
- * @throws ConnectorException if the operation fails
- * @since 4.3
- */
- public String getCharacterVDBResource(String resourcePath) throws ConnectorException;
-
- /**
- * Gets the resource paths of all the resources in the VDB.
- * @return an array of resource paths of the resources in the VDB
- * @throws ConnectorException if the operation fails
- * @since 4.3
- */
- public String[] getVDBResourcePaths() throws ConnectorException;
-}
Copied: trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -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 org.teiid.metadata;
+
+import org.teiid.translator.TranslatorException;
+
+/**
+ * Helper methods that can be used to access runtime metadata.
+ */
+public interface RuntimeMetadata {
+
+ /**
+ * Look up an object by identifier
+ * @param fullName
+ * @return The object
+ */
+ Table getTable(String fullName) throws TranslatorException;
+
+ /**
+ * Look up an object by identifier
+ * @param fullName
+ * @return The object
+ */
+ Column getColumn(String fullName) throws TranslatorException;
+
+ /**
+ * Look up an object by identifier
+ * @param fullName
+ * @return The object
+ */
+ Procedure getProcedure(String fullName) throws TranslatorException;
+
+ /**
+ * Gets the contents of a VDB resource in binary form.
+ * @param resourcePath a path returned by getVDBResourcePaths()
+ * @return the binary contents of the resource in a byte[]
+ * @throws TranslatorException if the operation fails
+ * @since 4.3
+ */
+ public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException;
+
+ /**
+ * Gets the contents of a VDB resource as a String.
+ * @param resourcePath a path returned by getVDBResourcePaths()
+ * @return the contents of the resource as a String of characters
+ * @throws TranslatorException if the operation fails
+ * @since 4.3
+ */
+ public String getCharacterVDBResource(String resourcePath) throws TranslatorException;
+
+ /**
+ * Gets the resource paths of all the resources in the VDB.
+ * @return an array of resource paths of the resources in the VDB
+ * @throws TranslatorException if the operation fails
+ * @since 4.3
+ */
+ public String[] getVDBResourcePaths() throws TranslatorException;
+}
Deleted: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,168 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.resource.spi;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.resource.ResourceException;
-import javax.resource.cci.Connection;
-import javax.resource.spi.ConnectionEvent;
-import javax.resource.spi.ConnectionEventListener;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.LocalTransaction;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionMetaData;
-import javax.security.auth.Subject;
-import javax.transaction.xa.XAResource;
-
-import org.teiid.translator.ConnectorException;
-
-public class BasicManagedConnection implements ManagedConnection {
- protected PrintWriter log;
- protected final Collection<ConnectionEventListener> listeners = new ArrayList<ConnectionEventListener>();
- private BasicConnection physicalConnection;
- private final Set<WrappedConnection> handles = new HashSet<WrappedConnection>();
-
- public BasicManagedConnection(BasicConnection connection) {
- this.physicalConnection = connection;
- }
-
- @Override
- public void associateConnection(Object handle) throws ResourceException {
- if (!(handle instanceof WrappedConnection)) {
- throw new ResourceException("Wrong connection supplied to assosiate"); //$NON-NLS-1$
- }
- ((WrappedConnection)handle).setManagedConnection(this);
- synchronized (this.handles) {
- this.handles.add((WrappedConnection)handle);
- }
- }
-
- @Override
- public void cleanup() throws ResourceException {
- synchronized (this.handles) {
- for (WrappedConnection wc:this.handles) {
- wc.setManagedConnection(null);
- }
- handles.clear();
- }
- ConnectionContext.setSubject(null);
- }
-
- @Override
- public void destroy() throws ResourceException {
- cleanup();
-
- this.physicalConnection.close();
- this.physicalConnection = null;
- }
-
- @Override
- public ManagedConnectionMetaData getMetaData() throws ResourceException {
- return null;
- }
-
- @Override
- public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
- if(!(arg1 instanceof ConnectionRequestInfoWrapper)) {
- throw new ConnectorException("Un-recognized Connection Request Info object received"); //$NON-NLS-1$
- }
- ConnectionContext.setSubject(arg0);
-
- WrappedConnection wc = new WrappedConnection(this);
- synchronized(this.handles) {
- this.handles.add(wc);
- }
- return wc;
- }
-
- @Override
- public LocalTransaction getLocalTransaction() throws ResourceException {
- return null;
- }
-
- @Override
- public XAResource getXAResource() throws ResourceException {
- return null;
- }
-
- @Override
- public void addConnectionEventListener(ConnectionEventListener arg0) {
- synchronized (this.listeners) {
- this.listeners.add(arg0);
- }
- }
-
- @Override
- public void removeConnectionEventListener(ConnectionEventListener arg0) {
- synchronized (this.listeners) {
- this.listeners.remove(arg0);
- }
- }
-
- @Override
- public void setLogWriter(PrintWriter arg0) throws ResourceException {
- this.log = arg0;
- }
-
- @Override
- public PrintWriter getLogWriter() throws ResourceException {
- return this.log;
- }
-
- // called by the wrapped connection to notify the close of the connection.
- void connectionClosed(WrappedConnection wc) {
-
- synchronized (this.handles) {
- handles.remove(wc);
- }
-
- ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
- ce.setConnectionHandle(wc);
-
- ArrayList<ConnectionEventListener> copy = null;
- synchronized (this.listeners) {
- copy = new ArrayList<ConnectionEventListener>(this.listeners);
- }
-
- for(ConnectionEventListener l: copy) {
- l.connectionClosed(ce);
- }
- }
-
- Connection getConnection() throws ConnectorException {
- if (this.physicalConnection == null)
- throw new ConnectorException("Connection has been destroyed!!!"); //$NON-NLS-1$
- return this.physicalConnection;
- }
-
- public boolean isValid() {
- if (this.physicalConnection == null) {
- return false;
- }
- return this.physicalConnection.isAlive();
- }
-}
Copied: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.resource.spi;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+public class BasicManagedConnection implements ManagedConnection {
+ protected PrintWriter log;
+ protected final Collection<ConnectionEventListener> listeners = new ArrayList<ConnectionEventListener>();
+ private BasicConnection physicalConnection;
+ private final Set<WrappedConnection> handles = new HashSet<WrappedConnection>();
+
+ public BasicManagedConnection(BasicConnection connection) {
+ this.physicalConnection = connection;
+ }
+
+ @Override
+ public void associateConnection(Object handle) throws ResourceException {
+ if (!(handle instanceof WrappedConnection)) {
+ throw new ResourceException("Wrong connection supplied to assosiate"); //$NON-NLS-1$
+ }
+ ((WrappedConnection)handle).setManagedConnection(this);
+ synchronized (this.handles) {
+ this.handles.add((WrappedConnection)handle);
+ }
+ }
+
+ @Override
+ public void cleanup() throws ResourceException {
+ synchronized (this.handles) {
+ for (WrappedConnection wc:this.handles) {
+ wc.setManagedConnection(null);
+ }
+ handles.clear();
+ }
+ ConnectionContext.setSubject(null);
+ }
+
+ @Override
+ public void destroy() throws ResourceException {
+ cleanup();
+
+ this.physicalConnection.close();
+ this.physicalConnection = null;
+ }
+
+ @Override
+ public ManagedConnectionMetaData getMetaData() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
+ if(!(arg1 instanceof ConnectionRequestInfoWrapper)) {
+ throw new ResourceException("Un-recognized Connection Request Info object received"); //$NON-NLS-1$
+ }
+ ConnectionContext.setSubject(arg0);
+
+ WrappedConnection wc = new WrappedConnection(this);
+ synchronized(this.handles) {
+ this.handles.add(wc);
+ }
+ return wc;
+ }
+
+ @Override
+ public LocalTransaction getLocalTransaction() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public XAResource getXAResource() throws ResourceException {
+ return null;
+ }
+
+ @Override
+ public void addConnectionEventListener(ConnectionEventListener arg0) {
+ synchronized (this.listeners) {
+ this.listeners.add(arg0);
+ }
+ }
+
+ @Override
+ public void removeConnectionEventListener(ConnectionEventListener arg0) {
+ synchronized (this.listeners) {
+ this.listeners.remove(arg0);
+ }
+ }
+
+ @Override
+ public void setLogWriter(PrintWriter arg0) throws ResourceException {
+ this.log = arg0;
+ }
+
+ @Override
+ public PrintWriter getLogWriter() throws ResourceException {
+ return this.log;
+ }
+
+ // called by the wrapped connection to notify the close of the connection.
+ void connectionClosed(WrappedConnection wc) {
+
+ synchronized (this.handles) {
+ handles.remove(wc);
+ }
+
+ ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce.setConnectionHandle(wc);
+
+ ArrayList<ConnectionEventListener> copy = null;
+ synchronized (this.listeners) {
+ copy = new ArrayList<ConnectionEventListener>(this.listeners);
+ }
+
+ for(ConnectionEventListener l: copy) {
+ l.connectionClosed(ce);
+ }
+ }
+
+ Connection getConnection() throws ResourceException {
+ if (this.physicalConnection == null)
+ throw new ResourceException("Connection has been destroyed!!!"); //$NON-NLS-1$
+ return this.physicalConnection;
+ }
+
+ public boolean isValid() {
+ if (this.physicalConnection == null) {
+ return false;
+ }
+ return this.physicalConnection.isAlive();
+ }
+}
Deleted: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.resource.spi;
-
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionFactory;
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterAssociation;
-import javax.resource.spi.ValidatingManagedConnectionFactory;
-import javax.security.auth.Subject;
-
-import org.teiid.core.TeiidException;
-import org.teiid.core.util.ReflectionHelper;
-import org.teiid.translator.ConnectorException;
-
-
-public abstract class BasicManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation, ValidatingManagedConnectionFactory {
-
- private static final long serialVersionUID = -7302713800883776790L;
- private PrintWriter log;
- private BasicResourceAdapter ra;
-
- @Override
- public abstract Object createConnectionFactory() throws ResourceException;
-
- @Override
- public Object createConnectionFactory(ConnectionManager arg0) throws ResourceException {
- return createConnectionFactory();
- }
-
- @Override
- public ManagedConnection createManagedConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
- ConnectionRequestInfoWrapper criw = (ConnectionRequestInfoWrapper)arg1;
- return new BasicManagedConnection(criw.cf.getConnection());
- }
-
- @Override
- public PrintWriter getLogWriter() throws ResourceException {
- return this.log;
- }
-
- @Override
- public ManagedConnection matchManagedConnections(Set arg0, Subject arg1, ConnectionRequestInfo arg2) throws ResourceException {
- return (ManagedConnection)arg0.iterator().next();
- }
-
- @Override
- public void setLogWriter(PrintWriter arg0) throws ResourceException {
- this.log = arg0;
- }
-
- @Override
- public ResourceAdapter getResourceAdapter() {
- return this.ra;
- }
-
- @Override
- public void setResourceAdapter(ResourceAdapter arg0) throws ResourceException {
- this.ra = (BasicResourceAdapter)arg0;
- }
-
- public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ConnectorException {
- try {
- if (className == null) {
- if (defaultClass == null) {
- throw new ConnectorException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
- }
- return expectedType.cast(defaultClass.newInstance());
- }
- return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
- } catch (TeiidException e) {
- throw new ConnectorException(e);
- } catch (IllegalAccessException e) {
- throw new ConnectorException(e);
- } catch(InstantiationException e) {
- throw new ConnectorException(e);
- }
- }
-
- @Override
- public Set<BasicManagedConnection> getInvalidConnections(Set arg0) throws ResourceException {
- HashSet<BasicManagedConnection> result = new HashSet<BasicManagedConnection>();
- for (Object object : arg0) {
- if (object instanceof BasicManagedConnection) {
- BasicManagedConnection bmc = (BasicManagedConnection)object;
- if (!bmc.isValid()) {
- result.add(bmc);
- }
- }
- }
- return result;
- }
-}
Copied: trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.resource.spi;
+
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+import javax.resource.spi.ValidatingManagedConnectionFactory;
+import javax.security.auth.Subject;
+
+import org.teiid.core.TeiidException;
+import org.teiid.core.util.ReflectionHelper;
+
+
+public abstract class BasicManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation, ValidatingManagedConnectionFactory {
+
+ private static final long serialVersionUID = -7302713800883776790L;
+ private PrintWriter log;
+ private BasicResourceAdapter ra;
+
+ @Override
+ public abstract Object createConnectionFactory() throws ResourceException;
+
+ @Override
+ public Object createConnectionFactory(ConnectionManager arg0) throws ResourceException {
+ return createConnectionFactory();
+ }
+
+ @Override
+ public ManagedConnection createManagedConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
+ ConnectionRequestInfoWrapper criw = (ConnectionRequestInfoWrapper)arg1;
+ return new BasicManagedConnection(criw.cf.getConnection());
+ }
+
+ @Override
+ public PrintWriter getLogWriter() throws ResourceException {
+ return this.log;
+ }
+
+ @Override
+ public ManagedConnection matchManagedConnections(Set arg0, Subject arg1, ConnectionRequestInfo arg2) throws ResourceException {
+ return (ManagedConnection)arg0.iterator().next();
+ }
+
+ @Override
+ public void setLogWriter(PrintWriter arg0) throws ResourceException {
+ this.log = arg0;
+ }
+
+ @Override
+ public ResourceAdapter getResourceAdapter() {
+ return this.ra;
+ }
+
+ @Override
+ public void setResourceAdapter(ResourceAdapter arg0) throws ResourceException {
+ this.ra = (BasicResourceAdapter)arg0;
+ }
+
+ public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ResourceException {
+ try {
+ if (className == null) {
+ if (defaultClass == null) {
+ throw new ResourceException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
+ }
+ return expectedType.cast(defaultClass.newInstance());
+ }
+ return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
+ } catch (TeiidException e) {
+ throw new ResourceException(e);
+ } catch (IllegalAccessException e) {
+ throw new ResourceException(e);
+ } catch(InstantiationException e) {
+ throw new ResourceException(e);
+ }
+ }
+
+ @Override
+ public Set<BasicManagedConnection> getInvalidConnections(Set arg0) throws ResourceException {
+ HashSet<BasicManagedConnection> result = new HashSet<BasicManagedConnection>();
+ for (Object object : arg0) {
+ if (object instanceof BasicManagedConnection) {
+ BasicManagedConnection bmc = (BasicManagedConnection)object;
+ if (!bmc.isValid()) {
+ result.add(bmc);
+ }
+ }
+ }
+ return result;
+ }
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,394 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.SetQuery;
-
-
-/**
- * Allows a connector to specify the capabilities that a connector
- * 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
- */
- boolean supportsSelectDistinct();
-
- /**
- * 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 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 inner or cross joins
- * @since 6.1.0
- */
- boolean supportsInnerJoins();
-
- /**
- * Support indicates connector can accept self-joins where a
- * group is joined to itself with aliases. Connector must also support
- * {@link #supportsAliasedGroup()}.
- * @since 3.1 SP2
- */
- boolean supportsSelfJoins();
-
- /**
- * Support indicates connector can accept left outer joins
- * @since 3.1 SP2
- */
- boolean supportsOuterJoins();
-
- /**
- * Support indicates connector can accept full outer joins
- * @since 3.1 SP2
- */
- boolean supportsFullOuterJoins();
-
- /**
- * Support indicates connector can accept inline views (subqueries
- * in the FROM clause).
- * @since 4.1
- */
- boolean supportsInlineViews();
-
- /**
- * 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 = constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaEquals();
-
- /**
- * 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 supportsCompareCriteriaOrdered();
-
- /**
- * 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)
- * @since 3.1 SP2
- */
- boolean supportsLikeCriteriaEscapeCharacter();
-
- /**
- * Support indicates connector accepts criteria of form (element IN set)
- * @since 3.1 SP2
- */
- boolean supportsInCriteria();
-
- /**
- * Support indicates connector accepts IN criteria with a subquery on the right side
- * @since 4.0
- */
- boolean supportsInCriteriaSubquery();
-
- /**
- * Support indicates connector accepts criteria of form (element IS NULL)
- * @since 3.1 SP2
- */
- boolean supportsIsNullCriteria();
-
- /**
- * Support indicates connector accepts logical criteria connected by OR
- * @since 3.1 SP2
- */
- boolean supportsOrCriteria();
-
- /**
- * Support indicates connector accepts logical criteria NOT
- * @since 3.1 SP2
- */
- boolean supportsNotCriteria();
-
- /**
- * Support indicates connector accepts the EXISTS criteria
- * @since 4.0
- */
- boolean supportsExistsCriteria();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use SOME
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaSome();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use ALL
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaAll();
-
- /**
- * Support indicates connector accepts ORDER BY clause, including multiple elements
- * and ascending and descending sorts.
- * @since 3.1 SP2
- */
- boolean supportsOrderBy();
-
- /**
- * Support indicates connector accepts ORDER BY clause with columns not from the select
- * @since 6.2
- * @return
- */
- boolean supportsOrderByUnrelated();
-
- /**
- * Whether the source supports an explicit GROUP BY clause
- * @since 6.1
- */
- 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
- */
- boolean supportsAggregatesSum();
-
- /**
- * Support indicates connector can accept the AVG aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesAvg();
-
- /**
- * Support indicates connector can accept the MIN aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMin();
-
- /**
- * Support indicates connector can accept the MAX aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMax();
-
- /**
- * Support indicates connector can accept the COUNT aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCount();
-
- /**
- * Support indicates connector can accept the COUNT(*) aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCountStar();
-
- /**
- * Support indicates connector can accept DISTINCT within aggregate functions
- * @since 3.1 SP2
- */
- boolean supportsAggregatesDistinct();
-
- /**
- * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
- * HAVING clauses
- * @since 4.0
- */
- boolean supportsScalarSubqueries();
-
- /**
- * Support indicates connector can accept correlated subqueries wherever subqueries
- * are accepted
- * @since 4.0
- */
- boolean supportsCorrelatedSubqueries();
-
- /**
- * 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();
-
- /**
- * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
- * @since 4.0
- */
- boolean supportsSearchedCaseExpressions();
-
- /**
- * Support indicates that the connector supports the UNION of two queries.
- * @since 4.2
- */
- boolean supportsUnions();
-
- /**
- * Support indicates that the connector supports an ORDER BY on a SetQuery.
- * @since 5.6
- */
- boolean supportsSetQueryOrderBy();
-
- /**
- * Support indicates that the connector supports the INTERSECT of two queries.
- * @since 5.6
- */
- boolean supportsIntersect();
-
- /**
- * Support indicates that the connector supports the EXCEPT of two queries.
- * @since 5.6
- */
- boolean supportsExcept();
-
- /**
- * Get list of all supported function names. Arithmetic functions have names like
- * "+".
- * @since 3.1 SP3
- */
- List<String> getSupportedFunctions();
-
- /**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
- */
- int getMaxInCriteriaSize();
-
- /**
- * <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>
- *
- * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
- * @since 5.0
- */
- boolean supportsFunctionsInGroupBy();
-
- /**
- * Gets whether the connector can limit the number of rows returned by a query.
- * @since 5.0 SP1
- */
- boolean supportsRowLimit();
-
- /**
- * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
- * result sets that start in the middle of the resulting rows returned by a query
- * @since 5.0 SP1
- */
- boolean supportsRowOffset();
-
- /**
- * The number of groups supported in the from clause. Added for a Sybase limitation.
- * @since 5.6
- * @return the number of groups supported in the from clause, or -1 if there is no limit
- */
- int getMaxFromGroups();
-
- /**
- * Whether the source prefers to use ANSI style joins.
- * @since 6.0
- */
- boolean useAnsiJoin();
-
- /**
- * Whether the source supports queries without criteria.
- * @since 6.0
- */
- boolean requiresCriteria();
-
- /**
- * Whether the source supports {@link BatchedUpdates}
- * @since 6.0
- */
- boolean supportsBatchedUpdates();
-
- /**
- * Whether the source supports updates with multiple value sets
- * @since 6.0
- */
- boolean supportsBulkUpdate();
-
- /**
- * Support indicates that the connector can accept INSERTs with
- * values specified by an {@link SetQuery}.
- * @since 6.1
- */
- boolean supportsInsertWithQueryExpression();
-
-}
Deleted: trunk/api/src/main/java/org/teiid/translator/ConnectorException.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import javax.resource.ResourceException;
-
-/**
- * An exception the connector writer can return in case of an
- * error while using the connector.
- */
-public class ConnectorException extends ResourceException{
-
- private static final long serialVersionUID = -5980862789340592219L;
-
- /**
- * No-arg constructor required by Externalizable semantics.
- */
- public ConnectorException() {
- super();
- }
-
- /**
- * Construct an instance with the message specified.
- *
- * @param message A message describing the exception
- */
- public ConnectorException( String message ) {
- super( message );
- }
-
- public ConnectorException( String errorCode, String message ) {
- super( message, errorCode);
- }
-
- public ConnectorException( int errorCode, String message ) {
- super(message, Integer.toString(errorCode));
- }
-
-
- /**
- * 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 ConnectorException( Throwable e, String message ) {
- super(message,e);
- }
-
- /**
- * Construct an instance with a linked exception specified.
- *
- * @param e An exception to chain to this exception
- */
- public ConnectorException( Throwable e ) {
- super( e );
- }
-
-}
Deleted: trunk/api/src/main/java/org/teiid/translator/Execution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/Execution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/Execution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-
-/**
- * An execution represents the state and lifecycle for a particular
- * command execution. The methods provided on this interface define
- * standard lifecycle methods.
- * When execution completes, the {@link #close()} will be called. If
- * execution must be aborted, due to user or administrator action, the
- * {@link #cancel()} will be called.
- */
-public interface Execution {
-
- /**
- * Terminates the execution normally.
- */
- void close() throws ConnectorException;
-
- /**
- * Cancels the execution abnormally. This will happen via
- * a different thread from the one performing the execution, so
- * should be expected to happen in a multi-threaded scenario.
- */
- void cancel() throws ConnectorException;
-
- /**
- * Execute the associated command. Results will be retrieved through a specific sub-interface call.
- * @throws ConnectorException
- */
- void execute() throws ConnectorException;
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/Execution.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/Execution.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/Execution.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/Execution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+
+/**
+ * An execution represents the state and lifecycle for a particular
+ * command execution. The methods provided on this interface define
+ * standard lifecycle methods.
+ * When execution completes, the {@link #close()} will be called. If
+ * execution must be aborted, due to user or administrator action, the
+ * {@link #cancel()} will be called.
+ */
+public interface Execution {
+
+ /**
+ * Terminates the execution normally.
+ */
+ void close() throws TranslatorException;
+
+ /**
+ * Cancels the execution abnormally. This will happen via
+ * a different thread from the one performing the execution, so
+ * should be expected to happen in a multi-threaded scenario.
+ */
+ void cancel() throws TranslatorException;
+
+ /**
+ * Execute the associated command. Results will be retrieved through a specific sub-interface call.
+ * @throws TranslatorException
+ */
+ void execute() throws TranslatorException;
+
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,430 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.Call;
-import org.teiid.language.Command;
-import org.teiid.language.LanguageFactory;
-import org.teiid.language.QueryExpression;
-import org.teiid.metadata.RuntimeMetadata;
-
-
-
-/**
- * <p>The primary entry point for a Translator. This class should be extended by the custom translator writer.</p>
- *
- * The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
- * the "start" method is called. This class represents the basic capabilities of the translator.
- */
-public class ExecutionFactory implements ConnectorCapabilities{
-
- public static final int DEFAULT_MAX_FROM_GROUPS = -1;
-
- private static final TypeFacility TYPE_FACILITY = new TypeFacility();
-
- private boolean immutable = false;
- private boolean exceptionOnMaxRows = false;
- private int maxResultRows = DEFAULT_MAX_FROM_GROUPS;
- private boolean xaCapable;
- private boolean sourceRequired = true;
-
- /**
- * Initialize the connector with supplied configuration
- */
- public void start() throws ConnectorException {
- }
-
- /**
- * Defines if the Connector is read-only connector
- * @return
- */
- @TranslatorProperty(name="immutable", display="Is Immutable",description="Is Immutable, True if the source never changes.",advanced=true, defaultValue="false")
- public boolean isImmutable() {
- return immutable;
- }
-
- public void setImmutable(boolean arg0) {
- this.immutable = arg0;
- }
-
- /**
- * Throw exception if there are more rows in the result set than specified in the MaxResultRows setting.
- * @return
- */
- @TranslatorProperty(name="exception-on-max-rows", display="Exception on Exceeding Max Rows",description="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",advanced=true, defaultValue="true")
- public boolean isExceptionOnMaxRows() {
- return exceptionOnMaxRows;
- }
-
- public void setExceptionOnMaxRows(boolean arg0) {
- this.exceptionOnMaxRows = arg0;
- }
-
- /**
- * Maximum result set rows to fetch
- * @return
- */
- @TranslatorProperty(name="max-result-rows", display="Maximum Result Rows", description="Maximum Result Rows allowed", advanced=true, defaultValue="-1")
- public int getMaxResultRows() {
- return maxResultRows;
- }
-
- public void setMaxResultRows(int arg0) {
- this.maxResultRows = arg0;
- }
-
- /**
- * Shows the XA transaction capability of the Connector.
- * @return
- */
- @TranslatorProperty(name="xa-capable", display="Is XA Capable", description="True, if this connector supports XA Transactions", defaultValue="false")
- public boolean isXaCapable() {
- return xaCapable;
- }
-
- public void setXaCapable(boolean arg0) {
- this.xaCapable = arg0;
- }
-
- /**
- * Flag that indicates if a underlying source connection required for this execution factory to work
- * @return
- */
- public boolean isSourceRequired() {
- return sourceRequired;
- }
-
- public void setSourceRequired(boolean value) {
- this.sourceRequired = value;
- }
-
- /**
- * Obtain a reference to the default LanguageFactory that can be used to construct
- * new language interface objects. This is typically needed when modifying the language
- * objects passed to the connector or for testing when objects need to be created.
- */
- public LanguageFactory getLanguageFactory() {
- return LanguageFactory.INSTANCE;
- }
-
- /**
- * Obtain a reference to the type facility, which can be used to perform many type
- * conversions supplied by the Connector API.
- */
- public TypeFacility getTypeFacility() {
- return TYPE_FACILITY;
- }
-
- /**
- * Create an execution object for the specified command
- * @param command the command
- * @param executionContext Provides information about the context that this command is
- * executing within, such as the identifiers for the command being executed
- * @param metadata Access to runtime metadata if needed to translate the command
- * @param connection connection factory object to the data source
- * @return An execution object that can use to execute the command
- */
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
- if (command instanceof QueryExpression) {
- return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
- }
- if (command instanceof Call) {
- return createProcedureExecution((Call)command, executionContext, metadata, connectionFactory);
- }
- return createUpdateExecution(command, executionContext, metadata, connectionFactory);
- }
-
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution"); //$NON-NLS-1$
- }
-
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
- }
-
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
- }
-
- @Override
- public boolean supportsSelectDistinct() {
- return false;
- }
-
- @Override
- public boolean supportsAliasedGroup() {
- return false;
- }
-
- @Override
- public boolean supportsSelfJoins() {
- return false;
- }
-
- @Override
- public boolean supportsOuterJoins() {
- return false;
- }
-
- @Override
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- @Override
- public boolean supportsBetweenCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsCompareCriteriaEquals() {
- return false;
- }
-
- @Override
- public boolean supportsLikeCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return false;
- }
-
- @Override
- public boolean supportsInCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsInCriteriaSubquery() {
- return false;
- }
-
- @Override
- public boolean supportsIsNullCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsOrCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsNotCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsExistsCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return false;
- }
-
- @Override
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return false;
- }
-
- @Override
- public boolean supportsOrderBy() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesSum() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesAvg() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesMin() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesMax() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesCount() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesCountStar() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesDistinct() {
- return false;
- }
-
- @Override
- public boolean supportsScalarSubqueries() {
- return false;
- }
-
- @Override
- public boolean supportsCorrelatedSubqueries() {
- return false;
- }
-
- @Override
- public boolean supportsCaseExpressions() {
- return false;
- }
-
- @Override
- public boolean supportsSearchedCaseExpressions() {
- return false;
- }
-
- @Override
- public List<String> getSupportedFunctions() {
- return null;
- }
-
- public boolean supportsInlineViews() {
- return false;
- }
-
- @Override
- public boolean supportsUnions() {
- return false;
- }
-
- @Override
- public int getMaxInCriteriaSize() {
- return DEFAULT_MAX_FROM_GROUPS;
- }
-
- @Override
- public boolean supportsFunctionsInGroupBy() {
- return false;
- }
-
- @Override
- public boolean supportsRowLimit() {
- return false;
- }
-
- @Override
- public boolean supportsRowOffset() {
- return false;
- }
-
- @Override
- public int getMaxFromGroups() {
- return DEFAULT_MAX_FROM_GROUPS; //-1 indicates no max
- }
-
- @Override
- public boolean supportsExcept() {
- return false;
- }
-
- @Override
- public boolean supportsIntersect() {
- return false;
- }
-
- @Override
- public boolean supportsSetQueryOrderBy() {
- return false;
- }
-
- @Override
- public boolean useAnsiJoin() {
- return false;
- }
-
- @Override
- public boolean requiresCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsBatchedUpdates() {
- return false;
- }
-
- @Override
- 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;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false;
- }
-
- @Override
- public boolean supportsBulkUpdate() {
- return false;
- }
-
- @Override
- public boolean supportsOrderByUnrelated() {
- return false;
- }
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,430 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.Call;
+import org.teiid.language.Command;
+import org.teiid.language.LanguageFactory;
+import org.teiid.language.QueryExpression;
+import org.teiid.metadata.RuntimeMetadata;
+
+
+
+/**
+ * <p>The primary entry point for a Translator. This class should be extended by the custom translator writer.</p>
+ *
+ * The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
+ * the "start" method is called. This class represents the basic capabilities of the translator.
+ */
+public class ExecutionFactory implements TranslatorCapabilities{
+
+ public static final int DEFAULT_MAX_FROM_GROUPS = -1;
+
+ private static final TypeFacility TYPE_FACILITY = new TypeFacility();
+
+ private boolean immutable = false;
+ private boolean exceptionOnMaxRows = false;
+ private int maxResultRows = DEFAULT_MAX_FROM_GROUPS;
+ private boolean xaCapable;
+ private boolean sourceRequired = true;
+
+ /**
+ * Initialize the connector with supplied configuration
+ */
+ public void start() throws TranslatorException {
+ }
+
+ /**
+ * Defines if the Connector is read-only connector
+ * @return
+ */
+ @TranslatorProperty(name="immutable", display="Is Immutable",description="Is Immutable, True if the source never changes.",advanced=true, defaultValue="false")
+ public boolean isImmutable() {
+ return immutable;
+ }
+
+ public void setImmutable(boolean arg0) {
+ this.immutable = arg0;
+ }
+
+ /**
+ * Throw exception if there are more rows in the result set than specified in the MaxResultRows setting.
+ * @return
+ */
+ @TranslatorProperty(name="exception-on-max-rows", display="Exception on Exceeding Max Rows",description="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",advanced=true, defaultValue="true")
+ public boolean isExceptionOnMaxRows() {
+ return exceptionOnMaxRows;
+ }
+
+ public void setExceptionOnMaxRows(boolean arg0) {
+ this.exceptionOnMaxRows = arg0;
+ }
+
+ /**
+ * Maximum result set rows to fetch
+ * @return
+ */
+ @TranslatorProperty(name="max-result-rows", display="Maximum Result Rows", description="Maximum Result Rows allowed", advanced=true, defaultValue="-1")
+ public int getMaxResultRows() {
+ return maxResultRows;
+ }
+
+ public void setMaxResultRows(int arg0) {
+ this.maxResultRows = arg0;
+ }
+
+ /**
+ * Shows the XA transaction capability of the Connector.
+ * @return
+ */
+ @TranslatorProperty(name="xa-capable", display="Is XA Capable", description="True, if this connector supports XA Transactions", defaultValue="false")
+ public boolean isXaCapable() {
+ return xaCapable;
+ }
+
+ public void setXaCapable(boolean arg0) {
+ this.xaCapable = arg0;
+ }
+
+ /**
+ * Flag that indicates if a underlying source connection required for this execution factory to work
+ * @return
+ */
+ public boolean isSourceRequired() {
+ return sourceRequired;
+ }
+
+ public void setSourceRequired(boolean value) {
+ this.sourceRequired = value;
+ }
+
+ /**
+ * Obtain a reference to the default LanguageFactory that can be used to construct
+ * new language interface objects. This is typically needed when modifying the language
+ * objects passed to the connector or for testing when objects need to be created.
+ */
+ public LanguageFactory getLanguageFactory() {
+ return LanguageFactory.INSTANCE;
+ }
+
+ /**
+ * Obtain a reference to the type facility, which can be used to perform many type
+ * conversions supplied by the Connector API.
+ */
+ public TypeFacility getTypeFacility() {
+ return TYPE_FACILITY;
+ }
+
+ /**
+ * Create an execution object for the specified command
+ * @param command the command
+ * @param executionContext Provides information about the context that this command is
+ * executing within, such as the identifiers for the command being executed
+ * @param metadata Access to runtime metadata if needed to translate the command
+ * @param connection connection factory object to the data source
+ * @return An execution object that can use to execute the command
+ */
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
+ if (command instanceof QueryExpression) {
+ return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
+ }
+ if (command instanceof Call) {
+ return createProcedureExecution((Call)command, executionContext, metadata, connectionFactory);
+ }
+ return createUpdateExecution(command, executionContext, metadata, connectionFactory);
+ }
+
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution"); //$NON-NLS-1$
+ }
+
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
+ }
+
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
+ }
+
+ @Override
+ public boolean supportsSelectDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAliasedGroup() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSelfJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesSum() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesAvg() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMin() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMax() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCount() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSearchedCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ return null;
+ }
+
+ public boolean supportsInlineViews() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return false;
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return DEFAULT_MAX_FROM_GROUPS;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return false;
+ }
+
+ @Override
+ public int getMaxFromGroups() {
+ return DEFAULT_MAX_FROM_GROUPS; //-1 indicates no max
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSetQueryOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean useAnsiJoin() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBatchedUpdates() {
+ return false;
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBulkUpdate() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderByUnrelated() {
+ return false;
+ }
+
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import org.teiid.metadata.MetadataFactory;
-
-public interface MetadataProvider {
-
- void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws ConnectorException;
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import org.teiid.metadata.MetadataFactory;
+
+public interface MetadataProvider {
+
+ void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException;
+
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.Call;
-
-/**
- * The procedure execution represents the case where a connector can execute a
- * {@link Call}. The output may include 0 or more output parameters and
- * optionally a result set.
- */
-public interface ProcedureExecution extends ResultSetExecution {
-
- /**
- * Get the output parameter values. Results should place the return parameter
- * first if it is present, then the IN/OUT and OUT parameters should follow in
- * the order they appeared in the command.
- * @throws ConnectorException If an error occurs while retrieving the output value
- */
- List<?> getOutputParameterValues() throws ConnectorException;
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.Call;
+
+/**
+ * The procedure execution represents the case where a connector can execute a
+ * {@link Call}. The output may include 0 or more output parameters and
+ * optionally a result set.
+ */
+public interface ProcedureExecution extends ResultSetExecution {
+
+ /**
+ * Get the output parameter values. Results should place the return parameter
+ * first if it is present, then the IN/OUT and OUT parameters should follow in
+ * the order they appeared in the command.
+ * @throws TranslatorException If an error occurs while retrieving the output value
+ */
+ List<?> getOutputParameterValues() throws TranslatorException;
+
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.Call;
-import org.teiid.language.QueryExpression;
-
-/**
- * Defines an execution for {@link QueryExpression}s and {@link Call}s that
- * returns a resultset, which is represented through the iterator method
- * {@link #next()}.
- */
-public interface ResultSetExecution extends Execution {
-
- /**
- * Retrieves the next row of the resultset.
- * @return the next row or null indicating that there are no more results
- * @throws ConnectorException
- * @throws DataNotAvailableException
- */
- List<?> next() throws ConnectorException, DataNotAvailableException;
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.Call;
+import org.teiid.language.QueryExpression;
+
+/**
+ * Defines an execution for {@link QueryExpression}s and {@link Call}s that
+ * returns a resultset, which is represented through the iterator method
+ * {@link #next()}.
+ */
+public interface ResultSetExecution extends Execution {
+
+ /**
+ * Retrieves the next row of the resultset.
+ * @return the next row or null indicating that there are no more results
+ * @throws TranslatorException
+ * @throws DataNotAvailableException
+ */
+ List<?> next() throws TranslatorException, DataNotAvailableException;
+
+}
Copied: trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/TranslatorCapabilities.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,394 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.BatchedUpdates;
+import org.teiid.language.SetQuery;
+
+
+/**
+ * Allows a connector to specify the capabilities that a connector
+ * supports.
+ */
+public interface TranslatorCapabilities {
+
+ 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
+ */
+ boolean supportsSelectDistinct();
+
+ /**
+ * 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 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 inner or cross joins
+ * @since 6.1.0
+ */
+ boolean supportsInnerJoins();
+
+ /**
+ * Support indicates connector can accept self-joins where a
+ * group is joined to itself with aliases. Connector must also support
+ * {@link #supportsAliasedGroup()}.
+ * @since 3.1 SP2
+ */
+ boolean supportsSelfJoins();
+
+ /**
+ * Support indicates connector can accept left outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsOuterJoins();
+
+ /**
+ * Support indicates connector can accept full outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsFullOuterJoins();
+
+ /**
+ * Support indicates connector can accept inline views (subqueries
+ * in the FROM clause).
+ * @since 4.1
+ */
+ boolean supportsInlineViews();
+
+ /**
+ * 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 = constant)
+ * @since 3.1 SP2
+ */
+ boolean supportsCompareCriteriaEquals();
+
+ /**
+ * 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 supportsCompareCriteriaOrdered();
+
+ /**
+ * 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)
+ * @since 3.1 SP2
+ */
+ boolean supportsLikeCriteriaEscapeCharacter();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IN set)
+ * @since 3.1 SP2
+ */
+ boolean supportsInCriteria();
+
+ /**
+ * Support indicates connector accepts IN criteria with a subquery on the right side
+ * @since 4.0
+ */
+ boolean supportsInCriteriaSubquery();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IS NULL)
+ * @since 3.1 SP2
+ */
+ boolean supportsIsNullCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria connected by OR
+ * @since 3.1 SP2
+ */
+ boolean supportsOrCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria NOT
+ * @since 3.1 SP2
+ */
+ boolean supportsNotCriteria();
+
+ /**
+ * Support indicates connector accepts the EXISTS criteria
+ * @since 4.0
+ */
+ boolean supportsExistsCriteria();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use SOME
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaSome();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use ALL
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaAll();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause, including multiple elements
+ * and ascending and descending sorts.
+ * @since 3.1 SP2
+ */
+ boolean supportsOrderBy();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause with columns not from the select
+ * @since 6.2
+ * @return
+ */
+ boolean supportsOrderByUnrelated();
+
+ /**
+ * Whether the source supports an explicit GROUP BY clause
+ * @since 6.1
+ */
+ 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
+ */
+ boolean supportsAggregatesSum();
+
+ /**
+ * Support indicates connector can accept the AVG aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesAvg();
+
+ /**
+ * Support indicates connector can accept the MIN aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMin();
+
+ /**
+ * Support indicates connector can accept the MAX aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMax();
+
+ /**
+ * Support indicates connector can accept the COUNT aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCount();
+
+ /**
+ * Support indicates connector can accept the COUNT(*) aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCountStar();
+
+ /**
+ * Support indicates connector can accept DISTINCT within aggregate functions
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesDistinct();
+
+ /**
+ * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
+ * HAVING clauses
+ * @since 4.0
+ */
+ boolean supportsScalarSubqueries();
+
+ /**
+ * Support indicates connector can accept correlated subqueries wherever subqueries
+ * are accepted
+ * @since 4.0
+ */
+ boolean supportsCorrelatedSubqueries();
+
+ /**
+ * 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();
+
+ /**
+ * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
+ * @since 4.0
+ */
+ boolean supportsSearchedCaseExpressions();
+
+ /**
+ * Support indicates that the connector supports the UNION of two queries.
+ * @since 4.2
+ */
+ boolean supportsUnions();
+
+ /**
+ * Support indicates that the connector supports an ORDER BY on a SetQuery.
+ * @since 5.6
+ */
+ boolean supportsSetQueryOrderBy();
+
+ /**
+ * Support indicates that the connector supports the INTERSECT of two queries.
+ * @since 5.6
+ */
+ boolean supportsIntersect();
+
+ /**
+ * Support indicates that the connector supports the EXCEPT of two queries.
+ * @since 5.6
+ */
+ boolean supportsExcept();
+
+ /**
+ * Get list of all supported function names. Arithmetic functions have names like
+ * "+".
+ * @since 3.1 SP3
+ */
+ List<String> getSupportedFunctions();
+
+ /**
+ * Get the integer value representing the number of values allowed in an IN criteria
+ * in the WHERE clause of a query
+ * @since 5.0
+ */
+ int getMaxInCriteriaSize();
+
+ /**
+ * <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>
+ *
+ * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
+ * @since 5.0
+ */
+ boolean supportsFunctionsInGroupBy();
+
+ /**
+ * Gets whether the connector can limit the number of rows returned by a query.
+ * @since 5.0 SP1
+ */
+ boolean supportsRowLimit();
+
+ /**
+ * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
+ * result sets that start in the middle of the resulting rows returned by a query
+ * @since 5.0 SP1
+ */
+ boolean supportsRowOffset();
+
+ /**
+ * The number of groups supported in the from clause. Added for a Sybase limitation.
+ * @since 5.6
+ * @return the number of groups supported in the from clause, or -1 if there is no limit
+ */
+ int getMaxFromGroups();
+
+ /**
+ * Whether the source prefers to use ANSI style joins.
+ * @since 6.0
+ */
+ boolean useAnsiJoin();
+
+ /**
+ * Whether the source supports queries without criteria.
+ * @since 6.0
+ */
+ boolean requiresCriteria();
+
+ /**
+ * Whether the source supports {@link BatchedUpdates}
+ * @since 6.0
+ */
+ boolean supportsBatchedUpdates();
+
+ /**
+ * Whether the source supports updates with multiple value sets
+ * @since 6.0
+ */
+ boolean supportsBulkUpdate();
+
+ /**
+ * Support indicates that the connector can accept INSERTs with
+ * values specified by an {@link SetQuery}.
+ * @since 6.1
+ */
+ boolean supportsInsertWithQueryExpression();
+
+}
Copied: trunk/api/src/main/java/org/teiid/translator/TranslatorException.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/TranslatorException.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/TranslatorException.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import org.teiid.core.TeiidException;
+
+/**
+ * An exception the connector writer can return in case of an
+ * error while using the connector.
+ */
+public class TranslatorException extends TeiidException{
+
+ private static final long serialVersionUID = -5980862789340592219L;
+
+ /**
+ * No-arg constructor required by Externalizable semantics.
+ */
+ public TranslatorException() {
+ super();
+ }
+
+ /**
+ * Construct an instance with the message specified.
+ *
+ * @param message A message describing the exception
+ */
+ public TranslatorException( String message ) {
+ super( message );
+ }
+
+ public TranslatorException( String errorCode, String message ) {
+ super( message, errorCode);
+ }
+
+ public TranslatorException( int errorCode, String message ) {
+ super(message, Integer.toString(errorCode));
+ }
+
+
+ /**
+ * 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 TranslatorException( Throwable e, String message ) {
+ super(e, message);
+ }
+
+ /**
+ * Construct an instance with a linked exception specified.
+ *
+ * @param e An exception to chain to this exception
+ */
+ public TranslatorException( Throwable e ) {
+ super( e );
+ }
+
+}
Deleted: trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.Delete;
-import org.teiid.language.Insert;
-import org.teiid.language.Update;
-
-
-/**
- * The update execution represents the case where a connector can
- * execute an {@link Insert}, {@link Update}, {@link Delete}, or {@link BatchedUpdates} command.
- */
-public interface UpdateExecution extends Execution {
-
- /**
- * Returns the update counts for the execution.
- * @return the update counts corresponding to the command executed
- * @throws DataNotAvailableException
- * @throws ConnectorException
- */
- int[] getUpdateCounts() throws DataNotAvailableException, ConnectorException;
-
-}
Copied: trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java (from rev 2123, trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java)
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java (rev 0)
+++ trunk/api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13 16:19:04 UTC (rev 2124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import org.teiid.language.BatchedUpdates;
+import org.teiid.language.Delete;
+import org.teiid.language.Insert;
+import org.teiid.language.Update;
+
+
+/**
+ * The update execution represents the case where a connector can
+ * execute an {@link Insert}, {@link Update}, {@link Delete}, or {@link BatchedUpdates} command.
+ */
+public interface UpdateExecution extends Execution {
+
+ /**
+ * Returns the update counts for the execution.
+ * @return the update counts corresponding to the command executed
+ * @throws DataNotAvailableException
+ * @throws TranslatorException
+ */
+ int[] getUpdateCounts() throws DataNotAvailableException, TranslatorException;
+
+}
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/connector-ldap/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/connector-salesforce/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/connector-text/pom.xml
===================================================================
--- trunk/connectors/connector-text/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/connector-text/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -17,7 +17,7 @@
<!-- Internal Test Dependencies -->
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/translator-jdbc/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -16,7 +16,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/translator-ldap/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/translator-loopback/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -16,7 +16,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/translator-salesforce/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/connectors/translator-text/pom.xml
===================================================================
--- trunk/connectors/translator-text/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/connectors/translator-text/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/engine/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -39,7 +39,7 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/jboss-integration/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -20,7 +20,7 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
</dependency>
<dependency>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/metadata/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -43,7 +43,7 @@
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -238,12 +238,12 @@
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<type>test-jar</type>
<version>${project.version}</version>
<scope>test</scope>
@@ -466,7 +466,7 @@
</dependencyManagement>
<modules>
<module>common-core</module>
- <module>connector-api</module>
+ <module>api</module>
<module>client</module>
<module>engine</module>
<module>connectors</module>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/runtime/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -23,7 +23,7 @@
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2010-05-13 14:30:43 UTC (rev 2123)
+++ trunk/test-integration/pom.xml 2010-05-13 16:19:04 UTC (rev 2124)
@@ -37,7 +37,7 @@
</dependency>
<dependency>
<groupId>org.jboss.teiid</groupId>
- <artifactId>teiid-connector-api</artifactId>
+ <artifactId>teiid-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.teiid.connectors</groupId>
13 years, 11 months
teiid SVN: r2123 - in trunk: connector-api/src/main/java/org/teiid/resource/spi and 49 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-05-13 10:30:43 -0400 (Thu, 13 May 2010)
New Revision: 2123
Added:
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
Removed:
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java
Modified:
trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java
trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
trunk/connector-api/src/main/java/org/teiid/translator/Execution.java
trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java
trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java
trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java
trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java
trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.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/JDBCBaseExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.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/JDBCMetdataProcessor.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
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/teiid/TeiidExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java
trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java
trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1089, TEIID-1075: renaming the capabilities and connector exception classes to TranslatorCapabilities and TranslatorException. Also, remove the use of TranslatorException from the connection layer
Modified: trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/metadata/MetadataFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.connector.DataPlugin;
import org.teiid.core.id.UUIDFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TypeFacility;
@@ -73,9 +73,9 @@
* Add a table with the given name to the model.
* @param name
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Table addTable(String name) throws ConnectorException {
+ public Table addTable(String name) throws TranslatorException {
Table table = new Table();
table.setTableType(Table.Type.Table);
table.setName(name);
@@ -90,11 +90,11 @@
* @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Column addColumn(String name, String type, ColumnSet<?> table) throws ConnectorException {
+ public Column addColumn(String name, String type, ColumnSet<?> table) throws TranslatorException {
if (name.indexOf(AbstractMetadataRecord.NAME_DELIM_CHAR) != -1) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.invalid_name", name)); //$NON-NLS-1$
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.invalid_name", name)); //$NON-NLS-1$
}
Column column = new Column();
column.setName(name);
@@ -109,10 +109,10 @@
}
private Datatype setColumnType(String type,
- BaseColumn column) throws ConnectorException {
+ BaseColumn column) throws TranslatorException {
Datatype datatype = dataTypes.get(type);
if (datatype == null) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
}
column.setDatatype(datatype);
column.setDatatypeUUID(datatype.getUUID());
@@ -129,9 +129,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table) throws ConnectorException {
+ public KeyRecord addPrimaryKey(String name, List<String> columnNames, Table table) throws TranslatorException {
KeyRecord primaryKey = new KeyRecord(KeyRecord.Type.Primary);
primaryKey.setParent(table);
primaryKey.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -148,9 +148,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws ConnectorException {
+ public KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws TranslatorException {
KeyRecord ap = new KeyRecord(KeyRecord.Type.AccessPattern);
ap.setParent(table);
ap.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -168,9 +168,9 @@
* @param columnNames
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws ConnectorException {
+ public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws TranslatorException {
KeyRecord index = new KeyRecord(nonUnique?KeyRecord.Type.NonUnique:KeyRecord.Type.Index);
index.setParent(table);
index.setColumns(new ArrayList<Column>(columnNames.size()));
@@ -188,16 +188,16 @@
* @param pkTable
* @param table
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public ForeignKey addForiegnKey(String name, List<String> columnNames, Table pkTable, Table table) throws ConnectorException {
+ public ForeignKey addForiegnKey(String name, List<String> columnNames, Table pkTable, Table table) throws TranslatorException {
ForeignKey foreignKey = new ForeignKey();
foreignKey.setParent(table);
foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
foreignKey.setName(name);
setUUID(foreignKey);
if (pkTable.getPrimaryKey() == null) {
- throw new ConnectorException("No primary key defined for table " + pkTable); //$NON-NLS-1$
+ throw new TranslatorException("No primary key defined for table " + pkTable); //$NON-NLS-1$
}
foreignKey.setPrimaryKey(pkTable.getPrimaryKey());
foreignKey.setUniqueKeyID(pkTable.getPrimaryKey().getUUID());
@@ -210,9 +210,9 @@
* Add a procedure with the given name to the model.
* @param name
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Procedure addProcedure(String name) throws ConnectorException {
+ public Procedure addProcedure(String name) throws TranslatorException {
Procedure procedure = new Procedure();
procedure.setName(name);
setUUID(procedure);
@@ -228,9 +228,9 @@
* @param parameterType should be one of {@link ProcedureParameter.Type}
* @param procedure
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure) throws ConnectorException {
+ public ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, Procedure procedure) throws TranslatorException {
ProcedureParameter param = new ProcedureParameter();
param.setName(name);
setUUID(param);
@@ -248,9 +248,9 @@
* @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
* @param procedure
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public Column addProcedureResultSetColumn(String name, String type, Procedure procedure) throws ConnectorException {
+ public Column addProcedureResultSetColumn(String name, String type, Procedure procedure) throws TranslatorException {
if (procedure.getResultSet() == null) {
ColumnSet<Procedure> resultSet = new ColumnSet<Procedure>();
resultSet.setParent(procedure);
@@ -262,7 +262,7 @@
}
private void assignColumns(List<String> columnNames, Table table,
- ColumnSet<?> columns) throws ConnectorException {
+ ColumnSet<?> columns) throws TranslatorException {
for (String columnName : columnNames) {
boolean match = false;
for (Column column : table.getColumns()) {
@@ -273,7 +273,7 @@
}
}
if (!match) {
- throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.no_column_found", columnName)); //$NON-NLS-1$
+ throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.no_column_found", columnName)); //$NON-NLS-1$
}
}
}
Modified: trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/metadata/RuntimeMetadata.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -22,7 +22,7 @@
package org.teiid.metadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
* Helper methods that can be used to access runtime metadata.
@@ -34,45 +34,45 @@
* @param fullName
* @return The object
*/
- Table getTable(String fullName) throws ConnectorException;
+ Table getTable(String fullName) throws TranslatorException;
/**
* Look up an object by identifier
* @param fullName
* @return The object
*/
- Column getColumn(String fullName) throws ConnectorException;
+ Column getColumn(String fullName) throws TranslatorException;
/**
* Look up an object by identifier
* @param fullName
* @return The object
*/
- Procedure getProcedure(String fullName) throws ConnectorException;
+ Procedure getProcedure(String fullName) throws TranslatorException;
/**
* Gets the contents of a VDB resource in binary form.
* @param resourcePath a path returned by getVDBResourcePaths()
* @return the binary contents of the resource in a byte[]
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public byte[] getBinaryVDBResource(String resourcePath) throws ConnectorException;
+ public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException;
/**
* Gets the contents of a VDB resource as a String.
* @param resourcePath a path returned by getVDBResourcePaths()
* @return the contents of the resource as a String of characters
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public String getCharacterVDBResource(String resourcePath) throws ConnectorException;
+ public String getCharacterVDBResource(String resourcePath) throws TranslatorException;
/**
* Gets the resource paths of all the resources in the VDB.
* @return an array of resource paths of the resources in the VDB
- * @throws ConnectorException if the operation fails
+ * @throws TranslatorException if the operation fails
* @since 4.3
*/
- public String[] getVDBResourcePaths() throws ConnectorException;
+ public String[] getVDBResourcePaths() throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnection.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,8 +38,6 @@
import javax.security.auth.Subject;
import javax.transaction.xa.XAResource;
-import org.teiid.translator.ConnectorException;
-
public class BasicManagedConnection implements ManagedConnection {
protected PrintWriter log;
protected final Collection<ConnectionEventListener> listeners = new ArrayList<ConnectionEventListener>();
@@ -88,7 +86,7 @@
@Override
public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
if(!(arg1 instanceof ConnectionRequestInfoWrapper)) {
- throw new ConnectorException("Un-recognized Connection Request Info object received"); //$NON-NLS-1$
+ throw new ResourceException("Un-recognized Connection Request Info object received"); //$NON-NLS-1$
}
ConnectionContext.setSubject(arg0);
@@ -153,9 +151,9 @@
}
}
- Connection getConnection() throws ConnectorException {
+ Connection getConnection() throws ResourceException {
if (this.physicalConnection == null)
- throw new ConnectorException("Connection has been destroyed!!!"); //$NON-NLS-1$
+ throw new ResourceException("Connection has been destroyed!!!"); //$NON-NLS-1$
return this.physicalConnection;
}
Modified: trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/resource/spi/BasicManagedConnectionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,7 +38,6 @@
import org.teiid.core.TeiidException;
import org.teiid.core.util.ReflectionHelper;
-import org.teiid.translator.ConnectorException;
public abstract class BasicManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation, ValidatingManagedConnectionFactory {
@@ -86,21 +85,21 @@
this.ra = (BasicResourceAdapter)arg0;
}
- public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ConnectorException {
+ public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ResourceException {
try {
if (className == null) {
if (defaultClass == null) {
- throw new ConnectorException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
+ throw new ResourceException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
}
return expectedType.cast(defaultClass.newInstance());
}
return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
} catch (TeiidException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
} catch (IllegalAccessException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
} catch(InstantiationException e) {
- throw new ConnectorException(e);
+ throw new ResourceException(e);
}
}
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -1,394 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.SetQuery;
-
-
-/**
- * Allows a connector to specify the capabilities that a connector
- * 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
- */
- boolean supportsSelectDistinct();
-
- /**
- * 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 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 inner or cross joins
- * @since 6.1.0
- */
- boolean supportsInnerJoins();
-
- /**
- * Support indicates connector can accept self-joins where a
- * group is joined to itself with aliases. Connector must also support
- * {@link #supportsAliasedGroup()}.
- * @since 3.1 SP2
- */
- boolean supportsSelfJoins();
-
- /**
- * Support indicates connector can accept left outer joins
- * @since 3.1 SP2
- */
- boolean supportsOuterJoins();
-
- /**
- * Support indicates connector can accept full outer joins
- * @since 3.1 SP2
- */
- boolean supportsFullOuterJoins();
-
- /**
- * Support indicates connector can accept inline views (subqueries
- * in the FROM clause).
- * @since 4.1
- */
- boolean supportsInlineViews();
-
- /**
- * 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 = constant)
- * @since 3.1 SP2
- */
- boolean supportsCompareCriteriaEquals();
-
- /**
- * 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 supportsCompareCriteriaOrdered();
-
- /**
- * 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)
- * @since 3.1 SP2
- */
- boolean supportsLikeCriteriaEscapeCharacter();
-
- /**
- * Support indicates connector accepts criteria of form (element IN set)
- * @since 3.1 SP2
- */
- boolean supportsInCriteria();
-
- /**
- * Support indicates connector accepts IN criteria with a subquery on the right side
- * @since 4.0
- */
- boolean supportsInCriteriaSubquery();
-
- /**
- * Support indicates connector accepts criteria of form (element IS NULL)
- * @since 3.1 SP2
- */
- boolean supportsIsNullCriteria();
-
- /**
- * Support indicates connector accepts logical criteria connected by OR
- * @since 3.1 SP2
- */
- boolean supportsOrCriteria();
-
- /**
- * Support indicates connector accepts logical criteria NOT
- * @since 3.1 SP2
- */
- boolean supportsNotCriteria();
-
- /**
- * Support indicates connector accepts the EXISTS criteria
- * @since 4.0
- */
- boolean supportsExistsCriteria();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use SOME
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaSome();
-
- /**
- * Support indicates connector accepts the quantified comparison criteria that
- * use ALL
- * @since 4.0
- */
- boolean supportsQuantifiedCompareCriteriaAll();
-
- /**
- * Support indicates connector accepts ORDER BY clause, including multiple elements
- * and ascending and descending sorts.
- * @since 3.1 SP2
- */
- boolean supportsOrderBy();
-
- /**
- * Support indicates connector accepts ORDER BY clause with columns not from the select
- * @since 6.2
- * @return
- */
- boolean supportsOrderByUnrelated();
-
- /**
- * Whether the source supports an explicit GROUP BY clause
- * @since 6.1
- */
- 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
- */
- boolean supportsAggregatesSum();
-
- /**
- * Support indicates connector can accept the AVG aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesAvg();
-
- /**
- * Support indicates connector can accept the MIN aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMin();
-
- /**
- * Support indicates connector can accept the MAX aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesMax();
-
- /**
- * Support indicates connector can accept the COUNT aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCount();
-
- /**
- * Support indicates connector can accept the COUNT(*) aggregate function
- * @since 3.1 SP2
- */
- boolean supportsAggregatesCountStar();
-
- /**
- * Support indicates connector can accept DISTINCT within aggregate functions
- * @since 3.1 SP2
- */
- boolean supportsAggregatesDistinct();
-
- /**
- * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
- * HAVING clauses
- * @since 4.0
- */
- boolean supportsScalarSubqueries();
-
- /**
- * Support indicates connector can accept correlated subqueries wherever subqueries
- * are accepted
- * @since 4.0
- */
- boolean supportsCorrelatedSubqueries();
-
- /**
- * 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();
-
- /**
- * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
- * @since 4.0
- */
- boolean supportsSearchedCaseExpressions();
-
- /**
- * Support indicates that the connector supports the UNION of two queries.
- * @since 4.2
- */
- boolean supportsUnions();
-
- /**
- * Support indicates that the connector supports an ORDER BY on a SetQuery.
- * @since 5.6
- */
- boolean supportsSetQueryOrderBy();
-
- /**
- * Support indicates that the connector supports the INTERSECT of two queries.
- * @since 5.6
- */
- boolean supportsIntersect();
-
- /**
- * Support indicates that the connector supports the EXCEPT of two queries.
- * @since 5.6
- */
- boolean supportsExcept();
-
- /**
- * Get list of all supported function names. Arithmetic functions have names like
- * "+".
- * @since 3.1 SP3
- */
- List<String> getSupportedFunctions();
-
- /**
- * Get the integer value representing the number of values allowed in an IN criteria
- * in the WHERE clause of a query
- * @since 5.0
- */
- int getMaxInCriteriaSize();
-
- /**
- * <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>
- *
- * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
- * @since 5.0
- */
- boolean supportsFunctionsInGroupBy();
-
- /**
- * Gets whether the connector can limit the number of rows returned by a query.
- * @since 5.0 SP1
- */
- boolean supportsRowLimit();
-
- /**
- * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
- * result sets that start in the middle of the resulting rows returned by a query
- * @since 5.0 SP1
- */
- boolean supportsRowOffset();
-
- /**
- * The number of groups supported in the from clause. Added for a Sybase limitation.
- * @since 5.6
- * @return the number of groups supported in the from clause, or -1 if there is no limit
- */
- int getMaxFromGroups();
-
- /**
- * Whether the source prefers to use ANSI style joins.
- * @since 6.0
- */
- boolean useAnsiJoin();
-
- /**
- * Whether the source supports queries without criteria.
- * @since 6.0
- */
- boolean requiresCriteria();
-
- /**
- * Whether the source supports {@link BatchedUpdates}
- * @since 6.0
- */
- boolean supportsBatchedUpdates();
-
- /**
- * Whether the source supports updates with multiple value sets
- * @since 6.0
- */
- boolean supportsBulkUpdate();
-
- /**
- * Support indicates that the connector can accept INSERTs with
- * values specified by an {@link SetQuery}.
- * @since 6.1
- */
- boolean supportsInsertWithQueryExpression();
-
-}
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import javax.resource.ResourceException;
-
-/**
- * An exception the connector writer can return in case of an
- * error while using the connector.
- */
-public class ConnectorException extends ResourceException{
-
- private static final long serialVersionUID = -5980862789340592219L;
-
- /**
- * No-arg constructor required by Externalizable semantics.
- */
- public ConnectorException() {
- super();
- }
-
- /**
- * Construct an instance with the message specified.
- *
- * @param message A message describing the exception
- */
- public ConnectorException( String message ) {
- super( message );
- }
-
- public ConnectorException( String errorCode, String message ) {
- super( message, errorCode);
- }
-
- public ConnectorException( int errorCode, String message ) {
- super(message, Integer.toString(errorCode));
- }
-
-
- /**
- * 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 ConnectorException( Throwable e, String message ) {
- super(message,e);
- }
-
- /**
- * Construct an instance with a linked exception specified.
- *
- * @param e An exception to chain to this exception
- */
- public ConnectorException( Throwable e ) {
- super( e );
- }
-
-}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/Execution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/Execution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/Execution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -36,19 +36,19 @@
/**
* Terminates the execution normally.
*/
- void close() throws ConnectorException;
+ void close() throws TranslatorException;
/**
* Cancels the execution abnormally. This will happen via
* a different thread from the one performing the execution, so
* should be expected to happen in a multi-threaded scenario.
*/
- void cancel() throws ConnectorException;
+ void cancel() throws TranslatorException;
/**
* Execute the associated command. Results will be retrieved through a specific sub-interface call.
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- void execute() throws ConnectorException;
+ void execute() throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
* The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
* the "start" method is called. This class represents the basic capabilities of the translator.
*/
-public class ExecutionFactory implements ConnectorCapabilities{
+public class ExecutionFactory implements TranslatorCapabilities{
public static final int DEFAULT_MAX_FROM_GROUPS = -1;
@@ -53,7 +53,7 @@
/**
* Initialize the connector with supplied configuration
*/
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
}
/**
@@ -146,7 +146,7 @@
* @param connection connection factory object to the data source
* @return An execution object that can use to execute the command
*/
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
if (command instanceof QueryExpression) {
return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
}
@@ -156,16 +156,16 @@
return createUpdateExecution(command, executionContext, metadata, connectionFactory);
}
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution"); //$NON-NLS-1$
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution"); //$NON-NLS-1$
}
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
+ throw new TranslatorException("Unsupported Execution");//$NON-NLS-1$
}
@Override
Modified: trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/MetadataProvider.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -26,6 +26,6 @@
public interface MetadataProvider {
- void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws ConnectorException;
+ void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ProcedureExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -37,8 +37,8 @@
* Get the output parameter values. Results should place the return parameter
* first if it is present, then the IN/OUT and OUT parameters should follow in
* the order they appeared in the command.
- * @throws ConnectorException If an error occurs while retrieving the output value
+ * @throws TranslatorException If an error occurs while retrieving the output value
*/
- List<?> getOutputParameterValues() throws ConnectorException;
+ List<?> getOutputParameterValues() throws TranslatorException;
}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ResultSetExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -37,9 +37,9 @@
/**
* Retrieves the next row of the resultset.
* @return the next row or null indicating that there are no more results
- * @throws ConnectorException
+ * @throws TranslatorException
* @throws DataNotAvailableException
*/
- List<?> next() throws ConnectorException, DataNotAvailableException;
+ List<?> next() throws TranslatorException, DataNotAvailableException;
}
Copied: trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java (from rev 2121, trunk/connector-api/src/main/java/org/teiid/translator/ConnectorCapabilities.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/translator/TranslatorCapabilities.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -0,0 +1,394 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import java.util.List;
+
+import org.teiid.language.BatchedUpdates;
+import org.teiid.language.SetQuery;
+
+
+/**
+ * Allows a connector to specify the capabilities that a connector
+ * supports.
+ */
+public interface TranslatorCapabilities {
+
+ 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
+ */
+ boolean supportsSelectDistinct();
+
+ /**
+ * 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 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 inner or cross joins
+ * @since 6.1.0
+ */
+ boolean supportsInnerJoins();
+
+ /**
+ * Support indicates connector can accept self-joins where a
+ * group is joined to itself with aliases. Connector must also support
+ * {@link #supportsAliasedGroup()}.
+ * @since 3.1 SP2
+ */
+ boolean supportsSelfJoins();
+
+ /**
+ * Support indicates connector can accept left outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsOuterJoins();
+
+ /**
+ * Support indicates connector can accept full outer joins
+ * @since 3.1 SP2
+ */
+ boolean supportsFullOuterJoins();
+
+ /**
+ * Support indicates connector can accept inline views (subqueries
+ * in the FROM clause).
+ * @since 4.1
+ */
+ boolean supportsInlineViews();
+
+ /**
+ * 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 = constant)
+ * @since 3.1 SP2
+ */
+ boolean supportsCompareCriteriaEquals();
+
+ /**
+ * 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 supportsCompareCriteriaOrdered();
+
+ /**
+ * 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)
+ * @since 3.1 SP2
+ */
+ boolean supportsLikeCriteriaEscapeCharacter();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IN set)
+ * @since 3.1 SP2
+ */
+ boolean supportsInCriteria();
+
+ /**
+ * Support indicates connector accepts IN criteria with a subquery on the right side
+ * @since 4.0
+ */
+ boolean supportsInCriteriaSubquery();
+
+ /**
+ * Support indicates connector accepts criteria of form (element IS NULL)
+ * @since 3.1 SP2
+ */
+ boolean supportsIsNullCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria connected by OR
+ * @since 3.1 SP2
+ */
+ boolean supportsOrCriteria();
+
+ /**
+ * Support indicates connector accepts logical criteria NOT
+ * @since 3.1 SP2
+ */
+ boolean supportsNotCriteria();
+
+ /**
+ * Support indicates connector accepts the EXISTS criteria
+ * @since 4.0
+ */
+ boolean supportsExistsCriteria();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use SOME
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaSome();
+
+ /**
+ * Support indicates connector accepts the quantified comparison criteria that
+ * use ALL
+ * @since 4.0
+ */
+ boolean supportsQuantifiedCompareCriteriaAll();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause, including multiple elements
+ * and ascending and descending sorts.
+ * @since 3.1 SP2
+ */
+ boolean supportsOrderBy();
+
+ /**
+ * Support indicates connector accepts ORDER BY clause with columns not from the select
+ * @since 6.2
+ * @return
+ */
+ boolean supportsOrderByUnrelated();
+
+ /**
+ * Whether the source supports an explicit GROUP BY clause
+ * @since 6.1
+ */
+ 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
+ */
+ boolean supportsAggregatesSum();
+
+ /**
+ * Support indicates connector can accept the AVG aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesAvg();
+
+ /**
+ * Support indicates connector can accept the MIN aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMin();
+
+ /**
+ * Support indicates connector can accept the MAX aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesMax();
+
+ /**
+ * Support indicates connector can accept the COUNT aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCount();
+
+ /**
+ * Support indicates connector can accept the COUNT(*) aggregate function
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesCountStar();
+
+ /**
+ * Support indicates connector can accept DISTINCT within aggregate functions
+ * @since 3.1 SP2
+ */
+ boolean supportsAggregatesDistinct();
+
+ /**
+ * Support indicates connector can accept scalar subqueries in the SELECT, WHERE, and
+ * HAVING clauses
+ * @since 4.0
+ */
+ boolean supportsScalarSubqueries();
+
+ /**
+ * Support indicates connector can accept correlated subqueries wherever subqueries
+ * are accepted
+ * @since 4.0
+ */
+ boolean supportsCorrelatedSubqueries();
+
+ /**
+ * 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();
+
+ /**
+ * Support indicates connector can accept queries with searched CASE WHEN <criteria> ... END
+ * @since 4.0
+ */
+ boolean supportsSearchedCaseExpressions();
+
+ /**
+ * Support indicates that the connector supports the UNION of two queries.
+ * @since 4.2
+ */
+ boolean supportsUnions();
+
+ /**
+ * Support indicates that the connector supports an ORDER BY on a SetQuery.
+ * @since 5.6
+ */
+ boolean supportsSetQueryOrderBy();
+
+ /**
+ * Support indicates that the connector supports the INTERSECT of two queries.
+ * @since 5.6
+ */
+ boolean supportsIntersect();
+
+ /**
+ * Support indicates that the connector supports the EXCEPT of two queries.
+ * @since 5.6
+ */
+ boolean supportsExcept();
+
+ /**
+ * Get list of all supported function names. Arithmetic functions have names like
+ * "+".
+ * @since 3.1 SP3
+ */
+ List<String> getSupportedFunctions();
+
+ /**
+ * Get the integer value representing the number of values allowed in an IN criteria
+ * in the WHERE clause of a query
+ * @since 5.0
+ */
+ int getMaxInCriteriaSize();
+
+ /**
+ * <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>
+ *
+ * <br>NOT CURRENTLY USED - group by expressions create an inline view for pushdown
+ * @since 5.0
+ */
+ boolean supportsFunctionsInGroupBy();
+
+ /**
+ * Gets whether the connector can limit the number of rows returned by a query.
+ * @since 5.0 SP1
+ */
+ boolean supportsRowLimit();
+
+ /**
+ * Gets whether the connector supports a SQL clause (similar to the LIMIT with an offset) that can return
+ * result sets that start in the middle of the resulting rows returned by a query
+ * @since 5.0 SP1
+ */
+ boolean supportsRowOffset();
+
+ /**
+ * The number of groups supported in the from clause. Added for a Sybase limitation.
+ * @since 5.6
+ * @return the number of groups supported in the from clause, or -1 if there is no limit
+ */
+ int getMaxFromGroups();
+
+ /**
+ * Whether the source prefers to use ANSI style joins.
+ * @since 6.0
+ */
+ boolean useAnsiJoin();
+
+ /**
+ * Whether the source supports queries without criteria.
+ * @since 6.0
+ */
+ boolean requiresCriteria();
+
+ /**
+ * Whether the source supports {@link BatchedUpdates}
+ * @since 6.0
+ */
+ boolean supportsBatchedUpdates();
+
+ /**
+ * Whether the source supports updates with multiple value sets
+ * @since 6.0
+ */
+ boolean supportsBulkUpdate();
+
+ /**
+ * Support indicates that the connector can accept INSERTs with
+ * values specified by an {@link SetQuery}.
+ * @since 6.1
+ */
+ boolean supportsInsertWithQueryExpression();
+
+}
Copied: trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java (from rev 2121, trunk/connector-api/src/main/java/org/teiid/translator/ConnectorException.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator;
+
+import org.teiid.core.TeiidException;
+
+/**
+ * An exception the connector writer can return in case of an
+ * error while using the connector.
+ */
+public class TranslatorException extends TeiidException{
+
+ private static final long serialVersionUID = -5980862789340592219L;
+
+ /**
+ * No-arg constructor required by Externalizable semantics.
+ */
+ public TranslatorException() {
+ super();
+ }
+
+ /**
+ * Construct an instance with the message specified.
+ *
+ * @param message A message describing the exception
+ */
+ public TranslatorException( String message ) {
+ super( message );
+ }
+
+ public TranslatorException( String errorCode, String message ) {
+ super( message, errorCode);
+ }
+
+ public TranslatorException( int errorCode, String message ) {
+ super(message, Integer.toString(errorCode));
+ }
+
+
+ /**
+ * 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 TranslatorException( Throwable e, String message ) {
+ super(e, message);
+ }
+
+ /**
+ * Construct an instance with a linked exception specified.
+ *
+ * @param e An exception to chain to this exception
+ */
+ public TranslatorException( Throwable e ) {
+ super( e );
+ }
+
+}
Property changes on: trunk/connector-api/src/main/java/org/teiid/translator/TranslatorException.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connector-api/src/main/java/org/teiid/translator/UpdateExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,8 +38,8 @@
* Returns the update counts for the execution.
* @return the update counts corresponding to the command executed
* @throws DataNotAvailableException
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- int[] getUpdateCounts() throws DataNotAvailableException, ConnectorException;
+ int[] getUpdateCounts() throws DataNotAvailableException, TranslatorException;
}
Modified: trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java
===================================================================
--- trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/connector-ldap/src/main/java/org/teiid/resource/adapter/ldap/LDAPConnectionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -41,11 +41,11 @@
import javax.naming.ldap.ExtendedResponse;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
+import javax.resource.ResourceException;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.ConnectorException;
@@ -64,19 +64,13 @@
public static final String LDAP_USER_OBJECT_TYPE = "person"; //$NON-NLS-1$
public static final String LDAP_REFERRAL_MODE = "follow"; //$NON-NLS-1$
- public LDAPConnectionImpl(LDAPManagedConnectionFactory config) throws ConnectorException {
+ public LDAPConnectionImpl(LDAPManagedConnectionFactory config) throws ResourceException {
this.config = config;
checkProperties();
// Create initial LDAP connection.
- try {
- this.initCtx = initializeLDAPContext();
- } catch(ConnectorException ce) {
- final String msg = LDAPPlugin.Util.getString("LDAPConnection.contextInitFailed"); //$NON-NLS-1$
- throw new ConnectorException(ce, msg);
- }
-
+ this.initCtx = initializeLDAPContext();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "LDAP Connection has been newly created."); //$NON-NLS-1$
}
@@ -85,21 +79,21 @@
* a ConnectorException is thrown.
* @param props
*/
- private void checkProperties() throws ConnectorException {
+ private void checkProperties() throws ResourceException {
// LDAP URL
if(this.config.getLdapUrl() == null) {
final String msg = LDAPPlugin.Util.getString("LDAPConnection.urlPropNotFound"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
// LDAP Admin User DN
if(this.config.getLdapAdminUserDN() == null) {
final String msg = LDAPPlugin.Util.getString("LDAPConnection.adminUserDNPropNotFound"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
// LDAP Admin User Password
if(this.config.getLdapAdminUserPassword() == null) {
final String msg = LDAPPlugin.Util.getString("LDAPConnection.adminUserPassPropNotFound"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new ResourceException(msg);
}
}
@@ -109,7 +103,7 @@
* contexts, in order to support the different paging implementations they provide.
* @return the initial LDAP Context
*/
- private InitialLdapContext initializeLDAPContext() throws ConnectorException {
+ private InitialLdapContext initializeLDAPContext() throws ResourceException {
// Create the root context.
InitialLdapContext initContext;
@@ -141,11 +135,8 @@
initContext = new InitialLdapContext(connenv, null);
} catch(NamingException ne){
final String msg = LDAPPlugin.Util.getString("LDAPConnection.directoryNamingError",ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg);
- } catch(Exception e) {
- final String msg = LDAPPlugin.Util.getString("LDAPConnection.directoryInitError"); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
- }
+ throw new ResourceException(msg);
+ }
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Successfully obtained initial LDAP context."); //$NON-NLS-1$
return initContext;
}
Modified: trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -33,7 +33,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.ConnectorException;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.DataPayload;
@@ -74,15 +73,15 @@
PackageVersionHeader pvHeader = partnerFactory.createPackageVersionHeader();
- public SalesforceConnectionImpl(String username, String password, URL url, long pingInterval, int timeout) throws ConnectorException {
+ public SalesforceConnectionImpl(String username, String password, URL url, long pingInterval, int timeout) throws ResourceException {
login(username, password, url, timeout);
}
- String getUserName() throws ConnectorException {
+ String getUserName() throws ResourceException {
try {
return sfSoap.getUserInfo(sh).getUserName();
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getMessage());
+ throw new ResourceException(e.getMessage());
}
}
@@ -90,8 +89,7 @@
return sfSoap;
}
- private void login(String username, String password, URL url, int timeout)
- throws ConnectorException {
+ private void login(String username, String password, URL url, int timeout) throws ResourceException {
if (!isAlive()) {
LoginResult loginResult = null;
sfSoap = null;
@@ -111,11 +109,11 @@
//}
loginResult = sfSoap.login(username, password);
} catch (LoginFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
} catch (InvalidIdFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getCause().getMessage());
+ throw new ResourceException(e.getCause().getMessage());
}
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username);
@@ -133,7 +131,7 @@
try {
sfSoap.getUserInfo(sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e.getMessage());
+ throw new ResourceException(e.getMessage());
}
}
}
@@ -154,7 +152,7 @@
return result;
}
- public QueryResult query(String queryString, int batchSize, Boolean queryAll) throws ConnectorException {
+ public QueryResult query(String queryString, int batchSize, Boolean queryAll) throws ResourceException {
if(batchSize > 2000) {
batchSize = 2000;
@@ -174,42 +172,42 @@
qr = sfSoap.query(queryString, sh);
}
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (MalformedQueryFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidQueryLocatorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
return qr;
}
- public QueryResult queryMore(String queryLocator, int batchSize) throws ConnectorException {
+ public QueryResult queryMore(String queryLocator, int batchSize) throws ResourceException {
QueryOptions qo = partnerFactory.createQueryOptions();
qo.setBatchSize(batchSize);
try {
return sfSoap.queryMore(queryLocator, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidQueryLocatorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
}
- public int delete(String[] ids) throws ConnectorException {
+ public int delete(String[] ids) throws ResourceException {
List<DeleteResult> results = null;
try {
results = sfSoap.delete(Arrays.asList(ids), sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
boolean allGood = true;
@@ -232,12 +230,12 @@
}
}
if(!allGood) {
- throw new ConnectorException(errorMessages.toString());
+ throw new ResourceException(errorMessages.toString());
}
return results.size();
}
- public int create(DataPayload data) throws ConnectorException {
+ public int create(DataPayload data) throws ResourceException {
SObject toCreate = new SObject();
toCreate.setType(data.getType());
toCreate.getAny().addAll(data.getMessageElements());
@@ -247,18 +245,18 @@
try {
result = sfSoap.create(objects, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
return analyzeResult(result);
}
- public int update(List<DataPayload> updateDataList) throws ConnectorException {
+ public int update(List<DataPayload> updateDataList) throws ResourceException {
List<SObject> params = new ArrayList<SObject>(updateDataList.size());
for(int i = 0; i < updateDataList.size(); i++) {
DataPayload data = updateDataList.get(i);
@@ -272,34 +270,34 @@
try {
result = sfSoap.update(params, sh);
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
}
return analyzeResult(result);
}
- private int analyzeResult(List<SaveResult> results) throws ConnectorException {
+ private int analyzeResult(List<SaveResult> results) throws ResourceException {
for (SaveResult result : results) {
if(!result.isSuccess()) {
- throw new ConnectorException(result.getErrors().get(0).getMessage());
+ throw new ResourceException(result.getErrors().get(0).getMessage());
}
}
return results.size();
}
- public UpdatedResult getUpdated(String objectType, XMLGregorianCalendar startDate, XMLGregorianCalendar endDate) throws ConnectorException {
+ public UpdatedResult getUpdated(String objectType, XMLGregorianCalendar startDate, XMLGregorianCalendar endDate) throws ResourceException {
GetUpdatedResult updated;
try {
updated = sfSoap.getUpdated(objectType, startDate, endDate, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
UpdatedResult result = new UpdatedResult();
result.setLatestDateCovered(updated.getLatestDateCovered().toGregorianCalendar());
@@ -308,14 +306,14 @@
}
public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar,
- XMLGregorianCalendar endCalendar) throws ConnectorException {
+ XMLGregorianCalendar endCalendar) throws ResourceException {
GetDeletedResult deleted;
try {
deleted = sfSoap.getDeleted(objectName, startCalendar, endCalendar, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
DeletedResult result = new DeletedResult();
result.setLatestDateCovered(deleted.getLatestDateCovered().toGregorianCalendar());
@@ -335,7 +333,7 @@
return result;
}
- public QueryResult retrieve(String fieldList, String sObjectType, List<String> ids) throws ConnectorException {
+ public QueryResult retrieve(String fieldList, String sObjectType, List<String> ids) throws ResourceException {
try {
List<SObject> objects = sfSoap.retrieve(fieldList, sObjectType, ids, sh);
QueryResult result = new QueryResult();
@@ -343,36 +341,36 @@
result.setSize(objects.size());
return result;
} catch (InvalidFieldFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
} catch (MalformedQueryFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (InvalidIdFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(),e);
}
}
- public DescribeGlobalResult getObjects() throws ConnectorException {
+ public DescribeGlobalResult getObjects() throws ResourceException {
try {
return sfSoap.describeGlobal(sh);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- ConnectorException ce = new ConnectorException(e.getCause().getMessage());
+ ResourceException ce = new ResourceException(e.getCause().getMessage());
ce.initCause(e.getCause());
throw ce;
}
}
- public DescribeSObjectResult getObjectMetaData(String objectName) throws ConnectorException {
+ public DescribeSObjectResult getObjectMetaData(String objectName) throws ResourceException {
try {
return sfSoap.describeSObject(objectName, sh);
} catch (com.sforce.soap.partner.InvalidSObjectFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new ResourceException(e.getMessage(), e);
}
}
Modified: trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
===================================================================
--- trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
@WebServiceClient(name = "SforceService", wsdlLocation = SforceService.PARTNER_WSDL,targetNamespace = "urn:partner.soap.sforce.com")
public class SforceService extends Service {
- private static final String PARTNER_WSDL = "partner_17.wsdl"; //$NON-NLS-1$
+ public static final String PARTNER_WSDL = "partner_17.wsdl"; //$NON-NLS-1$
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("urn:partner.soap.sforce.com", "SforceService"); //$NON-NLS-1$ //$NON-NLS-2$
public final static QName Soap = new QName("urn:partner.soap.sforce.com", "Soap");//$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/TickerCollectorVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import org.teiid.language.*;
import org.teiid.language.visitor.HierarchyVisitor;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -34,7 +34,7 @@
public class TickerCollectorVisitor extends HierarchyVisitor {
private Set tickers = new HashSet();
- private ConnectorException exception;
+ private TranslatorException exception;
/**
*
@@ -51,7 +51,7 @@
return this.tickers;
}
- public ConnectorException getException() {
+ public TranslatorException getException() {
return this.exception;
}
@@ -82,16 +82,16 @@
String ticker = (String) literal.getValue();
this.tickers.add(ticker.toUpperCase());
} else {
- this.exception = new ConnectorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_type", literal.getType().getName())); //$NON-NLS-1$
+ this.exception = new TranslatorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_type", literal.getType().getName())); //$NON-NLS-1$
}
} else {
- this.exception = new ConnectorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_expression", expr)); //$NON-NLS-1$
+ this.exception = new TranslatorException(YahooPlugin.Util.getString("TickerCollectorVisitor.Unexpected_expression", expr)); //$NON-NLS-1$
}
}
- public static Set getTickers(Condition crit) throws ConnectorException {
+ public static Set getTickers(Condition crit) throws TranslatorException {
TickerCollectorVisitor visitor = new TickerCollectorVisitor();
crit.acceptVisitor(visitor);
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
@@ -85,7 +85,7 @@
* @see com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Log our command
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Yahoo executing command: " + command); //$NON-NLS-1$
@@ -99,13 +99,13 @@
this.neededColumns = getNeededColumns(query.getDerivedColumns(), this.metadata);
}
- static String translateIntoUrl(Select query) throws ConnectorException {
+ static String translateIntoUrl(Select query) throws TranslatorException {
StringBuffer url = new StringBuffer();
url.append(YahooPlugin.Util.getString("YahooExecution.URL_BEGIN")); //$NON-NLS-1$
Set tickers = getTickers(query);
if(tickers.size() == 0) {
- throw new ConnectorException(YahooPlugin.Util.getString("YahooExecution.No_tickers")); //$NON-NLS-1$
+ throw new TranslatorException(YahooPlugin.Util.getString("YahooExecution.No_tickers")); //$NON-NLS-1$
}
String urlAppendChar = YahooPlugin.Util.getString("YahooExecution.URL_APPEND_CHAR"); //$NON-NLS-1$
Iterator tickerIter = tickers.iterator();
@@ -122,10 +122,10 @@
/**
* @return
*/
- static Set getTickers(Select query) throws ConnectorException {
+ static Set getTickers(Select query) throws TranslatorException {
Condition crit = query.getWhere();
if(crit == null) {
- throw new ConnectorException(YahooPlugin.Util.getString("YahooExecution.Must_have_criteria")); //$NON-NLS-1$
+ throw new TranslatorException(YahooPlugin.Util.getString("YahooExecution.Must_have_criteria")); //$NON-NLS-1$
}
return TickerCollectorVisitor.getTickers(crit);
}
@@ -134,7 +134,7 @@
* @param yahooUrl
* @return
*/
- protected List executeUrl(String yahooUrl) throws ConnectorException {
+ protected List executeUrl(String yahooUrl) throws TranslatorException {
List rows = new ArrayList();
InputStreamReader inSR = null;
BufferedReader buffReader = null;
@@ -166,9 +166,9 @@
inSR.close();
} catch(MalformedURLException mue){
- throw new ConnectorException(mue, mue.getMessage());
+ throw new TranslatorException(mue, mue.getMessage());
} catch(IOException e) {
- throw new ConnectorException(e, e.getMessage());
+ throw new TranslatorException(e, e.getMessage());
} finally {
buffReader = null;
inSR = null;
@@ -235,7 +235,7 @@
* @param select
* @return
*/
- static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata metadata) throws ConnectorException {
+ static int[] getNeededColumns(List<DerivedColumn> select, RuntimeMetadata metadata) throws TranslatorException {
int[] cols = new int[select.size()];
Iterator iter = select.iterator();
for(int i=0; iter.hasNext(); i++) {
@@ -245,7 +245,7 @@
Column element = ((ColumnReference)expr).getMetadataObject();
cols[i] = element.getPosition();
} else {
- throw new ConnectorException(YahooPlugin.Util.getString("YahooExecution.Invalid_select_symbol", expr)); //$NON-NLS-1$
+ throw new TranslatorException(YahooPlugin.Util.getString("YahooExecution.Invalid_select_symbol", expr)); //$NON-NLS-1$
}
}
@@ -253,7 +253,7 @@
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (returnIndex < results.size()) {
List row = (List) results.get(returnIndex++);
return projectRow(row, neededColumns);
@@ -281,7 +281,7 @@
* @see com.metamatrix.data.Execution#close()
*/
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
// nothing to do
}
@@ -289,7 +289,7 @@
* @see com.metamatrix.data.Execution#cancel()
*/
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
}
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 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
@@ -38,12 +38,12 @@
public static final int YAHOO_MAX_SET_SIZE = 100;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
}
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new YahooExecution((Select)command, metadata);
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -110,7 +110,7 @@
// Methods
// ===========================================================================================================================
- protected TranslatedCommand translateCommand(Command command) throws ConnectorException {
+ protected TranslatedCommand translateCommand(Command command) throws TranslatorException {
TranslatedCommand translatedCommand = new TranslatedCommand(context, this.executionFactory);
translatedCommand.translateCommand(command);
@@ -124,7 +124,7 @@
/*
* @see com.metamatrix.data.Execution#close()
*/
- public synchronized void close() throws ConnectorException {
+ public synchronized void close() throws TranslatorException {
try {
if (statement != null) {
statement.close();
@@ -133,14 +133,14 @@
connection.close();
}
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
/*
* @see com.metamatrix.data.Execution#cancel()
*/
- public synchronized void cancel() throws ConnectorException {
+ public synchronized void cancel() throws TranslatorException {
// if both the DBMS and driver support aborting an SQL
try {
if (statement != null) {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionException.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -25,10 +25,10 @@
import java.sql.SQLException;
import java.util.Arrays;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
-public class JDBCExecutionException extends ConnectorException {
+public class JDBCExecutionException extends TranslatorException {
private static final long serialVersionUID = 1758087499488916573L;
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 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -60,7 +60,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -147,7 +147,7 @@
boolean initialConnection = true;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
String timeZone = getDatabaseTimeZone();
@@ -212,7 +212,7 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -220,13 +220,13 @@
afterConnectionCreation(conn);
return new JDBCQueryExecution(command, conn, executionContext, this);
} catch(SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -234,13 +234,13 @@
afterConnectionCreation(conn);
return new JDBCProcedureExecution(command, conn, executionContext, this);
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
@@ -249,12 +249,12 @@
afterConnectionCreation(conn);
return new JDBCUpdateExecution(command, conn, executionContext, this);
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
try {
Connection conn = null;
try {
@@ -270,7 +270,7 @@
}
}
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCMetdataProcessor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -44,7 +44,7 @@
import org.teiid.metadata.Table;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.ProcedureParameter.Type;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.TypeFacility;
@@ -88,7 +88,7 @@
private String quoteString;
public void getConnectorMetadata(Connection conn, MetadataFactory metadataFactory)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
DatabaseMetaData metadata = conn.getMetaData();
quoteString = metadata.getIdentifierQuoteString();
@@ -126,7 +126,7 @@
}
private void getProcedures(MetadataFactory metadataFactory,
- DatabaseMetaData metadata) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing procedures"); //$NON-NLS-1$
ResultSet procedures = metadata.getProcedures(catalog, schemaPattern, procedureNamePattern);
while (procedures.next()) {
@@ -183,7 +183,7 @@
}
private Map<String, TableInfo> getTables(MetadataFactory metadataFactory,
- DatabaseMetaData metadata) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing tables"); //$NON-NLS-1$
ResultSet tables = metadata.getTables(catalog, schemaPattern, tableNamePattern, tableTypes);
Map<String, TableInfo> tableMap = new HashMap<String, TableInfo>();
@@ -208,7 +208,7 @@
private void getColumns(MetadataFactory metadataFactory,
DatabaseMetaData metadata, Map<String, TableInfo> tableMap)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing columns"); //$NON-NLS-1$
ResultSet columns = metadata.getColumns(catalog, schemaPattern, tableNamePattern, null);
int rsColumns = columns.getMetaData().getColumnCount();
@@ -254,7 +254,7 @@
private void getPrimaryKeys(MetadataFactory metadataFactory,
DatabaseMetaData metadata, Map<String, TableInfo> tableMap)
- throws SQLException, ConnectorException {
+ throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing primary keys"); //$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet pks = metadata.getPrimaryKeys(tableInfo.catalog, tableInfo.schema, tableInfo.name);
@@ -282,7 +282,7 @@
}
private void getForeignKeys(MetadataFactory metadataFactory,
- DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing foreign keys"); //$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet fks = metadata.getImportedKeys(tableInfo.catalog, tableInfo.schema, tableInfo.name);
@@ -309,7 +309,7 @@
String fullTableName = getFullyQualifiedName(tableCatalog, tableSchema, tableName);
pkTable = tableMap.get(fullTableName);
if (pkTable == null) {
- throw new ConnectorException(JDBCPlugin.Util.getString("JDBCMetadataProcessor.cannot_find_primary", fullTableName)); //$NON-NLS-1$
+ throw new TranslatorException(JDBCPlugin.Util.getString("JDBCMetadataProcessor.cannot_find_primary", fullTableName)); //$NON-NLS-1$
}
fkName = fks.getString(12);
if (fkName == null) {
@@ -325,7 +325,7 @@
}
private void getIndexes(MetadataFactory metadataFactory,
- DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException, ConnectorException {
+ DatabaseMetaData metadata, Map<String, TableInfo> tableMap) throws SQLException, TranslatorException {
LogManager.logDetail("JDBCMetadataProcessor - Importing index info"); //$NON-NLS-1$
for (TableInfo tableInfo : tableMap.values()) {
ResultSet indexInfo = metadata.getIndexInfo(tableInfo.catalog, tableInfo.schema, tableInfo.name, false, importApproximateIndexes);
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.Argument;
import org.teiid.language.Call;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ProcedureExecution;
@@ -52,7 +52,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
Call procedure = (Call)command;
columnDataTypes = procedure.getResultSetColumnTypes();
@@ -67,13 +67,13 @@
this.results = this.executionFactory.executeStoredProcedure(cstmt, translatedComm, procedure.getReturnType());
addStatementWarnings();
}catch(SQLException e){
- throw new ConnectorException(e, JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql)); //$NON-NLS-1$
+ throw new TranslatorException(e, JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql)); //$NON-NLS-1$
}
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
if (results == null) {
return null;
}
@@ -81,7 +81,7 @@
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
try {
Call proc = (Call)this.command;
List<Object> result = new ArrayList<Object>();
@@ -102,7 +102,7 @@
}
return result;
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
@@ -63,7 +63,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// get column types
columnDataTypes = ((QueryExpression)command).getColumnTypes();
@@ -88,7 +88,7 @@
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
try {
if (results.next()) {
// New row for result set
@@ -103,7 +103,7 @@
return vals;
}
} catch (SQLException e) {
- throw new ConnectorException(e,
+ throw new TranslatorException(e,
JDBCPlugin.Util.getString("JDBCTranslator.Unexpected_exception_translating_results___8", e.getMessage())); //$NON-NLS-1$
}
@@ -113,7 +113,7 @@
/**
* @see org.teiid.translator.jdbc.JDBCBaseExecution#close()
*/
- public synchronized void close() throws ConnectorException {
+ public synchronized void close() throws TranslatorException {
// first we would need to close the result set here then we can close
// the statement, using the base class.
if (results != null) {
@@ -121,7 +121,7 @@
results.close();
results = null;
} catch (SQLException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
super.close();
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.BatchedUpdates;
import org.teiid.language.Command;
import org.teiid.language.Literal;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.UpdateExecution;
@@ -61,7 +61,7 @@
// ===========================================================================================================================
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
if (command instanceof BatchedUpdates) {
result = execute(((BatchedUpdates)command));
} else {
@@ -76,7 +76,7 @@
* @see com.metamatrix.data.api.BatchedUpdatesExecution#execute(org.teiid.language.Command[])
* @since 4.2
*/
- public int[] execute(BatchedUpdates batchedCommand) throws ConnectorException {
+ public int[] execute(BatchedUpdates batchedCommand) throws TranslatorException {
boolean succeeded = false;
boolean commitType = getAutoCommit(null);
@@ -140,7 +140,7 @@
private void executeBatch(int commandCount,
int[] results,
- List<TranslatedCommand> commands) throws ConnectorException {
+ List<TranslatedCommand> commands) throws TranslatorException {
try {
int[] batchResults = statement.executeBatch();
addStatementWarnings();
@@ -155,10 +155,10 @@
/**
* @param translatedComm
- * @throws ConnectorException
+ * @throws TranslatorException
* @since 4.3
*/
- private int[] executeTranslatedCommand(TranslatedCommand translatedComm) throws ConnectorException {
+ private int[] executeTranslatedCommand(TranslatedCommand translatedComm) throws TranslatorException {
// create statement or PreparedStatement and execute
String sql = translatedComm.getSql();
boolean commitType = false;
@@ -209,9 +209,9 @@
/**
* @param command
* @return
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private boolean getAutoCommit(TranslatedCommand tCommand) throws ConnectorException {
+ private boolean getAutoCommit(TranslatedCommand tCommand) throws TranslatorException {
if (this.context.isTransactional()) {
return false;
}
@@ -227,10 +227,10 @@
*
* @param exceptionOccurred
* @param command
- * @throws ConnectorException
+ * @throws TranslatorException
*/
private void restoreAutoCommit(boolean exceptionOccurred,
- TranslatedCommand tCommand) throws ConnectorException {
+ TranslatedCommand tCommand) throws TranslatorException {
try {
if (exceptionOccurred) {
connection.rollback();
@@ -249,7 +249,7 @@
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return result;
}
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.teiid.language.Command;
import org.teiid.language.Literal;
import org.teiid.language.visitor.CollectorVisitor;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.TypeFacility;
@@ -62,9 +62,9 @@
* be called right after the constructor; afterward, all of the getter methods
* can be called to retrieve results.
* @param command ICommand to be translated
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- public void translateCommand(Command command) throws ConnectorException {
+ public void translateCommand(Command command) throws TranslatorException {
SQLConversionVisitor sqlConversionVisitor = executionFactory.getSQLConversionVisitor();
sqlConversionVisitor.setExecutionContext(context);
if (executionFactory.usePreparedStatements() || hasBindValue(command)) {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.language.Literal;
import org.teiid.language.Comparison.Operator;
import org.teiid.language.Join.JoinType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
@@ -66,7 +66,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day")); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.jdbc.EscapeSyntaxModifier;
@@ -47,7 +47,7 @@
private String version = TEN_1;
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
//additional derby functions
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
@@ -176,7 +176,6 @@
/**
* Derby supports only SearchedCaseExpression, not CaseExpression.
- * @see org.teiid.translator.ConnectorCapabilities#supportsCaseExpressions()
* @since 5.0
*/
@Override
@@ -186,7 +185,6 @@
/**
* Derby supports only left and right outer joins.
- * @see org.teiid.translator.ConnectorCapabilities#supportsFullOuterJoins()
* @since 5.0
*/
@Override
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.AliasModifier;
import org.teiid.translator.jdbc.ConvertModifier;
@@ -41,7 +41,7 @@
public class H2ExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.PARSETIMESTAMP, new AliasModifier("parsedatetime")); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.FORMATTIMESTAMP, new AliasModifier("formatdatetime")); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.ConvertModifier;
import org.teiid.translator.jdbc.FunctionModifier;
@@ -37,7 +37,7 @@
public class HsqlExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true, getLanguageFactory()));
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new AddDiffModifier(false, getLanguageFactory()));
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.ConvertModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
@@ -38,7 +38,7 @@
public class InformixExecutionFactory extends JDBCExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CONVERT, new ConvertModifier());
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -27,14 +27,14 @@
import java.util.List;
import org.teiid.language.Function;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.FunctionModifier;
public class MySQL5ExecutionFactory extends MySQLExecutionFactory {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new FunctionModifier() {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.language.Function;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
import org.teiid.translator.jdbc.ConvertModifier;
@@ -63,7 +63,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.BITAND, new BitFunctionModifier("&", getLanguageFactory())); //$NON-NLS-1$
registerFunctionModifier(SourceSystemFunctions.BITNOT, new BitFunctionModifier("~", getLanguageFactory())); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -53,7 +53,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
@@ -83,7 +83,7 @@
public final static String ROWNUM = "ROWNUM"; //$NON-NLS-1$
public final static String SEQUENCE = ":SEQUENCE="; //$NON-NLS-1$
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
@@ -182,7 +182,7 @@
registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
}
- public void handleInsertSequences(Insert insert) throws ConnectorException {
+ public void handleInsertSequences(Insert insert) throws TranslatorException {
/*
* If a missing auto_increment column is modeled with name in source indicating that an Oracle Sequence
* then pull the Sequence name out of the name in source of the column.
@@ -224,7 +224,7 @@
int delimiterIndex = sequence.indexOf(Tokens.DOT);
if (delimiterIndex == -1) {
- throw new ConnectorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
}
String sequenceGroupName = sequence.substring(0, delimiterIndex);
String sequenceElementName = sequence.substring(delimiterIndex + 1);
@@ -241,7 +241,7 @@
if (command instanceof Insert) {
try {
handleInsertSequences((Insert)command);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
}
@@ -514,10 +514,6 @@
return true;
}
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
@Override
public boolean supportsFunctionsInGroupBy() {
return true;
@@ -531,17 +527,11 @@
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
@Override
public boolean supportsExcept() {
return true;
}
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
@Override
public boolean supportsIntersect() {
return true;
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.language.Limit;
import org.teiid.language.Literal;
import org.teiid.language.SQLReservedWords;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TranslatorProperty;
@@ -67,7 +67,7 @@
private String version = EIGHT_0;
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
//TODO: all of the functions (except for convert) can be handled through just the escape syntax
super.start();
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 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -33,7 +33,7 @@
import org.teiid.language.Limit;
import org.teiid.language.OrderBy;
import org.teiid.language.SetQuery;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.jdbc.AliasModifier;
@@ -48,7 +48,7 @@
*/
public class SybaseExecutionFactory extends JDBCExecutionFactory {
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -35,10 +35,7 @@
*/
public class TeiidExecutionFactory extends JDBCExecutionFactory {
- /**
- * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
- * @since 4.3
- */
+ @Override
public List<String> getSupportedFunctions() {
List<String> supportedFunctions = new ArrayList<String>();
supportedFunctions.addAll(super.getSupportedFunctions());
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -44,9 +44,7 @@
return false;
}
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
+ @Override
public List getSupportedFunctions() {
List supportedFunctions = new ArrayList();
supportedFunctions.addAll(super.getSupportedFunctions());
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -50,7 +50,7 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws TranslatorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, input);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Expression;
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
/**
@@ -96,7 +96,7 @@
JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), locateFunctionName, parameterOrder));
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.language.Expression;
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.SourceSystemFunctions;
/**
@@ -89,7 +89,7 @@
JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier(modFunctionName, getLanguageFactory()));
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -35,7 +35,7 @@
import org.teiid.dqp.internal.datamgr.language.TstLanguageBridgeFactory;
import org.teiid.language.LanguageObject;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
/**
@@ -53,7 +53,7 @@
private static JDBCExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new JDBCExecutionFactory();
TRANSLATOR.setTrimStrings(true);
TRANSLATOR.start();
@@ -75,14 +75,14 @@
try {
trans.start();
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
}
public static final RuntimeMetadata metadata = TstLanguageBridgeFactory.metadataFactory;
- private String getStringWithContext(LanguageObject obj) throws ConnectorException {
+ private String getStringWithContext(LanguageObject obj) throws TranslatorException {
JDBCExecutionFactory env = new JDBCExecutionFactory();
env.setUseCommentsInSourceQuery(true);
env.start();
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Command;
import org.teiid.query.function.metadata.FunctionMetadataReader;
import org.teiid.query.function.metadata.FunctionMethod;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -70,18 +70,18 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws TranslatorException {
helpTestVisitor(vdb,null,input, expectedOutput, translator);
}
- public static void helpTestVisitor(String vdb, String udf, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String udf, String input, String expectedOutput, JDBCExecutionFactory translator) throws TranslatorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, udf, input);
helpTestVisitor(expectedOutput, translator, obj);
}
- public static void helpTestVisitor(String expectedOutput, JDBCExecutionFactory translator, Command obj) throws ConnectorException {
+ public static void helpTestVisitor(String expectedOutput, JDBCExecutionFactory translator, Command obj) throws TranslatorException {
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), translator);
tc.translateCommand(obj);
assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -45,12 +45,12 @@
try {
TRANSLATOR = new AccessExecutionFactory();
TRANSLATOR.start();
- } catch(ConnectorException e) {
+ } catch(TranslatorException e) {
e.printStackTrace();
}
}
- public void helpTestVisitor(String input, String expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(String input, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
Command obj = FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(input);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.mockito.Mockito;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -44,7 +44,7 @@
private static DB2ExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new DB2ExecutionFactory();
TRANSLATOR.start();
}
@@ -53,7 +53,7 @@
return UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb"; //$NON-NLS-1$
}
- public void helpTestVisitor(TranslationUtility util, String input, String expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(TranslationUtility util, String input, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
Command obj = util.parseCommand(input);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -35,7 +35,7 @@
private static DerbyExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new DerbyExecutionFactory();
TRANSLATOR.start();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
public class TestH2Translator {
@@ -32,7 +32,7 @@
private static H2ExecutionFactory TRANSLATOR;
@BeforeClass
- public static void setUp() throws ConnectorException {
+ public static void setUp() throws TranslatorException {
TRANSLATOR = new H2ExecutionFactory();
TRANSLATOR.start();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
/**
@@ -33,7 +33,7 @@
private static MySQL5ExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new MySQL5ExecutionFactory();
TRANSLATOR.start();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
/**
@@ -34,7 +34,7 @@
private static MySQLExecutionFactory TRANSLATOR;
- @BeforeClass public static void oneTimeSetup() throws ConnectorException {
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
TRANSLATOR = new MySQLExecutionFactory();
TRANSLATOR.start();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -43,7 +43,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -62,7 +62,7 @@
TRANSLATOR.start();
}
- private void helpTestVisitor(String input, String expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(String input, String expectedOutput) throws TranslatorException {
helpTestVisitor(getOracleSpecificMetadata(), input, EMPTY_CONTEXT, null, expectedOutput);
}
@@ -490,15 +490,15 @@
return UnitTestUtil.getTestDataPath() + "/PartsSupplierOracle.vdb"; //$NON-NLS-1$
}
- private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String expectedOutput) throws TranslatorException {
helpTestVisitor(vdb, input, EMPTY_CONTEXT, dbmsTimeZone, expectedOutput, false);
}
- private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws ConnectorException {
+ private void helpTestVisitor(String vdb, String input, String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws TranslatorException {
helpTestVisitor(vdb, input, EMPTY_CONTEXT, dbmsTimeZone, expectedOutput, correctNaming);
}
- private void helpTestVisitor(String vdb, String input, ExecutionContext context, String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws ConnectorException {
+ private void helpTestVisitor(String vdb, String input, ExecutionContext context, String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws TranslatorException {
// Convert from sql to objects
TranslationUtility util = new TranslationUtility(vdb);
Command obj = util.parseCommand(input, correctNaming, true);
@@ -506,16 +506,16 @@
}
/** Helper method takes a QueryMetadataInterface impl instead of a VDB filename
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private void helpTestVisitor(QueryMetadataInterface metadata, String input, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(QueryMetadataInterface metadata, String input, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
CommandBuilder commandBuilder = new CommandBuilder(metadata);
Command obj = commandBuilder.getCommand(input);
this.helpTestVisitor(obj, context, dbmsTimeZone, expectedOutput);
}
- private void helpTestVisitor(Command obj, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws ConnectorException {
+ private void helpTestVisitor(Command obj, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws TranslatorException {
OracleExecutionFactory translator = new OracleExecutionFactory();
if (dbmsTimeZone != null) {
translator.setDatabaseTimeZone(dbmsTimeZone);
@@ -717,7 +717,7 @@
return new TransformationMetadata(null, store, null, null);
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws TranslatorException {
helpTestVisitor(vdb, input, null, expectedOutput);
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
public class TestPostgreSQLTranslator {
@@ -44,7 +44,7 @@
return TranslationHelper.BQT_VDB;
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws TranslatorException {
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, TRANSLATOR);
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.metadata.TransformationMetadata;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -48,7 +48,7 @@
private static SQLServerExecutionFactory trans = new SQLServerExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
@@ -60,7 +60,7 @@
return TranslationHelper.BQT_VDB;
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput) throws ConnectorException {
+ public void helpTestVisitor(String vdb, String input, String expectedOutput) throws TranslatorException {
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.language.LanguageFactory;
import org.teiid.language.Literal;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.SQLConversionVisitor;
@@ -48,7 +48,7 @@
private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.junit.Test;
import org.mockito.Mockito;
import org.teiid.language.Command;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
@@ -42,7 +42,7 @@
private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
- public static void setup() throws ConnectorException {
+ public static void setup() throws TranslatorException {
trans.start();
}
@@ -61,7 +61,7 @@
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), trans);
try {
tc.translateCommand(obj);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new RuntimeException(e);
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -74,7 +74,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
@@ -112,7 +112,7 @@
// ou=people,dc=company,dc=com?SUBTREE_SCOPE?RESTRICT
// TODO - change method for calling RESTRICT to also specify
// object class name (RESTRICT=inetOrgPerson)
- public LDAPSearchDetails translateSQLQueryToLDAPSearch(Select query) throws ConnectorException {
+ public LDAPSearchDetails translateSQLQueryToLDAPSearch(Select query) throws TranslatorException {
// Parse SELECT symbols.
// The columns will be translated into LDAP attributes of interest.
ArrayList attributeList = getAttributesFromSelectSymbols(query);
@@ -124,12 +124,12 @@
Iterator itr = fromList.listIterator();
if(!itr.hasNext()) {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.noTablesInFromError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
TableReference fItm = (TableReference)itr.next();
if(itr.hasNext()) {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.multiItemsInFromError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
String contextName = getContextNameFromFromItem(fItm);
int searchScope = getSearchScopeFromFromItem(fItm);
@@ -174,7 +174,7 @@
sd.printDetailsToLog();
} catch (NamingException nme) {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.searchDetailsLoggingError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return sd;
@@ -186,7 +186,7 @@
* @param orderBy the OrderBy clause
* @param the array of SortKeys
*/
- private SortKey[] getSortKeysFromOrderByClause(OrderBy orderBy) throws ConnectorException {
+ private SortKey[] getSortKeysFromOrderByClause(OrderBy orderBy) throws TranslatorException {
SortKey[] sortKeys = null;
if(orderBy != null) {
List orderItems = orderBy.getSortSpecifications();
@@ -227,7 +227,7 @@
*/
// GHH 20080409 - changed to fall back on new connector property
// for default base DN if available
- private String getContextNameFromFromItem(TableReference fromItem) throws ConnectorException {
+ private String getContextNameFromFromItem(TableReference fromItem) throws TranslatorException {
String nameInSource;
String contextName;
@@ -251,14 +251,14 @@
}
} else {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// if the context name is not specified either in Name in Source
// or in the default connector properties it'll be either
// null or an empty string
if(contextName == null || contextName.equals("")) { //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.baseContextNameError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return contextName;
@@ -268,7 +268,7 @@
// from item's NameInSource, and if true return name (not NameInSource)
// of from item as the objectClass name on to which the query should
// be restricted
- private String getRestrictToNamedClass(TableReference fromItem) throws ConnectorException {
+ private String getRestrictToNamedClass(TableReference fromItem) throws TranslatorException {
String nameInSource;
String namedClass = null;
if(fromItem instanceof NamedTable) {
@@ -300,12 +300,12 @@
}
} else {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return namedClass;
}
- private int getSearchScopeFromFromItem(TableReference fromItem) throws ConnectorException {
+ private int getSearchScopeFromFromItem(TableReference fromItem) throws TranslatorException {
String searchScopeString = ""; //$NON-NLS-1$
int searchScope = LDAPConnectorConstants.ldapDefaultSearchScope;
// TODO: Re-use the getExpressionString method if possible, rather than
@@ -341,7 +341,7 @@
}
} else {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.groupCountExceededError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return searchScope;
}
@@ -351,7 +351,7 @@
* @param op operator to evaluate
* @return LDAP-specific string equivalent of the operator
*/
- private String parseCompoundCriteriaOp(AndOr.Operator op) throws ConnectorException {
+ private String parseCompoundCriteriaOp(AndOr.Operator op) throws TranslatorException {
switch(op) {
case AND:
return "&"; //$NON-NLS-1$
@@ -359,7 +359,7 @@
return "|"; //$NON-NLS-1$
default:
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.criteriaNotParsableError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -371,7 +371,7 @@
// GHH 20080326 - found that code to fall back on Name if NameInSource
// was null wasn't working properly, so replaced with tried and true
// code from another custom connector.
- private String getExpressionString(Expression e) throws ConnectorException {
+ private String getExpressionString(Expression e) throws TranslatorException {
String expressionName = null;
// GHH 20080326 - changed around the IElement handling here
// - the rest of this method is unchanged
@@ -397,7 +397,7 @@
}
} catch (ClassNotFoundException cce) {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.timestampClassNotFoundError"); //$NON-NLS-1$
- throw new ConnectorException(cce, msg);
+ throw new TranslatorException(cce, msg);
}
} else {
@@ -411,7 +411,7 @@
LogManager.logError(LogConstants.CTX_CONNECTOR, "Received ISearchedCaseExpression, but it is not supported. Check capabilties."); //$NON-NLS-1$
}
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.unsupportedElementError"); //$NON-NLS-1$
- throw new ConnectorException(msg + e.toString());
+ throw new TranslatorException(msg + e.toString());
}
expressionName = escapeReservedChars(expressionName);
return expressionName;
@@ -452,7 +452,7 @@
* @param List list to hold each pre-fix character of the search filter.
* @return list list that can be traversed in order to construct the search filter.
*/
- private List<String> getSearchFilterFromWhereClause(Condition criteria, List<String> filterList) throws ConnectorException {
+ private List<String> getSearchFilterFromWhereClause(Condition criteria, List<String> filterList) throws TranslatorException {
if(criteria == null) {
filterList.add("(objectClass=*)"); //$NON-NLS-1$
}
@@ -483,7 +483,7 @@
String rhsString = getExpressionString(rhs);
if(lhsString == null || rhsString == null) {
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.missingNISError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
addCompareCriteriaToList(filterList, op, lhsString, rhsString);
@@ -532,7 +532,7 @@
* Process a list of right-hand side IN expresssions and add the corresponding LDAP filter
* clause string to the given filterList.
*/
- private void processInCriteriaList(List filterList, List rhsList, Expression lhs) throws ConnectorException {
+ private void processInCriteriaList(List filterList, List rhsList, Expression lhs) throws TranslatorException {
if(rhsList.size() == 0) {
return;
}
@@ -553,7 +553,7 @@
* @param lhs left hand side expression
* @param rhs right hand side expression
*/
- private void addCompareCriteriaToList(List filterList, Comparison.Operator op, String lhs, String rhs) throws ConnectorException {
+ private void addCompareCriteriaToList(List filterList, Comparison.Operator op, String lhs, String rhs) throws TranslatorException {
// Push the comparison statement into the list, e.g.:
// (sn=Mike)
// !(empNum>=100)
@@ -575,7 +575,7 @@
break;
default:
final String msg = LDAPPlugin.Util.getString("IQueryToLdapSearchParser.criteriaNotSupportedError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
filterList.add(rhs);
@@ -590,7 +590,7 @@
// GHH 20080326 - found that code to fall back on Name if NameInSource
// was null wasn't working properly, so replaced with tried and true
// code from another custom connector.
- public String getNameFromElement(Column e) throws ConnectorException {
+ public String getNameFromElement(Column e) throws TranslatorException {
String ldapAttributeName = null;
ldapAttributeName = e.getNameInSource();
if (ldapAttributeName == null || ldapAttributeName.equals("")) { //$NON-NLS-1$
@@ -605,7 +605,7 @@
* @param query the supplied Query
* @return the list of SELECT elements
*/
- private ArrayList getElementsFromSelectSymbols(Select query) throws ConnectorException {
+ private ArrayList getElementsFromSelectSymbols(Select query) throws TranslatorException {
ArrayList selectElementList = new ArrayList();
Iterator selectSymbolItr = query.getDerivedColumns().iterator();
@@ -621,7 +621,7 @@
* @param query the supplied Query
* @return the list of attributes
*/
- private ArrayList getAttributesFromSelectSymbols(Select query) throws ConnectorException {
+ private ArrayList getAttributesFromSelectSymbols(Select query) throws TranslatorException {
ArrayList ldapAttributeList = new ArrayList();
Iterator selectSymbolItr = query.getDerivedColumns().iterator();
@@ -645,7 +645,7 @@
* @param symbol Input ISelectSymbol
* @return Element returned metadata runtime Element
*/
- private Column getElementFromSymbol(DerivedColumn symbol) throws ConnectorException {
+ private Column getElementFromSymbol(DerivedColumn symbol) throws TranslatorException {
ColumnReference expr = (ColumnReference) symbol.getExpression();
return expr.getMetadataObject();
}
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 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -29,7 +29,7 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
@@ -77,23 +77,23 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
return new LDAPSyncQueryExecution((Select)command, this, (LdapContext)cf.getConnection());
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
public UpdateExecution createUpdateExecution(Command command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
return new LDAPUpdateExecution(command, (LdapContext)cf.getConnection());
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -97,7 +97,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ResultSetExecution;
@@ -136,7 +136,7 @@
* @param maxBatchSize the max batch size.
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Parse the IQuery, and translate it into an appropriate LDAP search.
this.parser = new IQueryToLdapSearchParser(this.executionFactory);
searchDetails = parser.translateSQLQueryToLDAPSearch(query);
@@ -152,7 +152,7 @@
/**
* Set the standard request controls
*/
- private void setStandardRequestControls() throws ConnectorException {
+ private void setStandardRequestControls() throws TranslatorException {
Control[] sortCtrl = new Control[1];
SortKey[] keys = searchDetails.getSortKeys();
if (keys != null) {
@@ -163,10 +163,10 @@
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError") + //$NON-NLS-1$
" : "+ne.getExplanation(); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
} catch(IOException e) {
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError"); //$NON-NLS-1$
- throw new ConnectorException(e,msg);
+ throw new TranslatorException(e,msg);
}
}
}
@@ -176,7 +176,7 @@
* sets the context to something appropriate for the search that is about to occur.
*
*/
- private void createSearchContext() throws ConnectorException {
+ private void createSearchContext() throws TranslatorException {
try {
ldapCtx = (LdapContext) this.ldapConnection.lookup(searchDetails.getContextName());
} catch (NamingException ne) {
@@ -185,7 +185,7 @@
+ searchDetails.getContextName());
}
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.createContextError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -193,7 +193,7 @@
/**
* Set the search controls
*/
- private SearchControls setSearchControls() throws ConnectorException {
+ private SearchControls setSearchControls() throws TranslatorException {
SearchControls ctrls = new SearchControls();
//ArrayList modelAttrList = searchDetails.getAttributeList();
ArrayList modelAttrList = searchDetails.getElementList();
@@ -221,7 +221,7 @@
* Perform the LDAP search against the subcontext, using the filter and
* search controls appropriate to the query and model metadata.
*/
- private void executeSearch(SearchControls ctrls) throws ConnectorException {
+ private void executeSearch(SearchControls ctrls) throws TranslatorException {
String ctxName = searchDetails.getContextName();
String filter = searchDetails.getContextFilter();
if (ctxName == null || filter == null || ctrls == null) {
@@ -233,12 +233,12 @@
LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to search context " //$NON-NLS-1$
+ ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError"); //$NON-NLS-1$
- throw new ConnectorException(msg + " : " + ne.getExplanation()); //$NON-NLS-1$
+ throw new TranslatorException(msg + " : " + ne.getExplanation()); //$NON-NLS-1$
} catch(Exception e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to search context " //$NON-NLS-1$
+ ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError"); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -248,7 +248,7 @@
// but less so when closing context, since it is safe to call close
// on contexts multiple times
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
close();
}
@@ -259,7 +259,7 @@
// but less so when closing context, since it is safe to call close
// on contexts multiple times
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
if (searchEnumeration != null) {
try {
searchEnumeration.close();
@@ -286,7 +286,7 @@
// it from being used again.
// GHH 20080326 - also added return of explanation for generic
// NamingException
- public List next() throws ConnectorException {
+ public List next() throws TranslatorException {
try {
// The search has been executed, so process up to one batch of
// results.
@@ -306,7 +306,7 @@
final String msg = "Ldap error while processing next batch of results: " + ne.getExplanation(); //$NON-NLS-1$
LogManager.logError(LogConstants.CTX_CONNECTOR, msg); // GHH 20080326 - changed to output explanation from LDAP server
searchEnumeration = null; // GHH 20080326 - NamingEnumertion's are no longer good after an exception so toss it
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@@ -317,7 +317,7 @@
*/
// GHH 20080326 - added fetching of DN of result, for directories that
// do not include it as an attribute
- private List getRow(SearchResult result) throws ConnectorException {
+ private List getRow(SearchResult result) throws TranslatorException {
Attributes attrs = result.getAttributes();
String resultDN = result.getNameInNamespace(); // added GHH 20080326
ArrayList attributeList = searchDetails.getElementList();
@@ -345,14 +345,14 @@
// value for that column in the result
// GHH 20080326 - added handling of ClassCastException when non-string
// attribute is returned
- private void addResultToRow(Column modelElement, String resultDistinguishedName, Attributes attrs, List row) throws ConnectorException {
+ private void addResultToRow(Column modelElement, String resultDistinguishedName, Attributes attrs, List row) throws TranslatorException {
String strResult;
String modelAttrName = parser.getNameFromElement(modelElement);
Class modelAttrClass = modelElement.getJavaType();
if(modelAttrName == null) {
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.nullAttrError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Attribute resultAttr = attrs.get(modelAttrName);
@@ -386,7 +386,7 @@
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.attrValueFetchError",modelAttrName); //$NON-NLS-1$
LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg+" : "+ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg+" : "+ne.getExplanation()); //$NON-NLS-1$
+ throw new TranslatorException(msg+" : "+ne.getExplanation()); //$NON-NLS-1$
}
// GHH 20080326 - if attribute is not a string, just
@@ -419,7 +419,7 @@
row.add(null);
}
} catch(NumberFormatException nfe) {
- throw new ConnectorException(nfe, "Element " + modelAttrName + " is typed as Integer, " + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException(nfe, "Element " + modelAttrName + " is typed as Integer, " + //$NON-NLS-1$ //$NON-NLS-2$
"but it's value (" + strResult + ") cannot be converted from string " + //$NON-NLS-1$ //$NON-NLS-2$
"to Integer. Please change type to String, or modify the data."); //$NON-NLS-1$
}
@@ -446,7 +446,7 @@
row.add(null);
}
} catch(ParseException pe) {
- throw new ConnectorException(pe, "Timestamp could not be parsed. Please check to ensure the " //$NON-NLS-1$
+ throw new TranslatorException(pe, "Timestamp could not be parsed. Please check to ensure the " //$NON-NLS-1$
+ " Format field for attribute " //$NON-NLS-1$
+ modelAttrName + " is configured using SimpleDateFormat conventions."); //$NON-NLS-1$
}
@@ -455,13 +455,13 @@
// Specifically, add support for byte arrays, since that's actually supported
// in the underlying data source.
} else {
- throw new ConnectorException("Base type " + modelAttrClass.toString() //$NON-NLS-1$
+ throw new TranslatorException("Base type " + modelAttrClass.toString() //$NON-NLS-1$
+ " is not supported in the LDAP connector. " //$NON-NLS-1$
+ " Please modify the base model to use a supported type."); //$NON-NLS-1$
}
} catch(ClassNotFoundException cne) {
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.supportedClassNotFoundError"); //$NON-NLS-1$
- throw new ConnectorException(cne, msg);
+ throw new TranslatorException(cne, msg);
}
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.UpdateExecution;
@@ -93,7 +93,7 @@
* here for the sake of efficiency.
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// first make a copy of the initial LDAP context we got from
// the connection. The actual update-class operation will use
// this copy. This will enable the close and cancel methods
@@ -104,7 +104,7 @@
ldapCtx = (LdapContext)this.ldapConnection.lookup(""); //$NON-NLS-1$
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.createContextError",ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (command instanceof Update) {
@@ -118,13 +118,13 @@
}
else {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.incorrectCommandError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {1};
}
@@ -154,7 +154,7 @@
// TODO - maybe automatically specify objectClass based off of
// Name/NameInSource RESTRICT property settings, like with read support
private void executeInsert()
- throws ConnectorException {
+ throws TranslatorException {
List<ColumnReference> insertElementList = ((Insert)command).getColumns();
List<Expression> insertValueList = ((ExpressionValueSource)((Insert)command).getValueSource()).getValues();
@@ -181,11 +181,11 @@
insertValue = ((Literal)insertValueList.get(i)).getValue();
if (insertValue == null) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNNullError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (!(insertValue instanceof java.lang.String)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.columnSourceNameDNTypeError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
distinguishedName = (String)insertValue;
}
@@ -202,7 +202,7 @@
// the LDAP add operation, so throw an exception
if (distinguishedName == null) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.noInsertSourceNameDNError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// just try to create a new LDAP entry using the DN and
// attributes specified in the INSERT operation. If it isn't
@@ -212,10 +212,10 @@
ldapCtx.createSubcontext(distinguishedName, insertAttrs);
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.insertFailed",distinguishedName,ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
} catch (Exception e) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.insertFailedUnexpected",distinguishedName); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -230,7 +230,7 @@
// even if the named entry doesn't exist (as long as its parent does
// exist).
private void executeDelete()
- throws ConnectorException {
+ throws TranslatorException {
Condition criteria = ((Delete)command).getWhere();
@@ -249,12 +249,12 @@
ldapCtx.destroySubcontext(distinguishedName);
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.deleteFailed",distinguishedName,ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
// don't remember why I added this generic catch of Exception,
// but it does no harm...
} catch (Exception e) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.deleteFailedUnexpected",distinguishedName); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -274,7 +274,7 @@
// The update criteria must include only an equals comparison
// on the "DN" column ("WHERE DN='cn=John Doe,ou=people,dc=company,dc=com'")
private void executeUpdate()
- throws ConnectorException {
+ throws TranslatorException {
List<SetClause> updateList = ((Update)command).getChanges();
Condition criteria = ((Update)command).getWhere();
@@ -314,7 +314,7 @@
rightExpr = setClause.getValue();
if (!(rightExpr instanceof Literal)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.valueNotLiteralError",nameLeftElement); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
valueRightExpr = ((Literal)rightExpr).getValue();
// add in the modification as a replacement - meaning
@@ -335,12 +335,12 @@
ldapCtx.modifyAttributes(distinguishedName, updateMods);
} catch (NamingException ne) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailed",distinguishedName,ne.getExplanation()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
// don't remember why I added this generic catch of Exception,
// but it does no harm...
} catch (Exception e) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailedUnexpected",distinguishedName); //$NON-NLS-1$
- throw new ConnectorException(e, msg);
+ throw new TranslatorException(e, msg);
}
}
@@ -352,40 +352,40 @@
// since there is no way to specify this granularity of criteria
// right now in the connector capabilities
private String getDNFromCriteria(Condition criteria)
- throws ConnectorException {
+ throws TranslatorException {
if (criteria == null) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaEmptyError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
if (!(criteria instanceof Comparison)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaNotSimpleError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Comparison compareCriteria = (Comparison)criteria;
if (compareCriteria.getOperator() != Operator.EQ) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaNotEqualsError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Expression leftExpr = compareCriteria.getLeftExpression();
if (!(leftExpr instanceof ColumnReference)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaLHSNotElementError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
// call utility method to get NameInSource/Name for element
String nameLeftExpr = getNameFromElement((ColumnReference)leftExpr);
if (!(nameLeftExpr.toUpperCase().equals("DN"))) { //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaSrcColumnError",nameLeftExpr); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Expression rightExpr = compareCriteria.getRightExpression();
if (!(rightExpr instanceof Literal)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaRHSNotLiteralError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
Object valueRightExpr = ((Literal)rightExpr).getValue();
if (!(valueRightExpr instanceof java.lang.String)) {
final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.criteriaRHSNotStringError"); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
return (String)valueRightExpr;
}
@@ -416,7 +416,7 @@
// calling close on already closed context is safe per
// javax.naming.Context javadoc so we won't worry about this also
// happening in our close method
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
close();
}
@@ -425,7 +425,7 @@
// calling close on already closed context is safe per
// javax.naming.Context javadoc so we won't worry about this also
// happening in our close method
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
try {
if(ldapCtx != null) {
ldapCtx.close();
Modified: trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
===================================================================
--- trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -48,7 +48,7 @@
import org.teiid.metadata.Column.SearchType;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ldap.IQueryToLdapSearchParser;
import org.teiid.translator.ldap.LDAPExecutionFactory;
import org.teiid.translator.ldap.LDAPSearchDetails;
@@ -254,7 +254,7 @@
expectedCountLimit, expectedSearchScope, expectedSortKeys);
}
- private LDAPSearchDetails helpGetSearchDetails(String queryString) throws ConnectorException {
+ private LDAPSearchDetails helpGetSearchDetails(String queryString) throws TranslatorException {
QueryMetadataInterface metadata = exampleLdap();
RuntimeMetadata rm = new RuntimeMetadataImpl(metadata);
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -40,7 +40,7 @@
import org.teiid.language.Argument.Direction;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.TypeFacility;
@@ -71,7 +71,7 @@
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
// Wait on first batch if necessary
if(this.config.getWaitTime() > 0 && !waited) {
// Wait a random amount of time up to waitTime milliseconds
@@ -102,13 +102,13 @@
* @see com.metamatrix.data.SynchQueryExecution#execute(com.metamatrix.data.language.IQuery, int)
*/
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
// Log our command
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Loopback executing command: " + command); //$NON-NLS-1$
if(this.config.isThrowError()) {
- throw new ConnectorException("Failing because Error=true"); //$NON-NLS-1$
+ throw new TranslatorException("Failing because Error=true"); //$NON-NLS-1$
}
this.rowsNeeded = this.config.getRowCount();
@@ -127,12 +127,12 @@
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int [] {0};
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
Call proc = (Call)this.command;
int count = proc.getReturnType() != null ? 1:0;
for (Argument param : proc.getArguments()) {
@@ -147,7 +147,7 @@
* @see com.metamatrix.data.Execution#close()
*/
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
// nothing to do
}
@@ -155,7 +155,7 @@
* @see com.metamatrix.data.Execution#cancel()
*/
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.teiid.language.Command;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
@@ -80,13 +80,13 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
}
@Override
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionfactory)
- throws ConnectorException {
+ throws TranslatorException {
return new LoopbackExecution(command, this);
}
Modified: trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java
===================================================================
--- trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-loopback/src/test/java/org/teiid/translator/loopback/TestLoopbackExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import junit.framework.TestCase;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.loopback.LoopbackExecution;
import org.teiid.translator.loopback.LoopbackExecutionFactory;
@@ -49,11 +49,11 @@
return config;
}
- public void helpTestQuery(String sql, TranslationUtility metadata, Object[][] expectedResults) throws ConnectorException {
+ public void helpTestQuery(String sql, TranslationUtility metadata, Object[][] expectedResults) throws TranslatorException {
helpTestQuery(sql, metadata, 0, 1, expectedResults);
}
- public void helpTestQuery(String sql, TranslationUtility metadata, int waitTime, int rowCount, Object[][] expectedResults) throws ConnectorException {
+ public void helpTestQuery(String sql, TranslationUtility metadata, int waitTime, int rowCount, Object[][] expectedResults) throws TranslatorException {
ConnectorHost host = new ConnectorHost(exampleProperties(waitTime, rowCount), null, metadata);
List actualResults = host.executeCommand(sql);
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -6,6 +6,8 @@
import java.util.List;
import java.util.Map;
+import javax.resource.ResourceException;
+
import org.teiid.core.types.DataTypeManager;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
@@ -15,7 +17,7 @@
import org.teiid.metadata.Table;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import com.sforce.soap.partner.ChildRelationship;
import com.sforce.soap.partner.DescribeGlobalResult;
@@ -64,16 +66,20 @@
this.connectorEnv = env;
}
- public void processMetadata() throws ConnectorException {
- DescribeGlobalResult globalResult = connection.getObjects();
- List<DescribeGlobalSObjectResult> objects = globalResult.getSobjects();
- for (DescribeGlobalSObjectResult object : objects) {
- addTable(object);
- }
- addRelationships();
+ public void processMetadata() throws TranslatorException {
+ try {
+ DescribeGlobalResult globalResult = connection.getObjects();
+ List<DescribeGlobalSObjectResult> objects = globalResult.getSobjects();
+ for (DescribeGlobalSObjectResult object : objects) {
+ addTable(object);
+ }
+ addRelationships();
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
- private void addRelationships() throws ConnectorException {
+ private void addRelationships() throws TranslatorException {
for (Iterator<Relationship> iterator = relationships.iterator(); iterator.hasNext();) {
Relationship relationship = iterator.next();
if (!this.connectorEnv.isModelAuditFields() && isAuditField(relationship.getForeignKeyField())) {
@@ -125,8 +131,14 @@
return result;
}
- private void addTable(DescribeGlobalSObjectResult object) throws ConnectorException {
- DescribeSObjectResult objectMetadata = connection.getObjectMetaData(object.getName());
+ private void addTable(DescribeGlobalSObjectResult object) throws TranslatorException {
+ DescribeSObjectResult objectMetadata = null;
+ try {
+ objectMetadata = connection.getObjectMetaData(object.getName());
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
+
String name = NameUtil.normalizeName(objectMetadata.getName());
Table table = metadataFactory.addTable(name);
@@ -166,7 +178,7 @@
}
}
- private void addColumns(DescribeSObjectResult objectMetadata, Table table) throws ConnectorException {
+ private void addColumns(DescribeSObjectResult objectMetadata, Table table) throws TranslatorException {
List<Field> fields = objectMetadata.getFields();
for (Field field : fields) {
String normalizedName = NameUtil.normalizeName(field.getName());
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 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -32,7 +32,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -70,7 +70,7 @@
}
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
super.start();
LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Started"); //$NON-NLS-1$
}
@@ -78,12 +78,12 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new QueryExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
}
@Override
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws TranslatorException {
UpdateExecution result = null;
if(command instanceof org.teiid.language.Delete) {
result = new DeleteExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
@@ -98,11 +98,11 @@
@Override
public ProcedureExecution createProcedureExecution(Call command,ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
return new ProcedureExecutionParentImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
MetadataProcessor processor = new MetadataProcessor((SalesforceConnection)connectionFactory,metadataFactory, this);
processor.processMetadata();
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceConnection.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -23,9 +23,9 @@
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.XMLGregorianCalendar;
-import org.teiid.translator.ConnectorException;
import org.teiid.translator.salesforce.execution.DataPayload;
import org.teiid.translator.salesforce.execution.DeletedResult;
import org.teiid.translator.salesforce.execution.UpdatedResult;
@@ -36,25 +36,25 @@
public interface SalesforceConnection {
- public QueryResult query(String queryString, int maxBatchSize, Boolean queryAll) throws ConnectorException;
+ public QueryResult query(String queryString, int maxBatchSize, Boolean queryAll) throws ResourceException;
- public QueryResult queryMore(String queryLocator, int batchSize) throws ConnectorException;
+ public QueryResult queryMore(String queryLocator, int batchSize) throws ResourceException;
public boolean isAlive();
- public int delete(String[] ids) throws ConnectorException ;
+ public int delete(String[] ids) throws ResourceException ;
- public int create(DataPayload data) throws ConnectorException;
+ public int create(DataPayload data) throws ResourceException;
- public int update(List<DataPayload> updateDataList) throws ConnectorException;
+ public int update(List<DataPayload> updateDataList) throws ResourceException;
- public UpdatedResult getUpdated(String objectName, XMLGregorianCalendar startCalendar, XMLGregorianCalendar endCalendar) throws ConnectorException;
+ public UpdatedResult getUpdated(String objectName, XMLGregorianCalendar startCalendar, XMLGregorianCalendar endCalendar) throws ResourceException;
- public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar, XMLGregorianCalendar endCalendar) throws ConnectorException;
+ public DeletedResult getDeleted(String objectName, XMLGregorianCalendar startCalendar, XMLGregorianCalendar endCalendar) throws ResourceException;
- public QueryResult retrieve(String fieldList, String sObjectType, List<String> ids) throws ConnectorException;
+ public QueryResult retrieve(String fieldList, String sObjectType, List<String> ids) throws ResourceException;
- public DescribeGlobalResult getObjects() throws ConnectorException;
+ public DescribeGlobalResult getObjects() throws ResourceException;
- public DescribeSObjectResult getObjectMetaData(String objectName) throws ConnectorException;
+ public DescribeSObjectResult getObjectMetaData(String objectName) throws ResourceException;
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class Util {
@@ -50,9 +50,9 @@
return result.toString();
}
- public static void validateQueryLength(StringBuffer query) throws ConnectorException {
+ public static void validateQueryLength(StringBuffer query) throws TranslatorException {
if(query.length() >= 10000) {
- throw new ConnectorException(Messages.getString("Util.query.exceeds.max.length"));
+ throw new TranslatorException(Messages.getString("Util.query.exceeds.max.length"));
}
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -23,11 +23,13 @@
import java.util.ArrayList;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Comparison;
import org.teiid.language.Condition;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.UpdateExecution;
@@ -63,16 +65,16 @@
}
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {result};
}
@@ -84,7 +86,7 @@
return connection;
}
- String[] getIDs(Condition criteria, IQueryProvidingVisitor visitor) throws ConnectorException {
+ String[] getIDs(Condition criteria, IQueryProvidingVisitor visitor) throws TranslatorException {
String[] Ids = null;
if (visitor.hasOnlyIDCriteria()) {
try {
@@ -97,16 +99,20 @@
}
} else if (visitor.hasCriteria()) {
- String query = visitor.getQuery();
- QueryResult results = getConnection().query(query, context.getBatchSize(), Boolean.FALSE);
- if (null != results && results.getSize() > 0) {
- ArrayList<String> idList = new ArrayList<String>(results
- .getRecords().size());
- for (int i = 0; i < results.getRecords().size(); i++) {
- SObject sObject = results.getRecords().get(i);
- idList.add(sObject.getId());
+ try {
+ String query = visitor.getQuery();
+ QueryResult results = getConnection().query(query, context.getBatchSize(), Boolean.FALSE);
+ if (null != results && results.getSize() > 0) {
+ ArrayList<String> idList = new ArrayList<String>(results
+ .getRecords().size());
+ for (int i = 0; i < results.getRecords().size(); i++) {
+ SObject sObject = results.getRecords().get(i);
+ idList.add(sObject.getId());
+ }
+ Ids = idList.toArray(new String[0]);
}
- Ids = idList.toArray(new String[0]);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
return Ids;
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/DeleteExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -21,10 +21,12 @@
*/
package org.teiid.translator.salesforce.execution;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Delete;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.visitors.DeleteVisitor;
@@ -40,12 +42,16 @@
}
@Override
- public void execute() throws ConnectorException {
- DeleteVisitor dVisitor = new DeleteVisitor(getMetadata());
- dVisitor.visitNode(command);
- String[] Ids = getIDs(((Delete)command).getWhere(), dVisitor);
- if(null != Ids && Ids.length > 0) {
- result = getConnection().delete(Ids);
+ public void execute() throws TranslatorException {
+ try {
+ DeleteVisitor dVisitor = new DeleteVisitor(getMetadata());
+ dVisitor.visitNode(command);
+ String[] Ids = getIDs(((Delete)command).getWhere(), dVisitor);
+ if(null != Ids && Ids.length > 0) {
+ result = getConnection().delete(Ids);
+ }
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -5,13 +5,14 @@
import java.util.GregorianCalendar;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.teiid.language.Argument;
import org.teiid.language.Call;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
*
@@ -37,12 +38,12 @@
DatatypeFactory factory;
public GetDeletedExecutionImpl(
- ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
this.parent = procedureExecutionParent;
try {
factory = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
- throw new ConnectorException(e.getMessage());
+ throw new TranslatorException(e.getMessage());
}
}
@@ -59,26 +60,30 @@
}
@Override
- public void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
- Call command = parent.getCommand();
- List<Argument> params = command.getArguments();
-
- Argument object = params.get(OBJECT);
- String objectName = (String) object.getArgumentValue().getValue();
-
- Argument start = params.get(STARTDATE);
- Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
- GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(startTime);
- XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- Argument end = params.get(ENDDATE);
- Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
- tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(endTime);
- XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- deletedResult = parent.getConnection().getDeleted(objectName, startCalendar, endCalendar);
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
+ try {
+ Call command = parent.getCommand();
+ List<Argument> params = command.getArguments();
+
+ Argument object = params.get(OBJECT);
+ String objectName = (String) object.getArgumentValue().getValue();
+
+ Argument start = params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
+ GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(startTime);
+ XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ Argument end = params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
+ tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(endTime);
+ XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ deletedResult = parent.getConnection().getDeleted(objectName, startCalendar, endCalendar);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
@SuppressWarnings("unchecked")
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -6,13 +6,14 @@
import java.util.GregorianCalendar;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.teiid.language.Argument;
import org.teiid.language.Call;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
*
@@ -35,12 +36,12 @@
DatatypeFactory factory;
public GetUpdatedExecutionImpl(
- ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
+ ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
this.parent = procedureExecutionParent;
try {
factory = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
- throw new ConnectorException(e.getMessage());
+ throw new TranslatorException(e.getMessage());
}
}
@@ -55,26 +56,30 @@
}
@Override
- public void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException {
- Call command = parent.getCommand();
- List<Argument> params = command.getArguments();
-
- Argument object = params.get(OBJECT);
- String objectName = (String) object.getArgumentValue().getValue();
-
- Argument start = params.get(STARTDATE);
- Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
- GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(startTime);
- XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- Argument end = params.get(ENDDATE);
- Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
- tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
- tempCalendar.setTime(endTime);
- XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
-
- updatedResult = parent.getConnection().getUpdated(objectName, startCalendar, endCalendar);
+ public void execute(ProcedureExecutionParent procedureExecutionParent) throws TranslatorException {
+ try {
+ Call command = parent.getCommand();
+ List<Argument> params = command.getArguments();
+
+ Argument object = params.get(OBJECT);
+ String objectName = (String) object.getArgumentValue().getValue();
+
+ Argument start = params.get(STARTDATE);
+ Timestamp startTime = (Timestamp) start.getArgumentValue().getValue();
+ GregorianCalendar tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(startTime);
+ XMLGregorianCalendar startCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ Argument end = params.get(ENDDATE);
+ Timestamp endTime = (Timestamp) end.getArgumentValue().getValue();
+ tempCalendar = (GregorianCalendar) GregorianCalendar.getInstance();
+ tempCalendar.setTime(endTime);
+ XMLGregorianCalendar endCalendar = factory.newXMLGregorianCalendar(tempCalendar);
+
+ updatedResult = parent.getConnection().getUpdated(objectName, startCalendar, endCalendar);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
@Override
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/InsertExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -22,10 +22,12 @@
package org.teiid.translator.salesforce.execution;
+import javax.resource.ResourceException;
+
import org.teiid.language.Command;
import org.teiid.language.Insert;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.visitors.InsertVisitor;
@@ -40,12 +42,16 @@
}
@Override
- public void execute() throws ConnectorException {
- InsertVisitor visitor = new InsertVisitor(getMetadata());
- visitor.visit((Insert)command);
- DataPayload data = new DataPayload();
- data.setType(visitor.getTableName());
- data.setMessageElements(visitor.getMessageElements());
- result = getConnection().create(data);
+ public void execute() throws TranslatorException {
+ try {
+ InsertVisitor visitor = new InsertVisitor(getMetadata());
+ visitor.visit((Insert)command);
+ DataPayload data = new DataPayload();
+ data.setType(visitor.getTableName());
+ data.setMessageElements(visitor.getMessageElements());
+ result = getConnection().create(data);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -4,7 +4,7 @@
import org.teiid.language.Call;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ProcedureExecution;
@@ -28,27 +28,27 @@
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
return execution.getOutputParameterValues();
}
@Override
- public List<?> next() throws ConnectorException, DataNotAvailableException {
+ public List<?> next() throws TranslatorException, DataNotAvailableException {
return execution.next();
}
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
execution.cancel();
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
execution.close();
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
if(getCommand().getProcedureName().endsWith("getUpdated")) {
execution = new GetUpdatedExecutionImpl(this);
execution.execute(this);
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
+import javax.resource.ResourceException;
import javax.xml.namespace.QName;
import org.teiid.language.AggregateFunction;
@@ -44,7 +45,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
@@ -102,43 +103,47 @@
partIdentifier = context.getPartIdentifier();
}
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
}
@Override
- public void execute() throws ConnectorException {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Incoming Query: " + query.toString()); //$NON-NLS-1$
- List<TableReference> from = ((Select)query).getFrom();
- String finalQuery;
- if(from.get(0) instanceof Join) {
- visitor = new JoinQueryVisitor(metadata);
- visitor.visitNode(query);
- finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing Query: " + finalQuery); //$NON-NLS-1$
-
- results = connection.query(finalQuery, this.context.getBatchSize(), visitor.getQueryAll());
- } else {
- visitor = new SelectVisitor(metadata);
- visitor.visitNode(query);
- if(visitor.canRetrieve()) {
- results = connection.retrieve(visitor.getRetrieveFieldList(),
- visitor.getTableName(), visitor.getIdInCriteria());
- } else {
+ public void execute() throws TranslatorException {
+ try {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Incoming Query: " + query.toString()); //$NON-NLS-1$
+ List<TableReference> from = ((Select)query).getFrom();
+ String finalQuery;
+ if(from.get(0) instanceof Join) {
+ visitor = new JoinQueryVisitor(metadata);
+ visitor.visitNode(query);
finalQuery = visitor.getQuery().trim();
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing Query: " + finalQuery); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing Query: " + finalQuery); //$NON-NLS-1$
+
results = connection.query(finalQuery, this.context.getBatchSize(), visitor.getQueryAll());
+ } else {
+ visitor = new SelectVisitor(metadata);
+ visitor.visitNode(query);
+ if(visitor.canRetrieve()) {
+ results = connection.retrieve(visitor.getRetrieveFieldList(),
+ visitor.getTableName(), visitor.getIdInCriteria());
+ } else {
+ finalQuery = visitor.getQuery().trim();
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, getLogPreamble() + "Executing Query: " + finalQuery); //$NON-NLS-1$
+ results = connection.query(finalQuery, this.context.getBatchSize(), visitor.getQueryAll());
+ }
}
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
@SuppressWarnings("unchecked")
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
List<?> result;
if (query.getProjectedQuery().getDerivedColumns().get(0)
.getExpression() instanceof AggregateFunction) {
@@ -151,7 +156,7 @@
return result;
}
- private List<Object> getRow(QueryResult result) throws ConnectorException {
+ private List<Object> getRow(QueryResult result) throws TranslatorException {
List<Object> row;
if(null == resultBatch) {
loadBatch();
@@ -171,22 +176,26 @@
return row;
}
- private void loadBatch() throws ConnectorException {
- if(null != resultBatch) { // if we have an old batch, then we have to get new results
- results = connection.queryMore(results.getQueryLocator(), context.getBatchSize());
- }
- resultBatch = new ArrayList<List<Object>>();
-
- for(int resultIndex = 0; resultIndex < results.getSize(); resultIndex++) {
- SObject sObject = results.getRecords().get(resultIndex);
- List<Object[]> result = getObjectData(sObject);
- for(Iterator<Object[]> i = result.iterator(); i.hasNext(); ) {
- resultBatch.add(Arrays.asList(i.next()));
+ private void loadBatch() throws TranslatorException {
+ try {
+ if(null != resultBatch) { // if we have an old batch, then we have to get new results
+ results = connection.queryMore(results.getQueryLocator(), context.getBatchSize());
}
+ resultBatch = new ArrayList<List<Object>>();
+
+ for(int resultIndex = 0; resultIndex < results.getSize(); resultIndex++) {
+ SObject sObject = results.getRecords().get(resultIndex);
+ List<Object[]> result = getObjectData(sObject);
+ for(Iterator<Object[]> i = result.iterator(); i.hasNext(); ) {
+ resultBatch.add(Arrays.asList(i.next()));
+ }
+ }
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
}
}
- private List<Object[]> getObjectData(SObject sObject) throws ConnectorException {
+ private List<Object[]> getObjectData(SObject sObject) throws TranslatorException {
List<Object> topFields = sObject.getAny();
logAndMapFields(sObject.getType(), topFields);
List<Object[]> result = new ArrayList<Object[]>();
@@ -212,7 +221,7 @@
}
private List<Object[]> extractDataFromFields(SObject sObject,
- List<Object> fields, List<Object[]> result) throws ConnectorException {
+ List<Object> fields, List<Object[]> result) throws TranslatorException {
Map<String,Integer> fieldToIndexMap = sObjectToResponseField.get(sObject.getType());
for (int j = 0; j < visitor.getSelectSymbolCount(); j++) {
Column element = visitor.getSelectSymbolMetadata(j);
@@ -225,7 +234,7 @@
if(parent instanceof Table) {
table = (Table)parent;
} else {
- throw new ConnectorException("Could not resolve Table for column " + element.getName()); //$NON-NLS-1$
+ throw new TranslatorException("Could not resolve Table for column " + element.getName()); //$NON-NLS-1$
}
}
if(table.getNameInSource().equals(sObject.getType())) {
@@ -236,7 +245,7 @@
if (element.getNameInSource().equalsIgnoreCase("id")) { //$NON-NLS-1$
setValueInColumn(j, sObject.getId(), result);
} else {
- throw new ConnectorException("SalesforceQueryExecutionImpl.missing.field"+ element.getNameInSource()); //$NON-NLS-1$
+ throw new TranslatorException("SalesforceQueryExecutionImpl.missing.field"+ element.getNameInSource()); //$NON-NLS-1$
}
} else {
Object cell;
@@ -263,10 +272,10 @@
/**
* Load the map of response field names to index.
* @param fields
- * @throws ConnectorException
+ * @throws TranslatorException
*/
private void logAndMapFields(String sObjectName,
- List<Object> fields) throws ConnectorException {
+ List<Object> fields) throws TranslatorException {
if (!sObjectToResponseField.containsKey(sObjectName)) {
logFields(sObjectName, fields);
Map<String, Integer> responseFieldToIndexMap;
@@ -279,7 +288,7 @@
}
}
- private void logFields(String sObjectName, List<Object> fields) throws ConnectorException {
+ private void logFields(String sObjectName, List<Object> fields) throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "SalesForce Object Name = " + sObjectName); //$NON-NLS-1$
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "FieldCount = " + fields.size()); //$NON-NLS-1$
for(int i = 0; i < fields.size(); i++) {
@@ -291,9 +300,9 @@
}
@SuppressWarnings("unchecked")
- private Object getCellDatum(Column element, Element elem) throws ConnectorException {
+ private Object getCellDatum(Column element, Element elem) throws TranslatorException {
if(!element.getNameInSource().equals(elem.getLocalName())) {
- throw new ConnectorException("SalesforceQueryExecutionImpl.column.mismatch1" + element.getNameInSource() + "SalesforceQueryExecutionImpl.column.mismatch2" + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException("SalesforceQueryExecutionImpl.column.mismatch1" + element.getNameInSource() + "SalesforceQueryExecutionImpl.column.mismatch2" + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
}
String value = elem.getTextContent();
Object result = null;
@@ -336,7 +345,7 @@
Date date = Util.getSalesforceDateTimeFormat().parse(value);
result = new Timestamp(date.getTime());
} catch (ParseException e) {
- throw new ConnectorException(e, "SalesforceQueryExecutionImpl.datatime.parse" + value); //$NON-NLS-1$
+ throw new TranslatorException(e, "SalesforceQueryExecutionImpl.datatime.parse" + value); //$NON-NLS-1$
}
}
} else {
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/SalesforceProcedureExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -2,7 +2,7 @@
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface SalesforceProcedureExecution {
@@ -19,6 +19,6 @@
void close();
- void execute(ProcedureExecutionParent procedureExecutionParent) throws ConnectorException;
+ void execute(ProcedureExecutionParent procedureExecutionParent) throws TranslatorException;
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/UpdateExecutionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.resource.ResourceException;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
@@ -34,7 +35,7 @@
import org.teiid.language.Update;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.Util;
@@ -54,7 +55,7 @@
@SuppressWarnings("unchecked")
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
UpdateVisitor visitor = new UpdateVisitor(getMetadata());
visitor.visit((Update)command);
String[] Ids = getIDs(((Update)command).getWhere(), visitor);
@@ -78,7 +79,11 @@
updateDataList.add(data);
}
- result = getConnection().update(updateDataList);
+ try {
+ result = getConnection().update(updateDataList);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
}
}
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -44,7 +44,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.Util;
@@ -75,7 +75,7 @@
protected List<String> criteriaList = new ArrayList<String>();
protected boolean hasCriteria;
protected Map<String, Column> columnElementsByName = new HashMap<String, Column>();
- protected List<ConnectorException> exceptions = new ArrayList<ConnectorException>();
+ protected List<TranslatorException> exceptions = new ArrayList<TranslatorException>();
protected Table table;
boolean onlyIDCriteria;
protected Boolean queryAll = Boolean.FALSE;
@@ -102,7 +102,7 @@
addCompareCriteria(criteriaList, criteria);
boolean isAcceptableID = (Operator.EQ == criteria.getOperator() && isIdColumn(criteria.getLeftExpression()));
setHasCriteria(true, isAcceptableID);
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@@ -111,15 +111,15 @@
public void visit( Like criteria ) {
try {
if (isIdColumn(criteria.getLeftExpression())) {
- ConnectorException e = new ConnectorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
+ TranslatorException e = new TranslatorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
exceptions.add(e);
}
if (isMultiSelectColumn(criteria.getLeftExpression())) {
- ConnectorException e = new ConnectorException(
+ TranslatorException e = new TranslatorException(
Messages.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect"));
exceptions.add(e);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
boolean negated = criteria.isNegated();
@@ -179,7 +179,7 @@
}
}
setHasCriteria(true, isIdColumn(criteria.getLeftExpression()));
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@@ -192,13 +192,13 @@
} else if (functionName.equalsIgnoreCase("excludes")) {
generateMultiSelect(func, EXCLUDES);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
private void generateMultiSelect( Function func,
- String funcName ) throws ConnectorException {
+ String funcName ) throws TranslatorException {
List<Expression> expressions = func.getParameters();
validateFunction(expressions);
Expression columnExpression = expressions.get(0);
@@ -210,7 +210,7 @@
}
private void appendMultiselectIn( Column column,
- In criteria ) throws ConnectorException {
+ In criteria ) throws TranslatorException {
StringBuffer result = new StringBuffer();
result.append(column.getNameInSource()).append(SPACE);
if (criteria.isNegated()) {
@@ -236,15 +236,15 @@
criteriaList.add(result.toString());
}
- private void validateFunction( List<Expression> expressions ) throws ConnectorException {
+ private void validateFunction( List<Expression> expressions ) throws TranslatorException {
if (expressions.size() != 2) {
- throw new ConnectorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
+ throw new TranslatorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
}
if (!(expressions.get(0) instanceof ColumnReference)) {
- throw new ConnectorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
+ throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
}
if (!(expressions.get(1) instanceof Literal)) {
- throw new ConnectorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
+ throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
}
}
@@ -267,7 +267,7 @@
}
protected void addCompareCriteria( List criteriaList,
- Comparison compCriteria ) throws ConnectorException {
+ Comparison compCriteria ) throws TranslatorException {
Expression lExpr = compCriteria.getLeftExpression();
if (lExpr instanceof Function) {
parseFunction((Function)lExpr);
@@ -319,7 +319,7 @@
}
}
- private void appendCriteria( In criteria ) throws ConnectorException {
+ private void appendCriteria( In criteria ) throws TranslatorException {
StringBuffer queryString = new StringBuffer();
Expression leftExp = criteria.getLeftExpression();
if(isIdColumn(leftExp)) {
@@ -347,7 +347,7 @@
criteriaList.add(queryString.toString());
}
- private boolean isTimeColumn( Column column ) throws ConnectorException {
+ private boolean isTimeColumn( Column column ) throws TranslatorException {
boolean result = false;
if (column.getJavaType().equals(java.sql.Timestamp.class) || column.getJavaType().equals(java.sql.Time.class)
|| column.getJavaType().equals(java.sql.Date.class)) {
@@ -356,7 +356,7 @@
return result;
}
- protected String getValue( Expression expr ) throws ConnectorException {
+ protected String getValue( Expression expr ) throws TranslatorException {
String result;
if (expr instanceof ColumnReference) {
ColumnReference element = (ColumnReference)expr;
@@ -371,11 +371,11 @@
return result;
}
- protected void loadColumnMetadata( NamedTable group ) throws ConnectorException {
+ protected void loadColumnMetadata( NamedTable group ) throws TranslatorException {
table = group.getMetadataObject();
String supportsQuery = table.getProperties().get("Supports Query");
if (!Boolean.valueOf(supportsQuery)) {
- throw new ConnectorException(table.getNameInSource() + " "
+ throw new TranslatorException(table.getNameInSource() + " "
+ Messages.getString("CriteriaVisitor.query.not.supported"));
}
List<Column> columnIds = table.getColumns();
@@ -393,7 +393,7 @@
}
}
- protected boolean isIdColumn( Expression expression ) throws ConnectorException {
+ protected boolean isIdColumn( Expression expression ) throws TranslatorException {
boolean result = false;
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
@@ -405,7 +405,7 @@
return result;
}
- protected boolean isMultiSelectColumn( Expression expression ) throws ConnectorException {
+ protected boolean isMultiSelectColumn( Expression expression ) throws TranslatorException {
boolean result = false;
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
@@ -439,7 +439,7 @@
return this.onlyIDCriteria;
}
- public String getTableName() throws ConnectorException {
+ public String getTableName() throws TranslatorException {
return table.getNameInSource();
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/DeleteVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -25,7 +25,7 @@
import org.teiid.language.Delete;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class DeleteVisitor extends CriteriaVisitor implements IQueryProvidingVisitor {
@@ -39,7 +39,7 @@
super.visit(delete);
try {
loadColumnMetadata(delete.getTable());
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -50,7 +50,7 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
throw exceptions.get(0);
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/ICriteriaVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -21,7 +21,7 @@
*/
package org.teiid.translator.salesforce.execution.visitors;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface ICriteriaVisitor {
@@ -31,6 +31,6 @@
public boolean hasOnlyIDCriteria();
- public String getTableName() throws ConnectorException;
+ public String getTableName() throws TranslatorException;
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/IQueryProvidingVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -21,10 +21,10 @@
*/
package org.teiid.translator.salesforce.execution.visitors;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public interface IQueryProvidingVisitor extends ICriteriaVisitor {
- public String getQuery() throws ConnectorException;
+ public String getQuery() throws TranslatorException;
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/InsertVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Literal;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class InsertVisitor extends CriteriaVisitor {
@@ -57,7 +57,7 @@
List<ColumnReference> columns = insert.getColumns();
List<Expression> values = ((ExpressionValueSource)insert.getValueSource()).getValues();
if(columns.size() != values.size()) {
- throw new ConnectorException("Error: columns.size and values.size are not the same.");
+ throw new TranslatorException("Error: columns.size and values.size are not the same.");
}
for(int i = 0; i < columns.size(); i++) {
@@ -80,7 +80,7 @@
elements.add(jbe);
}
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/JoinQueryVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -11,7 +11,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Util;
@@ -55,7 +55,7 @@
loadColumnMetadata((NamedTable) right);
}
super.visit(join);
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
@@ -94,13 +94,13 @@
} else {
super.visit(criteria);
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptions.add(e);
}
}
@Override
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (isParentToChildJoin()) {
return super.getQuery();
@@ -133,7 +133,7 @@
return childTable.equals(leftTableInJoin);
}
- protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws ConnectorException {
+ protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws TranslatorException {
boolean firstTime = true;
for (DerivedColumn symbol : selectSymbols) {
Expression expression = symbol.getExpression();
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Constants;
import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.Util;
@@ -61,7 +61,7 @@
public void visit(Select query) {
super.visit(query);
if (query.isDistinct()) {
- exceptions.add(new ConnectorException(
+ exceptions.add(new TranslatorException(
Messages.getString("SelectVisitor.distinct.not.supported")));
}
selectSymbols = query.getDerivedColumns();
@@ -78,7 +78,7 @@
selectSymbolNameToIndex .put(element.getNameInSource(), index);
String nameInSource = element.getNameInSource();
if (null == nameInSource || nameInSource.length() == 0) {
- exceptions.add(new ConnectorException(
+ exceptions.add(new TranslatorException(
"name in source is null or empty for column "
+ symbol.toString()));
continue;
@@ -98,11 +98,11 @@
String supportsQuery = table.getProperties().get(Constants.SUPPORTS_QUERY);
objectSupportsRetrieve = Boolean.valueOf(table.getProperties().get(Constants.SUPPORTS_RETRIEVE));
if (!Boolean.valueOf(supportsQuery)) {
- throw new ConnectorException(table.getNameInSource() + " "
+ throw new TranslatorException(table.getNameInSource() + " "
+ Messages.getString("CriteriaVisitor.query.not.supported"));
}
loadColumnMetadata(obj);
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -119,9 +119,9 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
- throw ((ConnectorException) exceptions.get(0));
+ throw ((TranslatorException) exceptions.get(0));
}
StringBuffer result = new StringBuffer();
result.append(SELECT).append(SPACE);
@@ -136,7 +136,7 @@
return result.toString();
}
- protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws ConnectorException {
+ protected void addSelectSymbols(String tableNameInSource, StringBuffer result) throws TranslatorException {
boolean firstTime = true;
for (DerivedColumn symbol : selectSymbols) {
if (!firstTime) {
@@ -156,7 +156,7 @@
if(parent instanceof Table) {
table = (Table)parent;
} else {
- throw new ConnectorException("Could not resolve Table for column " + element.getName());
+ throw new TranslatorException("Could not resolve Table for column " + element.getName());
}
}
result.append(table.getNameInSource());
@@ -200,7 +200,7 @@
}
- public String getRetrieveFieldList() throws ConnectorException {
+ public String getRetrieveFieldList() throws TranslatorException {
assertRetrieveValidated();
StringBuffer result = new StringBuffer();
addSelectSymbols(table.getNameInSource(), result);
@@ -208,7 +208,7 @@
}
- public List<String> getIdInCriteria() throws ConnectorException {
+ public List<String> getIdInCriteria() throws TranslatorException {
assertRetrieveValidated();
List<Expression> expressions = this.idInCriteria.getRightExpressions();
List<String> result = new ArrayList<String>(expressions.size());
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/UpdateVisitor.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -23,7 +23,7 @@
import org.teiid.language.Update;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class UpdateVisitor extends CriteriaVisitor implements IQueryProvidingVisitor {
@@ -39,7 +39,7 @@
visitNode(update.getWhere());
try {
loadColumnMetadata(update.getTable());
- } catch (ConnectorException ce) {
+ } catch (TranslatorException ce) {
exceptions.add(ce);
}
}
@@ -50,9 +50,9 @@
* LIMIT ?
*/
- public String getQuery() throws ConnectorException {
+ public String getQuery() throws TranslatorException {
if (!exceptions.isEmpty()) {
- throw ((ConnectorException) exceptions.get(0));
+ throw ((TranslatorException) exceptions.get(0));
}
StringBuffer result = new StringBuffer();
result.append(SELECT).append(SPACE);
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextConnectionImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -41,7 +41,7 @@
import org.teiid.core.util.StringUtil;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.FileConnection;
@@ -89,11 +89,11 @@
return metadataProps;
}
- private List<BufferedReader> createReaders(String tableName) throws ConnectorException {
+ private List<BufferedReader> createReaders(String tableName) throws TranslatorException {
try {
createReaders(this.metadataProps.get(tableName), tableName);
} catch (IOException e) {
- throw new ConnectorException(e, TextPlugin.Util.getString("TextSynchExecution.Unable_get_Reader", new Object[] {tableName, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextSynchExecution.Unable_get_Reader", new Object[] {tableName, e.getMessage() })); //$NON-NLS-1$
}
return readerQueue;
@@ -105,13 +105,13 @@
* @param props Group's metadata properites string
* @return BufferReader Object
*/
- private void createReaders(Properties props, String groupName) throws IOException, ConnectorException {
+ private void createReaders(Properties props, String groupName) throws IOException, TranslatorException {
if(readerQueue != null && readerQueue.size() > 0) {
return ;
}
if(props == null) {
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Error_obtain_properties_for_group", groupName)); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Error_obtain_properties_for_group", groupName)); //$NON-NLS-1$
}
String location = props.getProperty(TextDescriptorPropertyNames.LOCATION);
@@ -136,7 +136,7 @@
// get the stream from the connection
addReader(location, urlConn.getInputStream());
} catch (MalformedURLException e) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnection.fileDoesNotExistForGroup", new Object[] {location, groupName})); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnection.fileDoesNotExistForGroup", new Object[] {location, groupName})); //$NON-NLS-1$
}
}
@@ -162,9 +162,9 @@
* row HEADER_ROW is used as the row that may contain column
* names.
*
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private String nextLine(String tableName) throws ConnectorException {
+ private String nextLine(String tableName) throws TranslatorException {
if (currentreader == null && readerQueueIndex < readerQueue.size()) {
// reader queue index is advanced only by the nextReader()
// method. Don't do it here.
@@ -227,7 +227,7 @@
else {
Object[] params = new Object[] { line };
String msg = TextPlugin.Util.getString("TextSynchExecution.Text_has_no_determined_ending_qualifier", params); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
}
@@ -250,7 +250,7 @@
return line;
}
} catch (Throwable e) {
- throw new ConnectorException(e, TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new Object[] { location, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new Object[] { location, e.getMessage() })); //$NON-NLS-1$
}
// we are done reading..
return null;
@@ -265,7 +265,7 @@
readerQueueIndex++;
}
- public String getHeaderLine(String tableName) throws ConnectorException {
+ public String getHeaderLine(String tableName) throws TranslatorException {
if (this.headerMsg != null) {
return this.headerMsg;
}
@@ -274,7 +274,7 @@
return this.headerMsg;
}
- public String getNextLine(String tableName) throws ConnectorException {
+ public String getNextLine(String tableName) throws TranslatorException {
// make sure the reader are created
createReaders(tableName);
if (this.firstLine != null) {
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -45,7 +45,7 @@
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.FileConnection;
@@ -68,7 +68,7 @@
private String encoding = Charset.defaultCharset().name();
@Override
- public void start() throws ConnectorException {
+ public void start() throws TranslatorException {
initMetaDataProps();
}
@@ -119,18 +119,18 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
- throws ConnectorException {
+ throws TranslatorException {
try {
ConnectionFactory cf = (ConnectionFactory)connectionFactory;
TextConnectionImpl textConn = new TextConnectionImpl(this.metadataProps, (FileConnection)cf.getConnection(), encoding);
return new TextSynchExecution(this, (Select)command, textConn);
} catch (ResourceException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@Override
- public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws ConnectorException {
+ public void getConnectorMetadata(MetadataFactory metadataFactory, Object connectionFactory) throws TranslatorException {
for (Map.Entry<String, Properties> entry : metadataProps.entrySet()) {
Properties p = entry.getValue();
String columns = p.getProperty(TextDescriptorPropertyNames.COLUMNS);
@@ -143,7 +143,7 @@
if (types != null) {
typeNames = types.trim().split(","); //$NON-NLS-1$
if (typeNames.length != columnNames.length) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnector.column_mismatch", entry.getKey())); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnector.column_mismatch", entry.getKey())); //$NON-NLS-1$
}
}
Table table = metadataFactory.addTable(entry.getKey().substring(entry.getKey().indexOf('.') + 1));
@@ -156,10 +156,10 @@
}
}
- private void initMetaDataProps() throws ConnectorException {
+ private void initMetaDataProps() throws TranslatorException {
// Verify required items
if (descriptorFile == null || descriptorFile.trim().length() == 0) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_name_is_not_specified._2")); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_name_is_not_specified._2")); //$NON-NLS-1$
}
BufferedReader br = null;
try {
@@ -185,7 +185,7 @@
}
} catch (IOException e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, TextPlugin.Util.getString("TextConnection.Error_while_reading_text_file__{0}_1", new Object[] {e.getMessage()})); //$NON-NLS-1$
- throw new ConnectorException(e, TextPlugin.Util.getString("TextConnection.Error_trying_to_establish_connection_5")); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextConnection.Error_trying_to_establish_connection_5")); //$NON-NLS-1$
} finally {
if (br != null) {
try {br.close();} catch (Exception ee) {}
@@ -197,7 +197,7 @@
/**
* Read the property string and populate the properties with info needed to access data files.
*/
- private void getMetadata(String propStr) throws ConnectorException {
+ private void getMetadata(String propStr) throws TranslatorException {
try {
int index = 0;
@@ -232,18 +232,18 @@
try {
Integer.parseInt(propertyValue);
} catch (NumberFormatException e) {
- throw new ConnectorException(e, TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3", new Object[] {e.getMessage()})); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3", new Object[] {e.getMessage()})); //$NON-NLS-1$
}
} else if (propertyName.equals(TextDescriptorPropertyNames.HEADER_ROW)) {
try {
Integer.parseInt(propertyValue);
} catch (NumberFormatException e) {
- throw new ConnectorException(e, TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3", new Object[] {e.getMessage()})); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextConnection.The_value_for_the_property_should_be_an_integer._{0}_3", new Object[] {e.getMessage()})); //$NON-NLS-1$
}
} else if (!(propertyName.equals(TextDescriptorPropertyNames.COLUMNS)
|| propertyName.equals(TextDescriptorPropertyNames.TYPES) || propertyName.equals(TextDescriptorPropertyNames.LOCATION)
|| propertyName.equals(TextDescriptorPropertyNames.DELIMITER) || propertyName.equals(TextDescriptorPropertyNames.QUALIFIER))) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnection.The_property_{0}_for_the_group_{1}_is_invalid._4", new Object[] {propertyName, groupName})); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnection.The_property_{0}_for_the_group_{1}_is_invalid._4", new Object[] {propertyName, groupName})); //$NON-NLS-1$
}
// Check for tab as a delimiter and use correct string
@@ -257,7 +257,7 @@
metadataProps.put(groupName, props);
}
} catch (Exception e) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnection.Error_parsing_property_string_{0}__{1}_6", new Object[] {propStr, e.getMessage()})); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnection.Error_parsing_property_string_{0}__{1}_6", new Object[] {propStr, e.getMessage()})); //$NON-NLS-1$
}
}
@@ -266,7 +266,7 @@
* @param fileLocation String standing for the fileLocation either in file system or web.
* @return BufferReader for the file
*/
- private BufferedReader getReader(String fileLocation) throws ConnectorException {
+ private BufferedReader getReader(String fileLocation) throws TranslatorException {
try {
InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileLocation);
if (is != null) {
@@ -283,10 +283,10 @@
// place the stream into a buffered reader
return new BufferedReader(inSR);
} catch (MalformedURLException e) {
- throw new ConnectorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12", new Object[] {fileLocation})); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12", new Object[] {fileLocation})); //$NON-NLS-1$
}
} catch (IOException e) {
- throw new ConnectorException(e,TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12", new Object[] {fileLocation})); //$NON-NLS-1$
+ throw new TranslatorException(e,TextPlugin.Util.getString("TextConnection.Descriptor_file_does_not_exist_at_this_location__{0}_12", new Object[] {fileLocation})); //$NON-NLS-1$
}
}
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -39,7 +39,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TypeFacility;
@@ -93,7 +93,7 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
//translate request
translateRequest(cmd);
@@ -101,9 +101,9 @@
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (canceled) {
- throw new ConnectorException("Execution cancelled"); //$NON-NLS-1$
+ throw new TranslatorException("Execution cancelled"); //$NON-NLS-1$
}
Select query = cmd;
NamedTable group = (NamedTable)query.getFrom().get(0);
@@ -131,15 +131,15 @@
// Save selected columns into query results
if (this.config.isEnforceColumnCount() && record.size() != numModeledColumns) {
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Input_column_cnt_incorrect", new Object[] { new Integer(numModeledColumns), new Integer(record.size()) })); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Input_column_cnt_incorrect", new Object[] { new Integer(numModeledColumns), new Integer(record.size()) })); //$NON-NLS-1$
}
return getRow(record, cols, types);
}
- } catch(ConnectorException ce) {
+ } catch(TranslatorException ce) {
throw ce;
} catch(Throwable e) {
- throw new ConnectorException(e, TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new Object[] { location, e.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextSynchExecution.Error_reading_text_file", new Object[] { location, e.getMessage() })); //$NON-NLS-1$
}
}
@@ -157,16 +157,16 @@
* Translate command.
* @param request ICommand as request
* @return Object translated request
- * @throws ConnectorException if error occurs
+ * @throws TranslatorException if error occurs
*/
- protected Object translateRequest(Command request) throws ConnectorException {
+ protected Object translateRequest(Command request) throws TranslatorException {
if (request == null) {
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Request_is_null")); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Request_is_null")); //$NON-NLS-1$
}
if (cmd == null) {
Object[] params = new Object[] { cmd };
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Error_translating_request", params)); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Error_translating_request", params)); //$NON-NLS-1$
}
// Get the columns widths for all the elements in the group.
@@ -203,9 +203,9 @@
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
Object[] params = new Object[] { query, e.getMessage() };
- throw new ConnectorException(e, TextPlugin.Util.getString("TextSynchExecution.Cannot_be_translated_by_the_TextTranslator.", params)); //$NON-NLS-1$
+ throw new TranslatorException(e, TextPlugin.Util.getString("TextSynchExecution.Cannot_be_translated_by_the_TextTranslator.", params)); //$NON-NLS-1$
}
return request;
@@ -216,7 +216,7 @@
* @param vars List of DataNodeIDs
* @return Column numbers corresponding to vars
*/
- private int[] getSelectCols(List vars) throws ConnectorException{
+ private int[] getSelectCols(List vars) throws TranslatorException{
int[] cols = new int[vars.size()];
for(int i=0; i<vars.size(); i++) {
cols[i] = getColumn((DerivedColumn)vars.get(i));
@@ -232,9 +232,9 @@
*
* @param symbol Identifier to look up the column
* @return int The column corresponding to that id
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private int getColumn(DerivedColumn symbol) throws ConnectorException{
+ private int getColumn(DerivedColumn symbol) throws TranslatorException{
return this.getColumn(getElementFromSymbol(symbol));
}
@@ -259,9 +259,9 @@
* is used otherwise, Name In Source is used.
* @param elem
* @return int
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private int getColumn(Column elem) throws ConnectorException{
+ private int getColumn(Column elem) throws TranslatorException{
String colStr = elem.getNameInSource();
try {
// If Name In Source is numeric, it is a column number
@@ -275,9 +275,9 @@
for ( int i = 0; i < headerRow.size(); i++ ) {
if ( colStr.compareToIgnoreCase((String)headerRow.get(i) )==0) return i;
}
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Column_not_found_in_header_row", new Object[] {colStr, elem.getFullName() } )); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Column_not_found_in_header_row", new Object[] {colStr, elem.getFullName() } )); //$NON-NLS-1$
}
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Invalid_column_number", new Object[] {colStr, elem.getFullName() } ) ); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Invalid_column_number", new Object[] {colStr, elem.getFullName() } ) ); //$NON-NLS-1$
}
}
@@ -290,7 +290,7 @@
* @return List of column values inside the line
* @throws Exception
*/
- private List getRecord(String line, String delimiter, String qualifier, List colWidths) throws ConnectorException {
+ private List getRecord(String line, String delimiter, String qualifier, List colWidths) throws TranslatorException {
if(delimiter != null) {
return parseDelimitedLine(line, delimiter, qualifier);
}
@@ -301,7 +301,7 @@
* @param line line's length will not be 0
* @return List of parsed columns
*/
- private List parseDelimitedLine(String line, String delimiter, String qualifier) throws ConnectorException {
+ private List parseDelimitedLine(String line, String delimiter, String qualifier) throws TranslatorException {
// the case with no qualifier
if (qualifier == null || qualifier.trim().length()==0) {
// parse on delimiters
@@ -359,7 +359,7 @@
// changed to Connectorexception so that the exception is thrown to the user
// and becomes known a problem, rather than just
// keeping it internally to the server
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Text_has_no_ending_qualifier", params)); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Text_has_no_ending_qualifier", params)); //$NON-NLS-1$
}
// skipping escaped qualifier charachters
if(line.length() > endQualIndex+1) {
@@ -379,7 +379,7 @@
// changed to Connectorexception so that the exception is thrown to the user
// and becomes known a problem, rather than just
// keeping it internally to the server
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
@@ -437,9 +437,9 @@
* @param line
* @param colWidths
* @return List
- * @throws ConnectorException
+ * @throws TranslatorException
*/
- private List parseFixedWidthLine(String line, List colWidths) throws ConnectorException {
+ private List parseFixedWidthLine(String line, List colWidths) throws TranslatorException {
int length = line.length();
List fields = new ArrayList(colWidths.size());
Iterator iter = colWidths.iterator();
@@ -448,7 +448,7 @@
try {
int width = ((Integer)iter.next()).intValue();
if(width <= 0) {
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Column_length_must_be_positive")); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Column_length_must_be_positive")); //$NON-NLS-1$
}
int end = current + width;
@@ -479,7 +479,7 @@
* @param columns Columns to save in results
* @param types Class of all columns' types
*/
- private List getRow(List record, int[] columns, Class[] types) throws ConnectorException {
+ private List getRow(List record, int[] columns, Class[] types) throws TranslatorException {
List newRecord = new ArrayList(columns.length);
for(int i=0; i<columns.length; i++) {
int column = columns[i];
@@ -496,7 +496,7 @@
* @param type Input type
* @return Object translated Object from String
*/
- private Object convertString(String value, Class type) throws ConnectorException {
+ private Object convertString(String value, Class type) throws TranslatorException {
if (value==null) {
return null;
}
@@ -527,7 +527,7 @@
try {
return new Timestamp(stringToDateTranslator.translateStringToDate(value).getTime());
}catch(ParseException ex) {
- throw new ConnectorException(TextPlugin.Util.getString("TextSynchExecution.Unable_translate_String_to_Date", new Object[] { ex.getMessage() })); //$NON-NLS-1$
+ throw new TranslatorException(TextPlugin.Util.getString("TextSynchExecution.Unable_translate_String_to_Date", new Object[] { ex.getMessage() })); //$NON-NLS-1$
}
}
}
Modified: trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java
===================================================================
--- trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestMultiFileTextSynchExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import junit.framework.TestCase;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import com.metamatrix.cdk.api.ConnectorHost;
@@ -47,7 +47,7 @@
try {
Util.getConnectorHostWithFakeMetadata(BAD_COUNT_FILE).executeCommand(sql);
fail("Should have failed due to extra column defined in .csv file");//$NON-NLS-1$
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
assertEquals("Expected input file to have 3 columns based on model, but found 4. This could be caused by misplaced quotes, causing multiple columns to be treated as one.", e.getMessage()); //$NON-NLS-1$
}
}
@@ -57,7 +57,7 @@
try {
Util.getConnectorHostWithFakeMetadata(BAD_COUNT_FILE).executeCommand(sql);
fail("Should have failed due to extra column defined in .csv file");//$NON-NLS-1$
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
assertEquals("Expected input file to have 3 columns based on model, but found 4. This could be caused by misplaced quotes, causing multiple columns to be treated as one.", e.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java
===================================================================
--- trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/connectors/translator-text/src/test/java/org/teiid/translator/text/TestRowHeaderTextSynchExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import junit.framework.TestCase;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
@@ -126,7 +126,7 @@
try {
Util.helpTestExecution("TextParts/TextParts.vdb", "TextParts/PartsDescriptor4.txt", sql, 21); //$NON-NLS-1$ //$NON-NLS-2$
fail("Should have received ConnectorException due to an invalid header row being defined."); //$NON-NLS-1$
- } catch (ConnectorException ce ) {
+ } catch (TranslatorException ce ) {
assertEquals("'SELECT PARTS_AlphaNameInSource.Part_Id, PARTS_AlphaNameInSource.Part_Name, PARTS_AlphaNameInSource.Part_Color, PARTS_AlphaNameInSource.Part_Weight FROM PARTS_AlphaNameInSource' cannot be translated by the TextTranslator. Column Part_Id not found for element Parts.PARTS_AlphaNameInSource.Part_Id. Verify column name \"Part_Id\" is defined in the header row of the text file and that the header row number is correctly defined in the descriptor file.", ce.getMessage()); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/CapabilitiesConverter.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -28,7 +28,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
-import org.teiid.translator.ConnectorCapabilities;
+import org.teiid.translator.TranslatorCapabilities;
/**
@@ -40,11 +40,11 @@
private CapabilitiesConverter() {
}
- public static SourceCapabilities convertCapabilities(ConnectorCapabilities srcCaps) {
+ public static SourceCapabilities convertCapabilities(TranslatorCapabilities srcCaps) {
return convertCapabilities(srcCaps, null, false);
}
- public static BasicSourceCapabilities convertCapabilities(ConnectorCapabilities srcCaps, String connectorID, boolean isXa) {
+ public static BasicSourceCapabilities convertCapabilities(TranslatorCapabilities srcCaps, String connectorID, boolean isXa) {
BasicSourceCapabilities tgtCaps = new BasicSourceCapabilities();
tgtCaps.setCapabilitySupport(Capability.QUERY_SELECT_EXPRESSION, srcCaps.supportsSelectExpression());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -56,8 +56,8 @@
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Scope;
import org.teiid.query.sql.lang.Command;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorCapabilities;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
@@ -129,7 +129,7 @@
}
- public MetadataStore getMetadata(String modelName, Map<String, Datatype> datatypes, Properties importProperties) throws ConnectorException {
+ public MetadataStore getMetadata(String modelName, Map<String, Datatype> datatypes, Properties importProperties) throws TranslatorException {
MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
ExecutionFactory executionFactory = getExecutionFactory();
if (executionFactory instanceof MetadataProvider) {
@@ -138,7 +138,7 @@
return factory.getMetadataStore();
}
- public SourceCapabilities getCapabilities() throws ConnectorException {
+ public SourceCapabilities getCapabilities() throws TranslatorException {
if (cachedCapabilities != null) {
return cachedCapabilities;
}
@@ -151,7 +151,7 @@
return resultCaps;
}
- public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem awi) throws ConnectorException {
+ public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem awi) throws TranslatorException {
// Set the connector ID to be used; if not already set.
checkStatus();
AtomicRequestID atomicRequestId = message.getAtomicRequestID();
@@ -196,7 +196,7 @@
/**
* initialize this <code>ConnectorManager</code>.
- * @throws ConnectorException
+ * @throws TranslatorException
*/
public void start() {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorManagerImpl.Initializing_connector", translatorName)); //$NON-NLS-1$
@@ -283,9 +283,9 @@
return null;
}
- private void checkStatus() throws ConnectorException {
+ private void checkStatus() throws TranslatorException {
if (stopped) {
- throw new ConnectorException(DQPPlugin.Util.getString("ConnectorManager.not_in_valid_state", this.translatorName)); //$NON-NLS-1$
+ throw new TranslatorException(DQPPlugin.Util.getString("ConnectorManager.not_in_valid_state", this.translatorName)); //$NON-NLS-1$
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWork.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -24,7 +24,7 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.dqp.message.AtomicResultsMessage;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -34,11 +34,11 @@
void cancel();
- AtomicResultsMessage more() throws ConnectorException;
+ AtomicResultsMessage more() throws TranslatorException;
void close();
- AtomicResultsMessage execute() throws ConnectorException, BlockedException;
+ AtomicResultsMessage execute() throws TranslatorException, BlockedException;
boolean isQueued();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -53,7 +53,7 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionFactory;
@@ -154,12 +154,12 @@
}
LogManager.logDetail(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("DQPCore.The_atomic_request_has_been_cancelled", this.id)); //$NON-NLS-1$
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, e, DQPPlugin.Util.getString("Cancel_request_failed", this.id)); //$NON-NLS-1$
}
}
- public AtomicResultsMessage more() throws ConnectorException {
+ public AtomicResultsMessage more() throws TranslatorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Processing MORE request"}); //$NON-NLS-1$
try {
return handleBatch();
@@ -178,7 +178,7 @@
execution.close();
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Closed execution"}); //$NON-NLS-1$
}
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, e.getMessage());
} catch (Throwable e) {
LogManager.logError(LogConstants.CTX_CONNECTOR, e, e.getMessage());
@@ -190,7 +190,7 @@
- private ConnectorException handleError(Throwable t) {
+ private TranslatorException handleError(Throwable t) {
if (t instanceof DataNotAvailableException) {
throw (DataNotAvailableException)t;
}
@@ -203,23 +203,23 @@
String msg = DQPPlugin.Util.getString("ConnectorWorker.process_failed", this.id); //$NON-NLS-1$
if (isCancelled.get()) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, msg);
- } else if (t instanceof ConnectorException || t instanceof TeiidProcessingException) {
+ } else if (t instanceof TranslatorException || t instanceof TeiidProcessingException) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, t, msg);
} else {
LogManager.logError(LogConstants.CTX_CONNECTOR, t, msg);
}
- if (t instanceof ConnectorException) {
- return (ConnectorException)t;
+ if (t instanceof TranslatorException) {
+ return (TranslatorException)t;
}
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
- return new ConnectorException(t);
+ return new TranslatorException(t);
}
- public AtomicResultsMessage execute() throws ConnectorException, BlockedException {
+ public AtomicResultsMessage execute() throws TranslatorException, BlockedException {
if(isCancelled()) {
- throw new ConnectorException("Request canceled"); //$NON-NLS-1$
+ throw new TranslatorException("Request canceled"); //$NON-NLS-1$
}
if (!this.securityContext.isTransactional()) {
@@ -267,19 +267,19 @@
private int index;
@Override
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
exec.cancel();
}
@Override
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
exec.close();
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
exec.execute();
}
@Override
- public List<?> next() throws ConnectorException,
+ public List<?> next() throws TranslatorException,
DataNotAvailableException {
if (results == null) {
results = ((UpdateExecution)exec).getUpdateCounts();
@@ -305,7 +305,7 @@
}
}
- protected AtomicResultsMessage handleBatch() throws ConnectorException {
+ protected AtomicResultsMessage handleBatch() throws TranslatorException {
Assertion.assertTrue(!this.lastBatch);
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.id, "Sending results from connector"}); //$NON-NLS-1$
int batchSize = 0;
@@ -336,7 +336,7 @@
break;
} else if (this.rowCount > this.connector.getMaxResultRows() && this.connector.isExceptionOnMaxRows()) {
String msg = DQPPlugin.Util.getString("ConnectorWorker.MaxResultRowsExceed", this.connector.getMaxResultRows()); //$NON-NLS-1$
- throw new ConnectorException(msg);
+ throw new TranslatorException(msg);
}
}
}
@@ -378,7 +378,7 @@
return response;
}
- private void correctTypes(List row) throws ConnectorException {
+ private void correctTypes(List row) throws TranslatorException {
//TODO: add a proper source schema
for (int i = convertToRuntimeType.size() - 1; i >= 0; i--) {
int index = convertToRuntimeType.get(i);
@@ -403,7 +403,7 @@
try {
result = DataTypeManager.transformValue(value, value.getClass(), this.schema[i]);
} catch (TransformationException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
if (value == result) {
convertToDesiredRuntimeType[i] = false;
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ProcedureBatchHandler.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -34,7 +34,7 @@
import org.teiid.language.Argument;
import org.teiid.language.Call;
import org.teiid.language.Argument.Direction;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ProcedureExecution;
@@ -65,9 +65,9 @@
}
}
- List padRow(List row) throws ConnectorException {
+ List padRow(List row) throws TranslatorException {
if (row.size() != resultSetCols) {
- throw new ConnectorException(DQPPlugin.Util.getString("ConnectorWorker.ConnectorWorker_result_set_unexpected_columns", new Object[] {proc, new Integer(resultSetCols), new Integer(row.size())})); //$NON-NLS-1$
+ throw new TranslatorException(DQPPlugin.Util.getString("ConnectorWorker.ConnectorWorker_result_set_unexpected_columns", new Object[] {proc, new Integer(resultSetCols), new Integer(row.size())})); //$NON-NLS-1$
}
if (paramCols == 0) {
return row;
@@ -78,7 +78,7 @@
return result;
}
- List getParameterRow() throws ConnectorException {
+ List getParameterRow() throws TranslatorException {
if (paramCols == 0) {
return null;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/language/LanguageBridgeFactory.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -108,7 +108,7 @@
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class LanguageBridgeFactory {
@@ -585,7 +585,7 @@
if(sp.getProcedureID() != null) {
try {
proc = this.metadataFactory.getProcedure(sp.getGroup().getName());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
throw new TeiidRuntimeException(e);
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/metadata/RuntimeMetadataImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -31,7 +31,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.StoredProcedureInfo;
import org.teiid.query.sql.lang.SPParameter;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -45,14 +45,14 @@
}
@Override
- public Column getColumn(String fullName) throws ConnectorException {
+ public Column getColumn(String fullName) throws TranslatorException {
try {
Object metadataId = metadata.getElementID(fullName);
return getElement(metadataId);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -64,14 +64,14 @@
}
@Override
- public Table getTable(String fullName) throws ConnectorException {
+ public Table getTable(String fullName) throws TranslatorException {
try {
Object groupId = metadata.getGroupID(fullName);
return getGroup(groupId);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -83,14 +83,14 @@
}
@Override
- public Procedure getProcedure(String fullName) throws ConnectorException {
+ public Procedure getProcedure(String fullName) throws TranslatorException {
try {
StoredProcedureInfo sp = metadata.getStoredProcedureInfoForProcedure(fullName);
return getProcedure(sp);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
@@ -108,33 +108,33 @@
return null;
}
- public byte[] getBinaryVDBResource(String resourcePath) throws ConnectorException {
+ public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException {
try {
return metadata.getBinaryVDBResource(resourcePath);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
- public String getCharacterVDBResource(String resourcePath) throws ConnectorException {
+ public String getCharacterVDBResource(String resourcePath) throws TranslatorException {
try {
return metadata.getCharacterVDBResource(resourcePath);
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
- public String[] getVDBResourcePaths() throws ConnectorException {
+ public String[] getVDBResourcePaths() throws TranslatorException {
try {
return metadata.getVDBResourcePaths();
} catch (QueryMetadataException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
} catch (TeiidComponentException e) {
- throw new ConnectorException(e);
+ throw new TranslatorException(e);
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedFinder.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -36,7 +36,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -68,17 +68,17 @@
if(caps != null) {
return caps;
}
- ConnectorException exception = null;
+ TranslatorException exception = null;
ModelMetaData model = vdb.getModel(modelName);
for (String sourceName:model.getSourceNames()) {
try {
ConnectorManager mgr = this.connectorRepo.getConnectorManager(sourceName);
if (mgr == null) {
- throw new ConnectorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
+ throw new TranslatorException(DQPPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
}
caps = mgr.getCapabilities();
break;
- } catch(ConnectorException e) {
+ } catch(TranslatorException e) {
if (exception == null) {
exception = e;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -77,7 +77,7 @@
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
public class DataTierManagerImpl implements ProcessorDataManager {
@@ -346,7 +346,7 @@
return aqr;
}
- ConnectorWork executeRequest(AtomicRequestMessage aqr, AbstractWorkItem awi, String connectorName) throws ConnectorException {
+ ConnectorWork executeRequest(AtomicRequestMessage aqr, AbstractWorkItem awi, String connectorName) throws TranslatorException {
return getCM(connectorName).executeRequest(aqr, awi);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -33,7 +33,7 @@
import org.teiid.dqp.internal.datamgr.impl.ConnectorWork;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.AtomicResultsMessage;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
/**
@@ -91,7 +91,7 @@
try {
running = true;
receiveResults(this.cwi.more());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptionOccurred(e, true);
} finally {
running = false;
@@ -116,7 +116,7 @@
}
running = true;
receiveResults(this.cwi.execute());
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
exceptionOccurred(e, true);
} finally {
running = false;
@@ -157,7 +157,7 @@
}
}
- void exceptionOccurred(ConnectorException exception, boolean removeState) throws TeiidComponentException, TeiidProcessingException {
+ void exceptionOccurred(TranslatorException exception, boolean removeState) throws TeiidComponentException, TeiidProcessingException {
if (removeState) {
fullyCloseSource();
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/capabilities/BasicSourceCapabilities.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -40,17 +40,11 @@
public BasicSourceCapabilities() {
}
- /**
- * @see org.teiid.resource.cci.server.datatier.ConnectorCapabilities#supportsCapability(java.lang.String)
- */
public boolean supportsCapability(Capability capability) {
Boolean supports = (Boolean) capabilityMap.get(capability);
return (supports == null) ? false : supports.booleanValue();
}
- /**
- * @see org.teiid.resource.cci.server.datatier.ConnectorCapabilities#supportsFunction(java.lang.String)
- */
public boolean supportsFunction(String functionName) {
Boolean supports = (Boolean) functionMap.get(functionName);
return (supports == null) ? false : supports.booleanValue();
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -45,7 +45,7 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePlanJoins.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -52,7 +52,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.util.CommandContext;
import org.teiid.query.util.Permutation;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
/**
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleRaiseAccess.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -54,7 +54,7 @@
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.util.CommandContext;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
public final class RuleRaiseAccess implements OptimizerRule {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -60,7 +60,7 @@
}
@Override
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws TranslatorException {
executionCount++;
return new FakeBlockingExecution(executionContext);
}
@@ -89,7 +89,7 @@
public FakeBlockingExecution(ExecutionContext ec) {
this.ec = ec;
}
- public void execute(QueryExpression query, int maxBatchSize) throws ConnectorException {
+ public void execute(QueryExpression query, int maxBatchSize) throws TranslatorException {
if (executeBlocks) {
waitForCancel();
}
@@ -97,20 +97,20 @@
Assert.assertSame(classloader, Thread.currentThread().getContextClassLoader());
}
}
- public synchronized void cancel() throws ConnectorException {
+ public synchronized void cancel() throws TranslatorException {
cancelled = true;
this.notify();
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
Assert.assertFalse("The execution should not be closed more than once", closed); //$NON-NLS-1$
closed = true;
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
ec.addWarning(new Exception("Some warning")); //$NON-NLS-1$
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (nextBatchBlocks) {
waitForCancel();
}
@@ -120,11 +120,11 @@
this.rowCount++;
return Arrays.asList(this.rowCount - 1);
}
- private synchronized void waitForCancel() throws ConnectorException {
+ private synchronized void waitForCancel() throws TranslatorException {
try {
this.wait(simulatedBatchRetrievalTime);
if (cancelled && driverThrowsExceptionOnCancel) {
- throw new ConnectorException("Request cancelled"); //$NON-NLS-1$
+ throw new TranslatorException("Request cancelled"); //$NON-NLS-1$
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
@@ -132,7 +132,7 @@
}
@Override
public int[] getUpdateCounts() throws DataNotAvailableException,
- ConnectorException {
+ TranslatorException {
return new int[] {1};
}
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -26,7 +26,7 @@
import java.util.Arrays;
import java.util.List;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
@@ -43,12 +43,12 @@
}
@Override
- public void execute() throws ConnectorException {
+ public void execute() throws TranslatorException {
}
@Override
- public List<?> getOutputParameterValues() throws ConnectorException {
+ public List<?> getOutputParameterValues() throws TranslatorException {
List<Object> result = new ArrayList<Object>(paramSize);
for (int i = 0; i < paramSize; i++) {
result.add(i);
@@ -56,14 +56,14 @@
return result;
}
- public void close() throws ConnectorException {
+ public void close() throws TranslatorException {
}
- public void cancel() throws ConnectorException {
+ public void cancel() throws TranslatorException {
}
@Override
- public List next() throws ConnectorException, DataNotAvailableException {
+ public List next() throws TranslatorException, DataNotAvailableException {
if (rowNum == 1) {
return null;
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorWorkItem.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -49,7 +49,7 @@
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ProcedureExecution;
@@ -101,7 +101,7 @@
try {
pbh.padRow(Arrays.asList(1));
fail("Expected exception from resultset mismatch"); //$NON-NLS-1$
- } catch (ConnectorException err) {
+ } catch (TranslatorException err) {
assertEquals(
"Could not process stored procedure results for EXEC spTest8(1). Expected 2 result set columns, but was 1. Please update your models to allow for stored procedure results batching.", err.getMessage()); //$NON-NLS-1$
}
@@ -156,7 +156,7 @@
}
@Ignore
- @Test(expected=ConnectorException.class) public void testIsImmutablePropertyFails() throws Exception {
+ @Test(expected=TranslatorException.class) public void testIsImmutablePropertyFails() throws Exception {
/*
* Setup:
* 1. requestMsg.isTransactional() must be TRUE
Modified: trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -38,7 +38,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
@@ -69,9 +69,9 @@
@Override
public ConnectorWork executeRequest(AtomicRequestMessage message, AbstractWorkItem awi)
- throws ConnectorException {
+ throws TranslatorException {
if (throwExceptionOnExecute) {
- throw new ConnectorException("Connector Exception"); //$NON-NLS-1$
+ throw new TranslatorException("Connector Exception"); //$NON-NLS-1$
}
List projectedSymbols = (message.getCommand()).getProjectedSymbols();
List[] results = createResults(projectedSymbols);
@@ -81,12 +81,12 @@
return new ConnectorWork() {
@Override
- public AtomicResultsMessage more() throws ConnectorException {
+ public AtomicResultsMessage more() throws TranslatorException {
throw new RuntimeException("Should not be called"); //$NON-NLS-1$
}
@Override
- public AtomicResultsMessage execute() throws ConnectorException {
+ public AtomicResultsMessage execute() throws TranslatorException {
if (dataNotAvailable > -1) {
int delay = dataNotAvailable;
dataNotAvailable = -1;
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/TestJoinPushdownRestrictions.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -27,7 +27,7 @@
import org.teiid.query.optimizer.capabilities.FakeCapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.SourceCapabilities.Capability;
import org.teiid.query.unittest.FakeMetadataFactory;
-import org.teiid.translator.ConnectorCapabilities.SupportedJoinCriteria;
+import org.teiid.translator.TranslatorCapabilities.SupportedJoinCriteria;
public class TestJoinPushdownRestrictions {
Modified: trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/metadata/src/test/java/com/metamatrix/cdk/api/ConnectorHost.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -30,7 +30,7 @@
import org.teiid.language.Command;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.index.VDBMetadataFactory;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
@@ -50,15 +50,15 @@
private ExecutionContext executionContext;
private Object connectionFactory;
- public ConnectorHost(ExecutionFactory connector, Object connectionFactory, String vdbFileName) throws ConnectorException {
+ public ConnectorHost(ExecutionFactory connector, Object connectionFactory, String vdbFileName) throws TranslatorException {
initialize(connector, connectionFactory, new TranslationUtility(VDBMetadataFactory.getVDBMetadata(vdbFileName)));
}
- public ConnectorHost(ExecutionFactory connector, Object connectionFactory, TranslationUtility util) throws ConnectorException{
+ public ConnectorHost(ExecutionFactory connector, Object connectionFactory, TranslationUtility util) throws TranslatorException{
initialize(connector, connectionFactory, util);
}
- private void initialize(ExecutionFactory connector, Object connectionFactory, TranslationUtility util) throws ConnectorException {
+ private void initialize(ExecutionFactory connector, Object connectionFactory, TranslationUtility util) throws TranslatorException {
this.connector = connector;
this.util = util;
this.connectionFactory = connectionFactory;
@@ -69,20 +69,20 @@
this.executionContext = context;
}
- public List executeCommand(String query) throws ConnectorException {
+ public List executeCommand(String query) throws TranslatorException {
Command command = getCommand(query);
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
return executeCommand(command, runtimeMetadata);
}
- public List executeCommand(Command command) throws ConnectorException {
+ public List executeCommand(Command command) throws TranslatorException {
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
return executeCommand(command, runtimeMetadata);
}
private List executeCommand(Command command, RuntimeMetadata runtimeMetadata)
- throws ConnectorException {
+ throws TranslatorException {
Execution exec = connector.createExecution(command, this.executionContext, runtimeMetadata, this.connectionFactory);
exec.execute();
@@ -92,7 +92,7 @@
return results;
}
- public int[] executeBatchedUpdates(String[] updates) throws ConnectorException {
+ public int[] executeBatchedUpdates(String[] updates) throws TranslatorException {
RuntimeMetadata runtimeMetadata = getRuntimeMetadata();
Command[] commands = new Command[updates.length];
for (int i = 0; i < updates.length; i++) {
@@ -102,7 +102,7 @@
return executeBatchedUpdates(commands, runtimeMetadata);
}
- public int[] executeBatchedUpdates(Command[] commands, RuntimeMetadata runtimeMetadata) throws ConnectorException {
+ public int[] executeBatchedUpdates(Command[] commands, RuntimeMetadata runtimeMetadata) throws TranslatorException {
List<List> result = executeCommand(new BatchedUpdates(Arrays.asList(commands)), runtimeMetadata);
int[] counts = new int[result.size()];
for (int i = 0; i < counts.length; i++) {
@@ -111,7 +111,7 @@
return counts;
}
- private List<List> readResultsFromExecution(Execution execution) throws ConnectorException {
+ private List<List> readResultsFromExecution(Execution execution) throws TranslatorException {
List<List> results = new ArrayList<List>();
while (true) {
try {
@@ -133,7 +133,7 @@
try {
Thread.sleep(e.getRetryDelay());
} catch (InterruptedException e1) {
- throw new ConnectorException(e1);
+ throw new TranslatorException(e1);
}
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/runtime/src/main/java/org/teiid/deployers/TranslatorDeployer.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -25,8 +25,6 @@
import java.lang.reflect.Method;
import java.util.Map;
-import javax.resource.ResourceException;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -106,8 +104,6 @@
} catch (TeiidException e) {
throw new DeploymentException(e);
- } catch (ResourceException e) {
- throw new DeploymentException(e);
} catch (InvocationTargetException e) {
throw new DeploymentException(e);
} catch (IllegalAccessException e) {
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -47,7 +47,7 @@
import org.teiid.metadata.TransformationMetadata.Resource;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.runtime.RuntimePlugin;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionFactory;
@@ -275,7 +275,7 @@
this.serializer.saveAttachment(cacheFile, store);
}
return store;
- } catch (ConnectorException e) {
+ } catch (TranslatorException e) {
if (exception != null) {
exception = e;
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -15,7 +15,7 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ProcedureExecution;
@@ -28,7 +28,7 @@
@Override
public ProcedureExecution createProcedureExecution(
Call procedure, ExecutionContext executionContext,
- RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ RuntimeMetadata metadata, Object connection) throws TranslatorException {
Properties props = new Properties();
props.setProperty("customBehaviour", "SkipExecute");//$NON-NLS-1$ //$NON-NLS-2$
@@ -45,7 +45,7 @@
@Override
public ResultSetExecution createResultSetExecution(
QueryExpression query, ExecutionContext executionContext,
- RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ RuntimeMetadata metadata, Object connection) throws TranslatorException {
Properties groupProps = new Properties();
groupProps.setProperty("customName", "CustomTableA");//$NON-NLS-1$ //$NON-NLS-2$
NamedTable group = (NamedTable)query.getProjectedQuery().getFrom().get(0);
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-05-13 13:40:34 UTC (rev 2122)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-05-13 14:30:43 UTC (rev 2123)
@@ -48,7 +48,7 @@
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.services.SessionServiceImpl;
-import org.teiid.translator.ConnectorException;
+import org.teiid.translator.TranslatorException;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
import org.teiid.transport.LocalServerConnection;
@@ -78,7 +78,7 @@
Mockito.stub(cmr.getConnectorManager("source")).toReturn(new ConnectorManager("x", "x") {
@Override
public SourceCapabilities getCapabilities()
- throws ConnectorException {
+ throws TranslatorException {
return new BasicSourceCapabilities();
}
});
13 years, 11 months
teiid SVN: r2122 - in trunk: build/kits/jboss-container/deploy/teiid/connectors and 50 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-05-13 09:40:34 -0400 (Thu, 13 May 2010)
New Revision: 2122
Added:
trunk/connectors/salesforce-api/src/main/resources/partner_v17.wsdl
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/db2/DB2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.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-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
Removed:
trunk/build/kits/jboss-container/deploy/teiid/connectors/text-translator.xml
trunk/connector-api/src/main/java/org/teiid/translator/BasicConnectorCapabilities.java
trunk/connector-api/src/main/java/org/teiid/translator/BasicExecution.java
trunk/connector-api/src/main/java/org/teiid/translator/BasicExecutionFactory.java
trunk/connector-api/src/test/java/org/teiid/connector/TestBasicExecutionFactory.java
trunk/connectors/salesforce-api/src/main/resources/partner_v15.wsdl
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/resource/
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooCapabilities.java
trunk/connectors/sandbox/translator-yahoo/src/test/java/org/teiid/resource/
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/Translator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2Capabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2SQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbySQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Capabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Translator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MMCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Capabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Translator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/SequeLinkOracleCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseSQLTranslator.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidCapabilities.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataCapabilities.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPConnectorCapabilities.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackCapabilities.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceCapabilities.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextCapabilities.java
trunk/engine/src/main/java/com/
trunk/engine/src/test/java/com/
Modified:
trunk/
trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java
trunk/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.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/JDBCProcedureExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestExtractFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCUpdateExecution.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2ConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbyCapabilities.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestDayWeekQuarterFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestLeftOrRightFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestMonthOrDayNameFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestSubstringFunctionModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
trunk/connectors/translator-ldap/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
trunk/connectors/translator-loopback/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
trunk/connectors/translator-salesforce/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
trunk/connectors/translator-text/src/main/resources/META-INF/jboss-beans.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorDeployer.java
trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java
Log:
TEIID-1089: Merging the ExecutionFactory and Capabilities concept toghether.
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- .classpath
.settings
target
.project
+ .classpath
.settings
target
.project
build.xml
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/jdbc-translator.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -2,72 +2,67 @@
<translator-factory>
<translator>
<name>access</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.access.AccessSQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.access.AccessExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>db2</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.db2.DB2SQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.db2.DB2ExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>derby</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.derby.DerbySQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.derby.DerbyExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>h2</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.h2.H2Translator" />
+ <execution-factory-class>org.teiid.translator.jdbc.h2.H2ExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>hsql</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.hsql.HsqlTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.hsql.HsqlExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
-
<translator>
<name>mysql</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.mysql.MySQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.mysql.MySQLExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
+
+ <translator>
+ <name>mysql5</name>
+ <execution-factory-class>org.teiid.translator.jdbc.mysql.MySQL5ExecutionFactory</execution-factory-class>
+ <xa-capable>true</xa-capable>
+ </translator>
<translator>
<name>oracle</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.oracle.OracleSQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.oracle.OracleExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>postgresql</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.postgresql.PostgreSQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.postgresql.PostgreSQLExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>sqlserver</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.sqlserver.SQLServerSQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.sqlserver.SQLServerExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
<translator>
<name>sybase</name>
- <execution-factory-class>org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</execution-factory-class>
- <translator-property name="ExtensionTranslationClassName" value="org.teiid.translator.jdbc.sybase.SybaseSQLTranslator" />
+ <execution-factory-class>org.teiid.translator.jdbc.sybase.SybaseExecutionFactory</execution-factory-class>
<xa-capable>true</xa-capable>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/ldap-translator.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -2,7 +2,7 @@
<translator-factory>
<translator>
<name>ldap</name>
- <execution-factory-class>org.teiid.resource.adapter.ldap.LDAPExecutionFactory</execution-factory-class>
+ <execution-factory-class>org.teiid.translator.ldap.LDAPExecutionFactory</execution-factory-class>
<translator-property name="SearchDefaultBaseDN" value="" />
<translator-property name="SearchDefaultScope" value="SUBTREE_SCOPE" />
<translator-property name="RestrictToObjectClass" value="false" />
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/loopback-translator.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -2,6 +2,6 @@
<translator-factory>
<translator>
<name>loopback</name>
- <execution-factory-class>org.teiid.resource.adapter.loopback.LoopbackExecutionFactory</execution-factory-class>
+ <execution-factory-class>org.teiid.translator.loopback.LoopbackExecutionFactory</execution-factory-class>
</translator>
</translator-factory>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/salesforce-translator.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -2,6 +2,6 @@
<translator-factory>
<translator>
<name>salesforce</name>
- <execution-factory-class>org.teiid.resource.adapter.salesforce.SalesForceExecutionFactory</execution-factory-class>
+ <execution-factory-class>org.teiid.translator.salesforce.SalesForceExecutionFactory</execution-factory-class>
</translator>
</translator-factory>
\ No newline at end of file
Deleted: trunk/build/kits/jboss-container/deploy/teiid/connectors/text-translator.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/connectors/text-translator.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/build/kits/jboss-container/deploy/teiid/connectors/text-translator.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<translator-factory>
- <translator>
- <name>text</name>
- <execution-factory-class>org.teiid.resource.adapter.text.TextExecutionFactory</execution-factory-class>
- </translator>
-</translator-factory>
\ No newline at end of file
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/BasicConnectorCapabilities.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/BasicConnectorCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connector-api/src/main/java/org/teiid/translator/BasicConnectorCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,379 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-import java.util.List;
-
-
-
-/**
- * This class is a base implementation of the ConnectorCapabilities interface.
- * It is implemented to return false for all capabilities. Subclass this base
- * class and override any methods necessary to specify capabilities the
- * connector actually supports.
- */
-public class BasicConnectorCapabilities implements ConnectorCapabilities {
-
- /**
- * Construct the basic capabilities class.
- */
- public BasicConnectorCapabilities() {
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSelectDistinct()
- */
- public boolean supportsSelectDistinct() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAliasedGroup()
- */
- public boolean supportsAliasedGroup() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSelfJoins()
- */
- public boolean supportsSelfJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOuterJoins()
- */
- public boolean supportsOuterJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsBetweenCriteria()
- */
- public boolean supportsBetweenCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
- */
- public boolean supportsCompareCriteriaEquals() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteria()
- */
- public boolean supportsLikeCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteriaEscapeCharacter()
- */
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsInCriteria()
- */
- public boolean supportsInCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsInCriteriaSubquery()
- */
- public boolean supportsInCriteriaSubquery() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsIsNullCriteria()
- */
- public boolean supportsIsNullCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOrCriteria()
- */
- public boolean supportsOrCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsNotCriteria()
- */
- public boolean supportsNotCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsExistsCriteria()
- */
- public boolean supportsExistsCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaSome()
- */
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
- */
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOrderBy()
- */
- public boolean supportsOrderBy() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesSum()
- */
- public boolean supportsAggregatesSum() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesAvg()
- */
- public boolean supportsAggregatesAvg() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesMin()
- */
- public boolean supportsAggregatesMin() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesMax()
- */
- public boolean supportsAggregatesMax() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesCount()
- */
- public boolean supportsAggregatesCount() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesCountStar()
- */
- public boolean supportsAggregatesCountStar() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesDistinct()
- */
- public boolean supportsAggregatesDistinct() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsScalarSubqueries()
- */
- public boolean supportsScalarSubqueries() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCorrelatedSubqueries()
- */
- public boolean supportsCorrelatedSubqueries() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCaseExpressions()
- */
- public boolean supportsCaseExpressions() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSearchedCaseExpressions()
- */
- public boolean supportsSearchedCaseExpressions() {
- return false;
- }
-
- /**
- * Return null to indicate no functions are supported.
- * @return null
- * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- return null;
- }
-
- public boolean supportsInlineViews() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsUnions()
- * @since 4.2
- */
- public boolean supportsUnions() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#getMaxInCriteriaSize()
- * @since 4.2
- */
- public int getMaxInCriteriaSize() {
- return -1;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return false;
- }
-
- public boolean supportsRowLimit() {
- return false;
- }
-
- public boolean supportsRowOffset() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#getMaxFromGroups()
- */
- public int getMaxFromGroups() {
- return -1; //-1 indicates no max
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsExcept()
- */
- public boolean supportsExcept() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsIntersect()
- */
- public boolean supportsIntersect() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsSetQueryOrderBy()
- */
- public boolean supportsSetQueryOrderBy() {
- return false;
- }
-
- @Override
- public boolean useAnsiJoin() {
- return false;
- }
-
- @Override
- public boolean requiresCriteria() {
- return false;
- }
-
- @Override
- public boolean supportsBatchedUpdates() {
- return false;
- }
-
- @Override
- 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;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false;
- }
-
- @Override
- public boolean supportsBulkUpdate() {
- return false;
- }
-
- @Override
- public boolean supportsOrderByUnrelated() {
- return false;
- }
-
-}
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/BasicExecution.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/BasicExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connector-api/src/main/java/org/teiid/translator/BasicExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator;
-
-
-public abstract class BasicExecution implements Execution {
-
-}
Deleted: trunk/connector-api/src/main/java/org/teiid/translator/BasicExecutionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/BasicExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connector-api/src/main/java/org/teiid/translator/BasicExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,209 +0,0 @@
-package org.teiid.translator;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Collection;
-import java.util.Properties;
-
-import org.teiid.core.TeiidException;
-import org.teiid.core.util.ReflectionHelper;
-import org.teiid.core.util.StringUtil;
-import org.teiid.language.Call;
-import org.teiid.language.Command;
-import org.teiid.language.LanguageFactory;
-import org.teiid.language.QueryExpression;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.resource.spi.BasicManagedConnectionFactory;
-
-
-public class BasicExecutionFactory implements ExecutionFactory {
-
- protected ConnectorCapabilities capabilities;
- private static final TypeFacility TYPE_FACILITY = new TypeFacility();
-
- private String capabilitiesClass;
- private boolean immutable = false;
- private boolean exceptionOnMaxRows = false;
- private int maxResultRows = -1;
- private boolean xaCapable;
- private String overrideCapabilitiesFile;
- private boolean sourceRequired = true;
-
- @Override
- public void start() throws ConnectorException {
- }
-
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return BasicConnectorCapabilities.class;
- }
-
- @Override
- public ConnectorCapabilities getCapabilities() throws ConnectorException {
- if (capabilities == null) {
- // create Capabilities
- capabilities = BasicManagedConnectionFactory.getInstance(ConnectorCapabilities.class, getCapabilitiesClass(), null, getDefaultCapabilities());
- }
-
- // capabilities overload
- Properties props = getOverrideCapabilities();
- if (this.capabilities != null && props != null) {
- this.capabilities = (ConnectorCapabilities) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {ConnectorCapabilities.class}, new CapabilitesOverloader(this.capabilities, props));
- }
- return capabilities;
- }
-
- @Override
- public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
- if (command instanceof QueryExpression) {
- return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
- }
- if (command instanceof Call) {
- return createProcedureExecution((Call)command, executionContext, metadata, connectionFactory);
- }
- return createUpdateExecution(command, executionContext, metadata, connectionFactory);
- }
-
- public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution"); //$NON-NLS-1$
- }
-
- public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
- }
-
- public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
- throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
- }
-
- // derived
- private Properties overrideCapabilities;
-
-
- @Override
- public LanguageFactory getLanguageFactory() {
- return LanguageFactory.INSTANCE;
- }
-
- @Override
- public TypeFacility getTypeFacility() {
- return TYPE_FACILITY;
- }
-
- @Override
- public Properties getOverrideCapabilities() throws ConnectorException {
- if (this.overrideCapabilities == null && getOverrideCapabilitiesFile() != null) {
- try {
- this.overrideCapabilities = new Properties();
- this.overrideCapabilities.loadFromXML(this.getClass().getResourceAsStream(getOverrideCapabilitiesFile()));
- } catch (IOException e) {
- throw new ConnectorException(e);
- }
- }
- return this.overrideCapabilities;
- }
-
- public static <T> T getInstance(Class<T> expectedType, String className, Collection ctorObjs, Class defaultClass) throws ConnectorException {
- try {
- if (className == null) {
- if (defaultClass == null) {
- throw new ConnectorException("Neither class name or default class specified to create an instance"); //$NON-NLS-1$
- }
- return expectedType.cast(defaultClass.newInstance());
- }
- return expectedType.cast(ReflectionHelper.create(className, ctorObjs, Thread.currentThread().getContextClassLoader()));
- } catch (TeiidException e) {
- throw new ConnectorException(e);
- } catch (IllegalAccessException e) {
- throw new ConnectorException(e);
- } catch(InstantiationException e) {
- throw new ConnectorException(e);
- }
- }
- /**
- * Overloads the connector capabilities with one defined in the connector binding properties
- */
- static final class CapabilitesOverloader implements InvocationHandler {
- ConnectorCapabilities caps;
- Properties properties;
-
- CapabilitesOverloader(ConnectorCapabilities caps, Properties properties){
- this.caps = caps;
- this.properties = properties;
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- String value = this.properties.getProperty(method.getName());
- if (value == null || value.trim().length() == 0 || (args != null && args.length != 0)) {
- return method.invoke(this.caps, args);
- }
- return StringUtil.valueOf(value, method.getReturnType());
- }
- }
-
- @Override
- public String getCapabilitiesClass() {
- return capabilitiesClass;
- }
-
- public void setCapabilitiesClass(String arg0) {
- this.capabilitiesClass = arg0;
- }
-
- @Override
- public boolean isImmutable() {
- return immutable;
- }
-
- public void setImmutable(boolean arg0) {
- this.immutable = arg0;
- }
-
- @Override
- public boolean isExceptionOnMaxRows() {
- return exceptionOnMaxRows;
- }
-
- public void setExceptionOnMaxRows(boolean arg0) {
- this.exceptionOnMaxRows = arg0;
- }
-
- @Override
- public int getMaxResultRows() {
- return maxResultRows;
- }
-
- public void setMaxResultRows(int arg0) {
- this.maxResultRows = arg0;
- }
-
- @Override
- public boolean isXaCapable() {
- return xaCapable;
- }
-
- public void setXaCapable(boolean arg0) {
- this.xaCapable = arg0;
- }
-
- @Override
- public String getOverrideCapabilitiesFile() throws ConnectorException {
- return this.overrideCapabilitiesFile;
- }
-
-
- public void setOverrideCapabilitiesFile(String overrideCapabilitiesFile) {
- this.overrideCapabilitiesFile = overrideCapabilitiesFile;
- }
-
- @Override
- public boolean isSourceRequired() {
- return sourceRequired;
- }
-
- public void setSourceRequired(boolean value) {
- this.sourceRequired = value;
- }
-}
Modified: trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connector-api/src/main/java/org/teiid/translator/ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,105 +22,122 @@
package org.teiid.translator;
-import java.util.Properties;
+import java.util.List;
+import org.teiid.language.Call;
import org.teiid.language.Command;
import org.teiid.language.LanguageFactory;
+import org.teiid.language.QueryExpression;
import org.teiid.metadata.RuntimeMetadata;
/**
- * <p>The primary entry point for a Connector. This interface should be implemented
- * by the connector writer.</p>
+ * <p>The primary entry point for a Translator. This class should be extended by the custom translator writer.</p>
*
- * <p>The JCA Container will instantiate the implementation of this class. Once the class has been
- * instantiated, the {@link #start()} method will be called
- * with all necessary connector properties. </p>
+ * The deployer instantiates this class through reflection. So it is important to have no-arg constructor. Once constructed
+ * the "start" method is called. This class represents the basic capabilities of the translator.
*/
-public interface ExecutionFactory {
+public class ExecutionFactory implements ConnectorCapabilities{
+ public static final int DEFAULT_MAX_FROM_GROUPS = -1;
+
+ private static final TypeFacility TYPE_FACILITY = new TypeFacility();
+
+ private boolean immutable = false;
+ private boolean exceptionOnMaxRows = false;
+ private int maxResultRows = DEFAULT_MAX_FROM_GROUPS;
+ private boolean xaCapable;
+ private boolean sourceRequired = true;
+
/**
* Initialize the connector with supplied configuration
*/
- void start() throws ConnectorException;
+ public void start() throws ConnectorException {
+ }
/**
- * Capabilities Class Name
- * @return
- */
- @TranslatorProperty(name="capabilities-class", display="Connector Capabilities",description="The class to use to provide the Connector Capabilities")
- public String getCapabilitiesClass();
-
- /**
* Defines if the Connector is read-only connector
* @return
*/
@TranslatorProperty(name="immutable", display="Is Immutable",description="Is Immutable, True if the source never changes.",advanced=true, defaultValue="false")
- public boolean isImmutable();
+ public boolean isImmutable() {
+ return immutable;
+ }
+ public void setImmutable(boolean arg0) {
+ this.immutable = arg0;
+ }
+
/**
* Throw exception if there are more rows in the result set than specified in the MaxResultRows setting.
* @return
*/
@TranslatorProperty(name="exception-on-max-rows", display="Exception on Exceeding Max Rows",description="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",advanced=true, defaultValue="true")
- public boolean isExceptionOnMaxRows();
+ public boolean isExceptionOnMaxRows() {
+ return exceptionOnMaxRows;
+ }
+
+ public void setExceptionOnMaxRows(boolean arg0) {
+ this.exceptionOnMaxRows = arg0;
+ }
/**
* Maximum result set rows to fetch
* @return
*/
@TranslatorProperty(name="max-result-rows", display="Maximum Result Rows", description="Maximum Result Rows allowed", advanced=true, defaultValue="-1")
- public int getMaxResultRows();
+ public int getMaxResultRows() {
+ return maxResultRows;
+ }
+
+ public void setMaxResultRows(int arg0) {
+ this.maxResultRows = arg0;
+ }
/**
* Shows the XA transaction capability of the Connector.
* @return
*/
@TranslatorProperty(name="xa-capable", display="Is XA Capable", description="True, if this connector supports XA Transactions", defaultValue="false")
- public boolean isXaCapable();
+ public boolean isXaCapable() {
+ return xaCapable;
+ }
+
+ public void setXaCapable(boolean arg0) {
+ this.xaCapable = arg0;
+ }
/**
- * Get the Override capabilities for the connector
- * @return
- */
- @TranslatorProperty(name="override-capabilities-file", display="Override capabilities file", description="Property file that defines the override capability properties")
- String getOverrideCapabilitiesFile() throws ConnectorException;
-
- /**
* Flag that indicates if a underlying source connection required for this execution factory to work
* @return
*/
- @TranslatorProperty(name="source-required", display="Source Connection Required", description="Flag that indicates, a source required for the translator to work", readOnly= true)
- boolean isSourceRequired();
+ public boolean isSourceRequired() {
+ return sourceRequired;
+ }
+
+ public void setSourceRequired(boolean value) {
+ this.sourceRequired = value;
+ }
/**
* Obtain a reference to the default LanguageFactory that can be used to construct
* new language interface objects. This is typically needed when modifying the language
* objects passed to the connector or for testing when objects need to be created.
*/
- LanguageFactory getLanguageFactory();
+ public LanguageFactory getLanguageFactory() {
+ return LanguageFactory.INSTANCE;
+ }
/**
* Obtain a reference to the type facility, which can be used to perform many type
* conversions supplied by the Connector API.
*/
- TypeFacility getTypeFacility();
+ public TypeFacility getTypeFacility() {
+ return TYPE_FACILITY;
+ }
/**
- * Get the Override capabilities for the connector
- * @return
- */
- Properties getOverrideCapabilities() throws ConnectorException;
-
- /**
- * Get the capabilities of this connector. The capabilities affect what kinds of
- * queries (and other commands) will be sent to the connector.
- * @return ConnectorCapabilities
- */
- ConnectorCapabilities getCapabilities() throws ConnectorException;
-
- /**
* Create an execution object for the specified command
* @param command the command
* @param executionContext Provides information about the context that this command is
@@ -129,5 +146,285 @@
* @param connection connection factory object to the data source
* @return An execution object that can use to execute the command
*/
- Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException;
+ public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory) throws ConnectorException {
+ if (command instanceof QueryExpression) {
+ return createResultSetExecution((QueryExpression)command, executionContext, metadata, connectionFactory);
+ }
+ if (command instanceof Call) {
+ return createProcedureExecution((Call)command, executionContext, metadata, connectionFactory);
+ }
+ return createUpdateExecution(command, executionContext, metadata, connectionFactory);
+ }
+
+ public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ throw new ConnectorException("Unsupported Execution"); //$NON-NLS-1$
+ }
+
+ public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ }
+
+ public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connection) throws ConnectorException {
+ throw new ConnectorException("Unsupported Execution");//$NON-NLS-1$
+ }
+
+ @Override
+ public boolean supportsSelectDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAliasedGroup() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSelfJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesSum() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesAvg() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMin() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMax() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCount() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSearchedCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ return null;
+ }
+
+ public boolean supportsInlineViews() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return false;
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return DEFAULT_MAX_FROM_GROUPS;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return false;
+ }
+
+ @Override
+ public int getMaxFromGroups() {
+ return DEFAULT_MAX_FROM_GROUPS; //-1 indicates no max
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSetQueryOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean useAnsiJoin() {
+ return false;
+ }
+
+ @Override
+ public boolean requiresCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBatchedUpdates() {
+ return false;
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBulkUpdate() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderByUnrelated() {
+ return false;
+ }
+
}
Deleted: trunk/connector-api/src/test/java/org/teiid/connector/TestBasicExecutionFactory.java
===================================================================
--- trunk/connector-api/src/test/java/org/teiid/connector/TestBasicExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connector-api/src/test/java/org/teiid/connector/TestBasicExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.connector;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Properties;
-
-import org.junit.Test;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ExecutionFactory;
-
-
-public class TestBasicExecutionFactory {
-
- @Test public void testConnectorCapabilitiesOverride() throws Exception {
-
- ExecutionFactory c = new BasicExecutionFactory();
- //Mockito.stub(c.getCapabilities()).toReturn(new BasicConnectorCapabilities());
-
- ConnectorCapabilities caps = c.getCapabilities();
- assertFalse(caps.supportsExistsCriteria());
- assertFalse(caps.supportsExcept());
-
-
- c = new BasicExecutionFactory() {
- @Override
- public Properties getOverrideCapabilities() {
- Properties props = new Properties();
- props.setProperty("supportsExistsCriteria", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- props.setProperty("supportsExcept", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- return props;
- }
- };
-
- caps = c.getCapabilities();
- assertTrue(caps.supportsExistsCriteria());
- assertTrue(caps.supportsExcept());
- }
-}
Modified: trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java
===================================================================
--- trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/salesforce-api/src/main/java/com/sforce/soap/partner/SforceService.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -5,13 +5,13 @@
package com.sforce.soap.partner;
-import java.net.MalformedURLException;
import java.net.URL;
+
import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Service;
/**
* This class was generated by Apache CXF 2.2.5
@@ -21,22 +21,18 @@
*/
-@WebServiceClient(name = "SforceService",
- wsdlLocation = "file:/NotBackedUp/jdoyle/tools/JBoss-WS.3.3.2/jbossws-cxf-bin-dist/deploy/bin/partner_17.wsdl",
- targetNamespace = "urn:partner.soap.sforce.com")
+@WebServiceClient(name = "SforceService", wsdlLocation = SforceService.PARTNER_WSDL,targetNamespace = "urn:partner.soap.sforce.com")
public class SforceService extends Service {
- public final static URL WSDL_LOCATION;
- public final static QName SERVICE = new QName("urn:partner.soap.sforce.com", "SforceService");
- public final static QName Soap = new QName("urn:partner.soap.sforce.com", "Soap");
+ private static final String PARTNER_WSDL = "partner_17.wsdl"; //$NON-NLS-1$
+ public final static URL WSDL_LOCATION;
+ public final static QName SERVICE = new QName("urn:partner.soap.sforce.com", "SforceService"); //$NON-NLS-1$ //$NON-NLS-2$
+ public final static QName Soap = new QName("urn:partner.soap.sforce.com", "Soap");//$NON-NLS-1$ //$NON-NLS-2$
static {
- URL url = null;
- try {
- url = new URL("file:/NotBackedUp/jdoyle/tools/JBoss-WS.3.3.2/jbossws-cxf-bin-dist/deploy/bin/partner_17.wsdl");
- } catch (MalformedURLException e) {
- System.err.println("Can not initialize the default wsdl from file:/NotBackedUp/jdoyle/tools/JBoss-WS.3.3.2/jbossws-cxf-bin-dist/deploy/bin/partner_17.wsdl");
- // e.printStackTrace();
- }
+ URL url = SforceService.class.getClassLoader().getResource(PARTNER_WSDL);
+ if (url == null) {
+ System.err.println("Can not find the default wsdl for salesforce"); //$NON-NLS-1$
+ }
WSDL_LOCATION = url;
}
Deleted: trunk/connectors/salesforce-api/src/main/resources/partner_v15.wsdl
===================================================================
--- trunk/connectors/salesforce-api/src/main/resources/partner_v15.wsdl 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/salesforce-api/src/main/resources/partner_v15.wsdl 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,2852 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<!--
-Salesforce.com Partner Web Services API Version 15.0
-Generated on 2009-04-15 20:55:33 +0000.
-
-Copyright 1999-2009 salesforce.com, inc.
-All Rights Reserved
--->
-
-<definitions targetNamespace="urn:partner.soap.sforce.com"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:fns="urn:fault.partner.soap.sforce.com"
- xmlns:tns="urn:partner.soap.sforce.com"
- xmlns:ens="urn:sobject.partner.soap.sforce.com">
- <types>
-
- <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sobject.partner.soap.sforce.com">
-
- <import namespace="urn:partner.soap.sforce.com"/>
-
-
- <!-- Dynamic sObject -->
- <complexType name="sObject">
- <sequence>
- <element name="type" type="xsd:string"/>
- <element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="Id" type="tns:ID" nillable="true" />
- <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
- </sequence>
- </complexType>
-
- </schema>
-
- <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:partner.soap.sforce.com">
-
- <import namespace="urn:sobject.partner.soap.sforce.com"/>
-
- <!-- Our simple ID Type -->
- <simpleType name="ID">
- <restriction base="xsd:string">
- <length value="18"/>
- <pattern value='[a-zA-Z0-9]{18}'/>
- </restriction>
- </simpleType>
-
- <simpleType name="QueryLocator">
- <restriction base="xsd:string"/>
- </simpleType>
-
- <!-- Shared Result Types -->
- <complexType name="QueryResult">
- <sequence>
- <element name="done" type="xsd:boolean"/>
- <element name="queryLocator" type="tns:QueryLocator" nillable="true"/>
- <element name="records" type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="size" type="xsd:int"/>
- </sequence>
- </complexType>
-
-
-
- <!-- Search Result -->
- <complexType name="SearchResult">
- <sequence>
- <element name="searchRecords" minOccurs="0" maxOccurs="unbounded" type="tns:SearchRecord"/>
- <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="SearchRecord">
- <sequence>
- <element name="record" type="ens:sObject"/>
- </sequence>
- </complexType>
-
- <!-- GetUpdated Result -->
- <complexType name="GetUpdatedResult">
- <sequence>
- <element name="ids" minOccurs="0" maxOccurs="unbounded" type="tns:ID"/>
- <element name="latestDateCovered" type="xsd:dateTime"/>
- <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <!-- GetDeleted Result -->
- <complexType name="GetDeletedResult">
- <sequence>
- <element name="deletedRecords" minOccurs="0" maxOccurs="unbounded" type="tns:DeletedRecord"/>
- <element name="earliestDateAvailable" type="xsd:dateTime"/>
- <element name="latestDateCovered" type="xsd:dateTime"/>
- <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="DeletedRecord">
- <sequence>
- <element name="deletedDate" type="xsd:dateTime"/>
- <element name="id" type="tns:ID"/>
- </sequence>
- </complexType>
-
-
- <complexType name="GetServerTimestampResult">
- <sequence>
- <element name="timestamp" type="xsd:dateTime"/>
- </sequence>
- </complexType>
-
-
- <!-- InvalidateSessions Result -->
- <complexType name="InvalidateSessionsResult">
- <sequence>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="SetPasswordResult">
- </complexType>
-
- <complexType name="ResetPasswordResult">
- <sequence>
- <element name="password" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="GetUserInfoResult">
- <sequence>
- <element name="accessibilityMode" type="xsd:boolean"/>
- <element name="currencySymbol" type="xsd:string" nillable="true"/>
- <element name="orgDefaultCurrencyIsoCode" type="xsd:string" nillable="true"/>
- <element name="orgHasPersonAccounts" type="xsd:boolean"/>
- <element name="organizationId" type="tns:ID"/>
- <element name="organizationMultiCurrency" type="xsd:boolean"/>
- <element name="organizationName" type="xsd:string"/>
- <element name="profileId" type="tns:ID"/>
- <element name="roleId" type="tns:ID" nillable="true"/>
- <element name="userDefaultCurrencyIsoCode" type="xsd:string" nillable="true"/>
- <element name="userEmail" type="xsd:string"/>
- <element name="userFullName" type="xsd:string"/>
- <element name="userId" type="tns:ID"/>
- <element name="userLanguage" type="xsd:string"/>
- <element name="userLocale" type="xsd:string"/>
- <element name="userName" type="xsd:string"/>
- <element name="userTimeZone" type="xsd:string"/>
- <element name="userType" type="xsd:string"/>
- <element name="userUiSkin" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="LoginResult">
- <sequence>
- <element name="metadataServerUrl" type="xsd:string" nillable="true"/>
- <element name="passwordExpired" type="xsd:boolean" />
- <element name="sandbox" type="xsd:boolean"/>
- <element name="serverUrl" type="xsd:string" nillable="true"/>
- <element name="sessionId" type="xsd:string" nillable="true"/>
-
- <element name="userId" type="tns:ID" nillable="true"/>
- <element name="userInfo" type="tns:GetUserInfoResult" minOccurs="0"/>
- </sequence>
- </complexType>
-
- <simpleType name="StatusCode">
- <restriction base="xsd:string">
- <enumeration value="ALREADY_IN_PROCESS"/>
- <enumeration value="ASSIGNEE_TYPE_REQUIRED"/>
- <enumeration value="BAD_CUSTOM_ENTITY_PARENT_DOMAIN"/>
- <enumeration value="BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED"/>
- <enumeration value="CANNOT_CASCADE_PRODUCT_ACTIVE"/>
- <enumeration value="CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD"/>
- <enumeration value="CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE"/>
- <enumeration value="CANNOT_DEACTIVATE_DIVISION"/>
- <enumeration value="CANNOT_DELETE_LAST_DATED_CONVERSION_RATE"/>
- <enumeration value="CANNOT_DELETE_MANAGED_OBJECT"/>
- <enumeration value="CANNOT_DISABLE_LAST_ADMIN"/>
- <enumeration value="CANNOT_ENABLE_IP_RESTRICT_REQUESTS"/>
- <enumeration value="CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY"/>
- <enumeration value="CANNOT_MODIFY_MANAGED_OBJECT"/>
- <enumeration value="CANNOT_RENAME_APEX_REFERENCED_FIELD"/>
- <enumeration value="CANNOT_RENAME_APEX_REFERENCED_OBJECT"/>
- <enumeration value="CANNOT_REPARENT_RECORD"/>
- <enumeration value="CANNOT_UPDATE_CONVERTED_LEAD"/>
- <enumeration value="CANT_DISABLE_CORP_CURRENCY"/>
- <enumeration value="CANT_UNSET_CORP_CURRENCY"/>
- <enumeration value="CHILD_SHARE_FAILS_PARENT"/>
- <enumeration value="CIRCULAR_DEPENDENCY"/>
- <enumeration value="CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED"/>
- <enumeration value="CUSTOM_ENTITY_OR_FIELD_LIMIT"/>
- <enumeration value="CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED"/>
- <enumeration value="CUSTOM_INDEX_EXISTS"/>
- <enumeration value="CUSTOM_LINK_LIMIT_EXCEEDED"/>
- <enumeration value="CUSTOM_TAB_LIMIT_EXCEEDED"/>
- <enumeration value="DELETE_FAILED"/>
- <enumeration value="DELETE_REQUIRED_ON_CASCADE"/>
- <enumeration value="DEPENDENCY_EXISTS"/>
- <enumeration value="DUPLICATE_CASE_SOLUTION"/>
- <enumeration value="DUPLICATE_COMM_NICKNAME"/>
- <enumeration value="DUPLICATE_CUSTOM_ENTITY_DEFINITION"/>
- <enumeration value="DUPLICATE_CUSTOM_TAB_MOTIF"/>
- <enumeration value="DUPLICATE_DEVELOPER_NAME"/>
- <enumeration value="DUPLICATE_EXTERNAL_ID"/>
- <enumeration value="DUPLICATE_MASTER_LABEL"/>
- <enumeration value="DUPLICATE_USERNAME"/>
- <enumeration value="DUPLICATE_VALUE"/>
- <enumeration value="EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR"/>
- <enumeration value="EMPTY_SCONTROL_FILE_NAME"/>
- <enumeration value="ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE"/>
- <enumeration value="ENTITY_IS_ARCHIVED"/>
- <enumeration value="ENTITY_IS_DELETED"/>
- <enumeration value="ENTITY_IS_LOCKED"/>
- <enumeration value="ERROR_IN_MAILER"/>
- <enumeration value="FAILED_ACTIVATION"/>
- <enumeration value="FIELD_CUSTOM_VALIDATION_EXCEPTION"/>
- <enumeration value="FIELD_INTEGRITY_EXCEPTION"/>
- <enumeration value="HTML_FILE_UPLOAD_NOT_ALLOWED"/>
- <enumeration value="IMAGE_TOO_LARGE"/>
- <enumeration value="INACTIVE_OWNER_OR_USER"/>
- <enumeration value="INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY"/>
- <enumeration value="INSUFFICIENT_ACCESS_OR_READONLY"/>
- <enumeration value="INVALID_ACCESS_LEVEL"/>
- <enumeration value="INVALID_ARGUMENT_TYPE"/>
- <enumeration value="INVALID_ASSIGNEE_TYPE"/>
- <enumeration value="INVALID_ASSIGNMENT_RULE"/>
- <enumeration value="INVALID_BATCH_OPERATION"/>
- <enumeration value="INVALID_CREDIT_CARD_INFO"/>
- <enumeration value="INVALID_CROSS_REFERENCE_KEY"/>
- <enumeration value="INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD"/>
- <enumeration value="INVALID_CURRENCY_CONV_RATE"/>
- <enumeration value="INVALID_CURRENCY_CORP_RATE"/>
- <enumeration value="INVALID_CURRENCY_ISO"/>
- <enumeration value="INVALID_EMAIL_ADDRESS"/>
- <enumeration value="INVALID_EMPTY_KEY_OWNER"/>
- <enumeration value="INVALID_FIELD"/>
- <enumeration value="INVALID_FIELD_FOR_INSERT_UPDATE"/>
- <enumeration value="INVALID_FIELD_WHEN_USING_TEMPLATE"/>
- <enumeration value="INVALID_FILTER_ACTION"/>
- <enumeration value="INVALID_GOOGLE_DOCS_URL"/>
- <enumeration value="INVALID_ID_FIELD"/>
- <enumeration value="INVALID_INET_ADDRESS"/>
- <enumeration value="INVALID_LINEITEM_CLONE_STATE"/>
- <enumeration value="INVALID_MASTER_OR_TRANSLATED_SOLUTION"/>
- <enumeration value="INVALID_OPERATION"/>
- <enumeration value="INVALID_OPERATOR"/>
- <enumeration value="INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST"/>
- <enumeration value="INVALID_PARTNER_NETWORK_STATUS"/>
- <enumeration value="INVALID_PERSON_ACCOUNT_OPERATION"/>
- <enumeration value="INVALID_SAVE_AS_ACTIVITY_FLAG"/>
- <enumeration value="INVALID_SESSION_ID"/>
- <enumeration value="INVALID_SETUP_OWNER"/>
- <enumeration value="INVALID_STATUS"/>
- <enumeration value="INVALID_TYPE"/>
- <enumeration value="INVALID_TYPE_FOR_OPERATION"/>
- <enumeration value="INVALID_TYPE_ON_FIELD_IN_RECORD"/>
- <enumeration value="IP_RANGE_LIMIT_EXCEEDED"/>
- <enumeration value="LICENSE_LIMIT_EXCEEDED"/>
- <enumeration value="LIMIT_EXCEEDED"/>
- <enumeration value="MALFORMED_ID"/>
- <enumeration value="MANAGER_NOT_DEFINED"/>
- <enumeration value="MASSMAIL_RETRY_LIMIT_EXCEEDED"/>
- <enumeration value="MASS_MAIL_LIMIT_EXCEEDED"/>
- <enumeration value="MAXIMUM_CCEMAILS_EXCEEDED"/>
- <enumeration value="MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED"/>
- <enumeration value="MAXIMUM_HIERARCHY_LEVELS_REACHED"/>
- <enumeration value="MAXIMUM_SIZE_OF_ATTACHMENT"/>
- <enumeration value="MAXIMUM_SIZE_OF_DOCUMENT"/>
- <enumeration value="MAX_ACTIONS_PER_RULE_EXCEEDED"/>
- <enumeration value="MAX_ACTIVE_RULES_EXCEEDED"/>
- <enumeration value="MAX_APPROVAL_STEPS_EXCEEDED"/>
- <enumeration value="MAX_FORMULAS_PER_RULE_EXCEEDED"/>
- <enumeration value="MAX_RULES_EXCEEDED"/>
- <enumeration value="MAX_RULE_ENTRIES_EXCEEDED"/>
- <enumeration value="MAX_TASK_DESCRIPTION_EXCEEEDED"/>
- <enumeration value="MAX_TM_RULES_EXCEEDED"/>
- <enumeration value="MAX_TM_RULE_ITEMS_EXCEEDED"/>
- <enumeration value="MERGE_FAILED"/>
- <enumeration value="MISSING_ARGUMENT"/>
- <enumeration value="MIXED_DML_OPERATION"/>
- <enumeration value="NONUNIQUE_SHIPPING_ADDRESS"/>
- <enumeration value="NO_APPLICABLE_PROCESS"/>
- <enumeration value="NO_ATTACHMENT_PERMISSION"/>
- <enumeration value="NO_MASS_MAIL_PERMISSION"/>
- <enumeration value="NUMBER_OUTSIDE_VALID_RANGE"/>
- <enumeration value="NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED"/>
- <enumeration value="OPTED_OUT_OF_MASS_MAIL"/>
- <enumeration value="PACKAGE_LICENSE_REQUIRED"/>
- <enumeration value="PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT"/>
- <enumeration value="PRIVATE_CONTACT_ON_ASSET"/>
- <enumeration value="RECORD_IN_USE_BY_WORKFLOW"/>
- <enumeration value="REQUEST_RUNNING_TOO_LONG"/>
- <enumeration value="REQUIRED_FIELD_MISSING"/>
- <enumeration value="SELF_REFERENCE_FROM_TRIGGER"/>
- <enumeration value="SHARE_NEEDED_FOR_CHILD_OWNER"/>
- <enumeration value="STANDARD_PRICE_NOT_DEFINED"/>
- <enumeration value="STORAGE_LIMIT_EXCEEDED"/>
- <enumeration value="STRING_TOO_LONG"/>
- <enumeration value="TABSET_LIMIT_EXCEEDED"/>
- <enumeration value="TEMPLATE_NOT_ACTIVE"/>
- <enumeration value="TERRITORY_REALIGN_IN_PROGRESS"/>
- <enumeration value="TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET"/>
- <enumeration value="TOO_MANY_APEX_REQUESTS"/>
- <enumeration value="TOO_MANY_ENUM_VALUE"/>
- <enumeration value="TRANSFER_REQUIRES_READ"/>
- <enumeration value="UNABLE_TO_LOCK_ROW"/>
- <enumeration value="UNAVAILABLE_RECORDTYPE_EXCEPTION"/>
- <enumeration value="UNDELETE_FAILED"/>
- <enumeration value="UNKNOWN_EXCEPTION"/>
- <enumeration value="UNSPECIFIED_EMAIL_ADDRESS"/>
- <enumeration value="UNSUPPORTED_APEX_TRIGGER_OPERATON"/>
- <enumeration value="WEBLINK_SIZE_LIMIT_EXCEEDED"/>
- <enumeration value="WRONG_CONTROLLER_TYPE"/>
- </restriction>
- </simpleType>
-
-
- <complexType name="Error">
- <sequence>
- <element name="fields" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="message" type="xsd:string"/>
- <element name="statusCode" type="tns:StatusCode"/>
- </sequence>
- </complexType>
-
- <complexType name="SendEmailError">
- <sequence>
- <element name="fields" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="message" type="xsd:string"/>
- <element name="statusCode" type="tns:StatusCode"/>
- <element name="targetObjectId" type="tns:ID" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="SaveResult">
- <sequence>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="UpsertResult">
- <sequence>
- <element name="created" type="xsd:boolean"/>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="MergeRequest">
- <sequence>
- <element name="masterRecord" type="ens:sObject"/>
- <element name="recordToMergeIds" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="MergeResult">
- <sequence>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="mergedRecordIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
- <element name="success" type="xsd:boolean"/>
- <element name="updatedRelatedIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="ProcessRequest">
- <sequence>
- <element name="comments" type="xsd:string" nillable="true"/>
- <element name="nextApproverIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="ProcessSubmitRequest">
- <complexContent>
- <extension base="tns:ProcessRequest">
- <sequence>
- <element name="objectId" type="tns:ID"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="ProcessWorkitemRequest">
- <complexContent>
- <extension base="tns:ProcessRequest">
- <sequence>
- <element name="action" type="xsd:string"/>
- <element name="workitemId" type="tns:ID"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="ProcessResult">
- <sequence>
- <element name="actorIds" type="tns:ID" nillable="false" minOccurs="0" maxOccurs="unbounded"/>
- <element name="entityId" type="tns:ID" nillable="true"/>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="instanceId" type="tns:ID" nillable="true"/>
- <element name="instanceStatus" type="xsd:string" nillable="true"/>
- <element name="newWorkitemIds" type="tns:ID" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="DeleteResult">
- <sequence>
- <element name="errors" type="tns:Error" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="UndeleteResult">
- <sequence>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="EmptyRecycleBinResult">
- <sequence>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="LeadConvert">
- <sequence>
- <element name="accountId" type="tns:ID" nillable="true"/>
- <element name="contactId" type="tns:ID" nillable="true"/>
- <element name="convertedStatus" type="xsd:string"/>
- <element name="doNotCreateOpportunity" type="xsd:boolean"/>
- <element name="leadId" type="tns:ID"/>
- <element name="opportunityName" type="xsd:string" nillable="true"/>
- <element name="overwriteLeadSource" type="xsd:boolean"/>
- <element name="ownerId" type="tns:ID" nillable="true"/>
- <element name="sendNotificationEmail" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="LeadConvertResult">
- <sequence>
- <element name="accountId" type="tns:ID" nillable="true"/>
- <element name="contactId" type="tns:ID" nillable="true"/>
- <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
- <element name="leadId" type="tns:ID" nillable="true"/>
- <element name="opportunityId" type="tns:ID" nillable="true"/>
- <element name="success" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSObjectResult">
- <sequence>
- <element name="activateable" type="xsd:boolean"/>
- <element name="childRelationships" type="tns:ChildRelationship" minOccurs="0" maxOccurs="unbounded"/>
- <element name="createable" type="xsd:boolean"/>
- <element name="custom" type="xsd:boolean"/>
- <element name="deletable" type="xsd:boolean"/>
- <element name="fields" type="tns:Field" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="keyPrefix" type="xsd:string" nillable="true"/>
- <element name="label" type="xsd:string"/>
- <element name="labelPlural" type="xsd:string"/>
- <element name="layoutable" type="xsd:boolean"/>
- <element name="mergeable" type="xsd:boolean"/>
- <element name="name" type="xsd:string"/>
- <element name="queryable" type="xsd:boolean"/>
- <element name="recordTypeInfos" type="tns:RecordTypeInfo" minOccurs="0" maxOccurs="unbounded"/>
- <element name="replicateable" type="xsd:boolean"/>
- <element name="retrieveable" type="xsd:boolean"/>
- <element name="searchable" type="xsd:boolean" />
- <element name="triggerable" type="xsd:boolean" minOccurs="0"/>
- <element name="undeletable" type="xsd:boolean"/>
- <element name="updateable" type="xsd:boolean"/>
- <element name="urlDetail" type="xsd:string" nillable="true"/>
- <element name="urlEdit" type="xsd:string" nillable="true"/>
- <element name="urlNew" type="xsd:string" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="ChildRelationship">
- <sequence>
- <element name="cascadeDelete" type="xsd:boolean"/>
- <element name="childSObject" type="xsd:string"/>
- <element name="field" type="xsd:string"/>
- <element name="relationshipName" type="xsd:string" minOccurs="0"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeGlobalResult">
- <sequence>
- <element name="encoding" type="xsd:string" nillable="true"/>
- <element name="maxBatchSize" type="xsd:int"/>
- <element name="types" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <simpleType name="fieldType">
- <restriction base="xsd:string">
- <enumeration value="string"/>
- <enumeration value="picklist"/>
- <enumeration value="multipicklist"/>
- <enumeration value="combobox"/>
- <enumeration value="reference"/>
- <enumeration value="base64"/>
- <enumeration value="boolean"/>
- <enumeration value="currency"/>
- <enumeration value="textarea"/>
- <enumeration value="int"/>
- <enumeration value="double"/>
- <enumeration value="percent"/>
- <enumeration value="phone"/>
- <enumeration value="id"/>
- <enumeration value="date"/>
- <enumeration value="datetime"/>
- <enumeration value="time"/>
- <enumeration value="url"/>
- <enumeration value="email"/>
- <enumeration value="encryptedstring"/>
- <enumeration value="anyType"/> <!-- can be string, picklist, reference, boolean, currency, int, double, percent, id, date, datetime, url, email -->
- </restriction>
- </simpleType>
-
- <simpleType name="soapType">
- <restriction base="xsd:string">
- <enumeration value="tns:ID"/>
- <enumeration value="xsd:base64Binary"/>
- <enumeration value="xsd:boolean"/>
- <enumeration value="xsd:double"/>
- <enumeration value="xsd:int"/>
- <enumeration value="xsd:string"/>
- <enumeration value="xsd:date"/>
- <enumeration value="xsd:dateTime"/>
- <enumeration value="xsd:time"/>
- <enumeration value="xsd:anyType"/> <!-- can be id, booolean, double, int, string, date, dateTime -->
- </restriction>
- </simpleType>
-
- <complexType name="Field">
- <sequence>
- <element name="autoNumber" type="xsd:boolean"/>
- <element name="byteLength" type="xsd:int"/>
- <element name="calculated" type="xsd:boolean"/>
- <element name="calculatedFormula" type="xsd:string" minOccurs="0"/>
- <element name="caseSensitive" type="xsd:boolean"/>
- <element name="controllerName" type="xsd:string" minOccurs="0"/>
- <element name="createable" type="xsd:boolean"/>
- <element name="custom" type="xsd:boolean"/>
- <element name="defaultValueFormula" type="xsd:string" minOccurs="0"/>
- <element name="defaultedOnCreate" type="xsd:boolean"/>
- <element name="dependentPicklist" type="xsd:boolean" minOccurs="0"/>
- <element name="digits" type="xsd:int"/>
- <element name="externalId" type="xsd:boolean" minOccurs="0"/>
- <element name="filterable" type="xsd:boolean"/>
- <element name="htmlFormatted" type="xsd:boolean" minOccurs="0"/>
- <element name="idLookup" type="xsd:boolean"/>
- <element name="inlineHelpText" type="xsd:string" minOccurs="0"/>
- <element name="label" type="xsd:string"/>
- <element name="length" type="xsd:int"/>
- <element name="name" type="xsd:string"/>
- <element name="nameField" type="xsd:boolean"/>
- <element name="namePointing" type="xsd:boolean" minOccurs="0"/>
- <element name="nillable" type="xsd:boolean"/>
- <element name="picklistValues" type="tns:PicklistEntry" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="precision" type="xsd:int"/>
- <element name="referenceTo" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="relationshipName" type="xsd:string" minOccurs="0"/>
- <element name="relationshipOrder" type="xsd:int" minOccurs="0"/>
- <element name="restrictedPicklist" type="xsd:boolean"/>
- <element name="scale" type="xsd:int"/>
- <element name="soapType" type="tns:soapType"/>
- <element name="sortable" type="xsd:boolean" minOccurs="0"/>
- <element name="type" type="tns:fieldType"/>
- <element name="unique" type="xsd:boolean"/>
- <element name="updateable" type="xsd:boolean"/>
- <element name="writeRequiresMasterRead" type="xsd:boolean" minOccurs="0"/>
- </sequence>
- </complexType>
-
- <complexType name="PicklistEntry">
- <sequence>
- <element name="active" type="xsd:boolean"/>
- <element name="defaultValue" type="xsd:boolean"/>
- <element name="label" type="xsd:string" nillable="true"/>
- <element name="validFor" type="xsd:base64Binary" minOccurs="0"/>
- <element name="value" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSoftphoneLayoutResult">
- <sequence>
- <element name="callTypes" type="tns:DescribeSoftphoneLayoutCallType" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID"/>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSoftphoneLayoutCallType">
- <sequence>
- <element name="infoFields" type="tns:DescribeSoftphoneLayoutInfoField" maxOccurs="unbounded"/>
- <element name="name" type="xsd:string"/>
- <element name="sections" type="tns:DescribeSoftphoneLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSoftphoneLayoutInfoField">
- <sequence>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSoftphoneLayoutSection">
- <sequence>
- <element name="entityApiName" type="xsd:string"/>
- <element name="items" type="tns:DescribeSoftphoneLayoutItem" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeSoftphoneLayoutItem">
- <sequence>
- <element name="itemApiName" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutResult">
- <sequence>
- <element name="layouts" type="tns:DescribeLayout" maxOccurs="unbounded"/>
- <element name="recordTypeMappings" type="tns:RecordTypeMapping" minOccurs="0" maxOccurs="unbounded"/>
- <element name="recordTypeSelectorRequired" type="xsd:boolean" />
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayout">
- <sequence>
- <element name="buttonLayoutSection" type="tns:DescribeLayoutButtonSection" minOccurs="0"/>
- <element name="detailLayoutSections" type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
- <element name="editLayoutSections" type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
- <element name="id" type="tns:ID"/>
-
-
- <element name="relatedLists" type="tns:RelatedList" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutSection">
- <sequence>
- <element name="columns" type="xsd:int"/>
- <element name="heading" type="xsd:string"/>
- <element name="layoutRows" type="tns:DescribeLayoutRow" maxOccurs="unbounded"/>
- <element name="rows" type="xsd:int"/>
- <element name="useCollapsibleSection" type="xsd:boolean"/>
- <element name="useHeading" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutButtonSection">
- <sequence>
- <element name="detailButtons" type="tns:DescribeLayoutButton" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutRow">
- <sequence>
- <element name="layoutItems" type="tns:DescribeLayoutItem" maxOccurs="unbounded"/>
- <element name="numItems" type="xsd:int"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutItem">
- <sequence>
- <element name="editable" type="xsd:boolean"/>
- <element name="label" type="xsd:string" nillable="true"/>
- <element name="layoutComponents" type="tns:DescribeLayoutComponent" minOccurs="0" maxOccurs="unbounded"/>
- <element name="placeholder" type="xsd:boolean"/>
- <element name="required" type="xsd:boolean"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutButton">
- <sequence>
- <element name="custom" type="xsd:boolean"/>
- <element name="label" type="xsd:string" nillable="true"/>
- <element name="name" type="xsd:string" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeLayoutComponent">
- <sequence>
- <element name="displayLines" type="xsd:int"/>
- <element name="tabOrder" type="xsd:int"/>
- <element name="type" type="tns:layoutComponentType"/>
- <element name="value" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <simpleType name="layoutComponentType">
- <restriction base="xsd:string">
- <enumeration value="Field"/>
- <enumeration value="Separator"/>
- <enumeration value="SControl"/>
- <enumeration value="EmptySpace"/>
- </restriction>
- </simpleType>
-
- <complexType name="RecordTypeInfo">
- <sequence>
- <element name="available" type="xsd:boolean"/>
- <element name="defaultRecordTypeMapping" type="xsd:boolean"/>
- <element name="name" type="xsd:string"/>
- <element name="recordTypeId" type="tns:ID" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="RecordTypeMapping">
- <sequence>
- <element name="available" type="xsd:boolean"/>
- <element name="defaultRecordTypeMapping" type="xsd:boolean"/>
- <element name="layoutId" type="tns:ID"/>
- <element name="name" type="xsd:string"/>
- <element name="picklistsForRecordType" type="tns:PicklistForRecordType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- <element name="recordTypeId" type="tns:ID" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="PicklistForRecordType">
- <sequence>
- <element name="picklistName" type="xsd:string"/>
- <element name="picklistValues" type="tns:PicklistEntry" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="RelatedList">
- <sequence>
- <element name="columns" type="tns:RelatedListColumn" maxOccurs="unbounded"/>
- <element name="custom" type="xsd:boolean"/>
- <element name="field" type="xsd:string" nillable="true"/>
- <element name="label" type="xsd:string"/>
- <element name="limitRows" type="xsd:int"/>
- <element name="name" type="xsd:string"/>
- <element name="sobject" type="xsd:string" nillable="true"/>
- <element name="sort" type="tns:RelatedListSort" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="RelatedListColumn">
- <sequence>
- <element name="field" type="xsd:string" nillable="true"/>
- <element name="format" type="xsd:string" nillable="true"/>
- <element name="label" type="xsd:string"/>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
-
- <complexType name="RelatedListSort">
- <sequence>
- <element name="ascending" type="xsd:boolean"/>
- <element name="column" type="xsd:string"/>
- </sequence>
- </complexType>
-
-
-
- <complexType name="EmailFileAttachment">
- <sequence>
- <element name="body" nillable="true" minOccurs="0" type="xsd:base64Binary"/>
- <element name="fileName" type="xsd:string" />
- </sequence>
- </complexType>
- <simpleType name="EmailPriority">
- <restriction base="xsd:string">
- <enumeration value="Highest"/>
- <enumeration value="High"/>
- <enumeration value="Normal"/>
- <enumeration value="Low"/>
- <enumeration value="Lowest"/>
- </restriction>
- </simpleType>
-
- <complexType name="Email">
- <sequence>
- <element name="bccSender" type="xsd:boolean" nillable="true"/>
- <element name="emailPriority" type="tns:EmailPriority" nillable="true"/>
- <element name="replyTo" type="xsd:string" nillable="true"/>
- <element name="saveAsActivity" type="xsd:boolean" nillable="true"/>
- <element name="senderDisplayName" type="xsd:string" nillable="true"/>
- <element name="subject" type="xsd:string" nillable="true"/>
- <element name="useSignature" type="xsd:boolean" nillable="true"/>
- </sequence>
- </complexType>
-
- <complexType name="MassEmailMessage">
- <complexContent>
- <extension base="tns:Email">
- <sequence>
- <element name="description" type="xsd:string" nillable="true"/>
- <element name="targetObjectIds" minOccurs="0" maxOccurs="250" type="tns:ID" />
- <element name="templateId" type="tns:ID"/>
- <element name="whatIds" minOccurs="0" maxOccurs="250" type="tns:ID" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="SingleEmailMessage">
- <complexContent>
- <extension base="tns:Email">
- <sequence>
- <element name="bccAddresses" minOccurs="0" maxOccurs="5" type="xsd:string" nillable="true"/>
- <element name="ccAddresses" minOccurs="0" maxOccurs="5" type="xsd:string" nillable="true"/>
- <element name="charset" type="xsd:string" nillable="true"/>
- <element name="documentAttachments" minOccurs="0" maxOccurs="unbounded" type="tns:ID" />
- <element name="htmlBody" type="xsd:string" nillable="true"/>
- <element name="fileAttachments" minOccurs="0" maxOccurs="unbounded" type="tns:EmailFileAttachment"/>
- <element name="plainTextBody" type="xsd:string" nillable="true"/>
- <element name="targetObjectId" type="tns:ID" nillable="true"/>
- <element name="templateId" type="tns:ID" nillable="true"/>
- <element name="toAddresses" minOccurs="0" maxOccurs="10" type="xsd:string" nillable="true"/>
- <element name="whatId" type="tns:ID" nillable="true"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="SendEmailResult">
- <sequence>
- <element name="errors" minOccurs="0" maxOccurs="unbounded" type="tns:SendEmailError" />
- <element name="success" type="xsd:boolean" />
- </sequence>
- </complexType>
-
-
-
- <complexType name="DescribeTabSetResult">
- <sequence>
- <element name="label" type="xsd:string" />
- <element name="logoUrl" type="xsd:string" />
- <element name="namespace" type="xsd:string" minOccurs="0"/>
- <element name="selected" type="xsd:boolean" />
- <element name="tabs" type="tns:DescribeTab" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="DescribeTab">
- <sequence>
- <element name="custom" type="xsd:boolean" />
- <element name="iconUrl" type="xsd:string" />
- <element name="label" type="xsd:string" />
- <element name="miniIconUrl" type="xsd:string" />
- <element name="sobjectName" type="xsd:string" nillable="true" />
- <element name="url" type="xsd:string" />
- </sequence>
- </complexType>
-
-
-
-
-
- <!-- Login Message Types -->
- <element name="login">
- <complexType>
- <sequence>
- <element name="username" type="xsd:string"/>
- <element name="password" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="loginResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:LoginResult"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Describe Message Types -->
- <element name="describeSObject">
- <complexType>
- <sequence>
- <element name="sObjectType" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="describeSObjectResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeSObjectResult" nillable="true"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- DescibeSObjects Message Types -->
- <element name="describeSObjects">
- <complexType>
- <sequence>
- <element name="sObjectType" type="xsd:string" minOccurs='0' maxOccurs='100' />
- </sequence>
- </complexType>
- </element>
- <element name="describeSObjectsResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeSObjectResult" nillable="true" minOccurs='0' maxOccurs='100'/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Describe Global Message Types -->
- <element name="describeGlobal">
- <complexType>
- <sequence/>
- </complexType>
- </element>
- <element name="describeGlobalResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeGlobalResult"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="describeLayout">
- <complexType>
- <sequence>
- <element name="sObjectType" type="xsd:string"/>
- <element name="recordTypeIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="describeLayoutResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeLayoutResult" nillable="true"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="describeSoftphoneLayout">
- <complexType>
- <sequence/>
- </complexType>
- </element>
- <element name="describeSoftphoneLayoutResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeSoftphoneLayoutResult" nillable="true"/>
- </sequence>
- </complexType>
- </element>
-
-
- <element name="describeTabs">
- <complexType>
- <sequence/>
- </complexType>
- </element>
- <element name="describeTabsResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DescribeTabSetResult" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Create Message Types -->
- <element name="create">
- <complexType>
- <sequence>
- <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="createResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:SaveResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
-
-
- <!-- Send Email Types -->
- <element name="sendEmail">
- <complexType>
- <sequence>
- <element name="messages" type="tns:Email" minOccurs="0" maxOccurs="10"/>
- </sequence>
- </complexType>
- </element>
- <element name="sendEmailResponse">
- <complexType>
- <sequence>
- <element name="result" minOccurs="0" maxOccurs="10" type="tns:SendEmailResult"/>
- </sequence>
- </complexType>
- </element>
-
-
- <!-- Update Message Types -->
- <element name="update">
- <complexType>
- <sequence>
- <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="updateResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:SaveResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Upsert Message Types -->
- <element name="upsert">
- <complexType>
- <sequence>
- <element name="externalIDFieldName" type="xsd:string"/>
- <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="upsertResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:UpsertResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Merge Message Types -->
- <element name="merge">
- <complexType>
- <sequence>
- <element name="request" type="tns:MergeRequest" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="mergeResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:MergeResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Delete Message Types -->
- <element name="delete">
- <complexType>
- <sequence>
- <element name="ids" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="deleteResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:DeleteResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Undelete Message Types -->
- <element name="undelete">
- <complexType>
- <sequence>
- <element name="ids" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="undeleteResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:UndeleteResult" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- EmptyRecycleBin Message Types -->
- <element name="emptyRecycleBin">
- <complexType>
- <sequence>
- <element name="ids" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="emptyRecycleBinResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:EmptyRecycleBinResult" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Process Message Types -->
- <element name="process">
- <complexType>
- <sequence>
- <element name="actions" type="tns:ProcessRequest" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="processResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:ProcessResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Retrieve (ID List) Message Types -->
- <element name="retrieve">
- <complexType>
- <sequence>
- <element name="fieldList" type="xsd:string"/>
- <element name="sObjectType" type="xsd:string"/>
- <element name="ids" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="retrieveResponse">
- <complexType>
- <sequence>
- <element name="result" type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Convert Lead Message Types -->
- <element name="convertLead">
- <complexType>
- <sequence>
- <element name="leadConverts" type="tns:LeadConvert" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
- <element name="convertLeadResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:LeadConvertResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Get Updated Message Types -->
- <element name="getUpdated">
- <complexType>
- <sequence>
- <element name="sObjectType" type="xsd:string"/>
- <element name="startDate" type="xsd:dateTime"/>
- <element name="endDate" type="xsd:dateTime"/>
- </sequence>
- </complexType>
- </element>
- <element name="getUpdatedResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:GetUpdatedResult"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Get Deleted Message Types -->
- <element name="getDeleted">
- <complexType>
- <sequence>
- <element name="sObjectType" type="xsd:string"/>
- <element name="startDate" type="xsd:dateTime"/>
- <element name="endDate" type="xsd:dateTime"/>
- </sequence>
- </complexType>
- </element>
- <element name="getDeletedResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:GetDeletedResult"/>
- </sequence>
- </complexType>
- </element>
-
-
- <!-- Logout current session -->
- <element name="logout">
- <complexType>
- </complexType>
- </element>
-
- <element name="logoutResponse">
- <complexType>
- </complexType>
- </element>
-
- <!-- Invalidate a list of session ids -->
- <element name="invalidateSessions">
- <complexType>
- <sequence>
- <element name="sessionIds" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="invalidateSessionsResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:InvalidateSessionsResult" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Create Query -->
- <element name="query">
- <complexType>
- <sequence>
- <element name="queryString" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="queryResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:QueryResult"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Create Query All -->
- <element name="queryAll">
- <complexType>
- <sequence>
- <element name="queryString" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="queryAllResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:QueryResult"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Next Batch of sObjects from a query -->
- <element name="queryMore">
- <complexType>
- <sequence>
- <element name="queryLocator" type="tns:QueryLocator"/>
- </sequence>
- </complexType>
- </element>
- <element name="queryMoreResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:QueryResult"/>
- </sequence>
- </complexType>
- </element>
-
-
-
- <!-- Create Search -->
- <element name="search">
- <complexType>
- <sequence>
- <element name="searchString" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="searchResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:SearchResult"/>
- </sequence>
- </complexType>
- </element>
-
-
-
- <element name="getServerTimestamp">
- <complexType>
- <sequence/>
- </complexType>
- </element>
- <element name="getServerTimestampResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:GetServerTimestampResult"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="setPassword">
- <complexType>
- <sequence>
- <element name="userId" type="tns:ID"/>
- <element name="password" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="setPasswordResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:SetPasswordResult"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="resetPassword">
- <complexType>
- <sequence>
- <element name="userId" type="tns:ID"/>
- </sequence>
- </complexType>
- </element>
- <element name="resetPasswordResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:ResetPasswordResult"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="getUserInfo">
- <complexType>
- <sequence/>
- </complexType>
- </element>
- <element name="getUserInfoResponse">
- <complexType>
- <sequence>
- <element name="result" type="tns:GetUserInfoResult"/>
- </sequence>
- </complexType>
- </element>
-
-
-
- <!-- Header Elements -->
- <element name="SessionHeader">
- <complexType>
- <sequence>
- <element name="sessionId" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="LoginScopeHeader">
- <complexType>
- <sequence>
- <element name="organizationId" type="tns:ID"/>
- <element name="portalId" type="tns:ID" minOccurs="0"/>
- </sequence>
- </complexType>
- </element>
-
-
- <element name="CallOptions">
- <complexType>
- <sequence>
- <element name="client" type="xsd:string" nillable="true"/>
- <element name="defaultNamespace" type="xsd:string" nillable="true"/>
-
- </sequence>
- </complexType>
- </element>
-
-
- <element name="QueryOptions">
- <complexType>
- <sequence>
- <element name="batchSize" type="xsd:int" minOccurs="0"/>
-
- </sequence>
- </complexType>
- </element>
-
-
- <simpleType name="DebugLevel">
- <restriction base="xsd:string">
- <enumeration value="None"/>
- <enumeration value="DebugOnly"/>
- <enumeration value="Db"/>
- </restriction>
- </simpleType>
- <element name="DebuggingHeader">
- <complexType>
- <sequence>
- <element name="debugLevel" type="tns:DebugLevel"/>
- </sequence>
- </complexType>
- </element>
- <element name="DebuggingInfo">
- <complexType>
- <sequence>
- <element name="debugLog" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="AllowFieldTruncationHeader">
- <complexType>
- <sequence>
- <element name="allowFieldTruncation" type="xsd:boolean" />
- </sequence>
- </complexType>
- </element>
-
- <!-- ideally this could of just been elem name="..." type="xsd:boolean"
- but is required to be nested within a complexType for .NET 1.1 compatibility -->
- <element name="MruHeader">
- <complexType>
- <sequence>
- <element name="updateMru" type="xsd:boolean" />
- </sequence>
- </complexType>
- </element>
-
- <element name="EmailHeader">
- <complexType>
- <sequence>
- <element name="triggerAutoResponseEmail" type="xsd:boolean"/>
- <element name="triggerOtherEmail" type="xsd:boolean"/>
- <element name="triggerUserEmail" type="xsd:boolean"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="AssignmentRuleHeader">
- <complexType>
- <sequence>
- <element name="assignmentRuleId" type="tns:ID" nillable="true" />
- <element name="useDefaultRule" type="xsd:boolean" nillable="true" />
- </sequence>
- </complexType>
- </element>
-
- <element name="UserTerritoryDeleteHeader">
- <complexType>
- <sequence>
- <element name="transferToUserId" type="tns:ID" nillable="true"/>
- </sequence>
- </complexType>
- </element>
-
-
-
- <element name="LocaleOptions">
- <complexType>
- <sequence>
- <element name="language" type="xsd:string" minOccurs="0"/>
- </sequence>
- </complexType>
- </element>
- </schema>
-
- <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:fault.partner.soap.sforce.com" xmlns:fns="urn:fault.partner.soap.sforce.com">
-
- <simpleType name="ExceptionCode">
- <restriction base="xsd:string">
- <enumeration value="API_CURRENTLY_DISABLED"/>
- <enumeration value="API_DISABLED_FOR_ORG"/>
- <enumeration value="CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY"/>
- <enumeration value="CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY"/>
- <enumeration value="CIRCULAR_OBJECT_GRAPH"/>
- <enumeration value="CLIENT_NOT_ACCESSIBLE_FOR_USER"/>
- <enumeration value="CLIENT_REQUIRE_UPDATE_FOR_USER"/>
- <enumeration value="CUSTOM_METADATA_LIMIT_EXCEEDED"/>
- <enumeration value="DUPLICATE_VALUE"/>
- <enumeration value="EMAIL_BATCH_SIZE_LIMIT_EXCEEDED"/>
- <enumeration value="EMAIL_TO_CASE_INVALID_ROUTING"/>
- <enumeration value="EMAIL_TO_CASE_LIMIT_EXCEEDED"/>
- <enumeration value="EMAIL_TO_CASE_NOT_ENABLED"/>
- <enumeration value="EXCEEDED_ID_LIMIT"/>
- <enumeration value="EXCEEDED_LEAD_CONVERT_LIMIT"/>
- <enumeration value="EXCEEDED_MAX_SIZE_REQUEST"/>
- <enumeration value="EXCEEDED_MAX_TYPES_LIMIT"/>
- <enumeration value="EXCEEDED_QUOTA"/>
- <enumeration value="FUNCTIONALITY_NOT_ENABLED"/>
- <enumeration value="INACTIVE_OWNER_OR_USER"/>
- <enumeration value="INACTIVE_PORTAL"/>
- <enumeration value="INSUFFICIENT_ACCESS"/>
- <enumeration value="INVALID_ASSIGNMENT_RULE"/>
- <enumeration value="INVALID_BATCH_SIZE"/>
- <enumeration value="INVALID_CLIENT"/>
- <enumeration value="INVALID_CROSS_REFERENCE_KEY"/>
- <enumeration value="INVALID_FIELD"/>
- <enumeration value="INVALID_FILTER_LANGUAGE"/>
- <enumeration value="INVALID_FILTER_VALUE"/>
- <enumeration value="INVALID_ID_FIELD"/>
- <enumeration value="INVALID_LOCALE_LANGUAGE"/>
- <enumeration value="INVALID_LOCATOR"/>
- <enumeration value="INVALID_LOGIN"/>
- <enumeration value="INVALID_NEW_PASSWORD"/>
- <enumeration value="INVALID_OPERATION"/>
- <enumeration value="INVALID_OPERATION_WITH_EXPIRED_PASSWORD"/>
- <enumeration value="INVALID_QUERY_FILTER_OPERATOR"/>
- <enumeration value="INVALID_QUERY_LOCATOR"/>
- <enumeration value="INVALID_QUERY_SCOPE"/>
- <enumeration value="INVALID_REPLICATION_DATE"/>
- <enumeration value="INVALID_SEARCH"/>
- <enumeration value="INVALID_SEARCH_SCOPE"/>
- <enumeration value="INVALID_SESSION_ID"/>
- <enumeration value="INVALID_SOAP_HEADER"/>
- <enumeration value="INVALID_SSO_GATEWAY_URL"/>
- <enumeration value="INVALID_TYPE"/>
- <enumeration value="INVALID_TYPE_FOR_OPERATION"/>
- <enumeration value="LIMIT_EXCEEDED"/>
- <enumeration value="LOGIN_CHALLENGE_ISSUED"/>
- <enumeration value="LOGIN_CHALLENGE_PENDING"/>
- <enumeration value="LOGIN_DURING_RESTRICTED_DOMAIN"/>
- <enumeration value="LOGIN_DURING_RESTRICTED_TIME"/>
- <enumeration value="LOGIN_MUST_USE_SECURITY_TOKEN"/>
- <enumeration value="MALFORMED_ID"/>
- <enumeration value="MALFORMED_QUERY"/>
- <enumeration value="MALFORMED_SEARCH"/>
- <enumeration value="MISSING_ARGUMENT"/>
- <enumeration value="NOT_MODIFIED"/>
- <enumeration value="NO_SOFTPHONE_LAYOUT"/>
- <enumeration value="NUMBER_OUTSIDE_VALID_RANGE"/>
- <enumeration value="OPERATION_TOO_LARGE"/>
- <enumeration value="ORG_LOCKED"/>
- <enumeration value="ORG_NOT_OWNED_BY_INSTANCE"/>
- <enumeration value="PASSWORD_LOCKOUT"/>
- <enumeration value="PORTAL_NO_ACCESS"/>
- <enumeration value="QUERY_TIMEOUT"/>
- <enumeration value="QUERY_TOO_COMPLICATED"/>
- <enumeration value="REQUEST_LIMIT_EXCEEDED"/>
- <enumeration value="REQUEST_RUNNING_TOO_LONG"/>
- <enumeration value="SERVER_UNAVAILABLE"/>
- <enumeration value="SSO_SERVICE_DOWN"/>
- <enumeration value="TOO_MANY_APEX_REQUESTS"/>
- <enumeration value="TRIAL_EXPIRED"/>
- <enumeration value="UNKNOWN_EXCEPTION"/>
- <enumeration value="UNSUPPORTED_API_VERSION"/>
- <enumeration value="UNSUPPORTED_CLIENT"/>
- </restriction>
- </simpleType>
- <!-- For convenience these QNames are returned in the standard soap faultcode element -->
- <simpleType name="FaultCode">
- <restriction base="xsd:QName">
- <enumeration value="fns:API_CURRENTLY_DISABLED"/>
- <enumeration value="fns:API_DISABLED_FOR_ORG"/>
- <enumeration value="fns:CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY"/>
- <enumeration value="fns:CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY"/>
- <enumeration value="fns:CIRCULAR_OBJECT_GRAPH"/>
- <enumeration value="fns:CLIENT_NOT_ACCESSIBLE_FOR_USER"/>
- <enumeration value="fns:CLIENT_REQUIRE_UPDATE_FOR_USER"/>
- <enumeration value="fns:CUSTOM_METADATA_LIMIT_EXCEEDED"/>
- <enumeration value="fns:DUPLICATE_VALUE"/>
- <enumeration value="fns:EMAIL_BATCH_SIZE_LIMIT_EXCEEDED"/>
- <enumeration value="fns:EMAIL_TO_CASE_INVALID_ROUTING"/>
- <enumeration value="fns:EMAIL_TO_CASE_LIMIT_EXCEEDED"/>
- <enumeration value="fns:EMAIL_TO_CASE_NOT_ENABLED"/>
- <enumeration value="fns:EXCEEDED_ID_LIMIT"/>
- <enumeration value="fns:EXCEEDED_LEAD_CONVERT_LIMIT"/>
- <enumeration value="fns:EXCEEDED_MAX_SIZE_REQUEST"/>
- <enumeration value="fns:EXCEEDED_MAX_TYPES_LIMIT"/>
- <enumeration value="fns:EXCEEDED_QUOTA"/>
- <enumeration value="fns:FUNCTIONALITY_NOT_ENABLED"/>
- <enumeration value="fns:INACTIVE_OWNER_OR_USER"/>
- <enumeration value="fns:INACTIVE_PORTAL"/>
- <enumeration value="fns:INSUFFICIENT_ACCESS"/>
- <enumeration value="fns:INVALID_ASSIGNMENT_RULE"/>
- <enumeration value="fns:INVALID_BATCH_SIZE"/>
- <enumeration value="fns:INVALID_CLIENT"/>
- <enumeration value="fns:INVALID_CROSS_REFERENCE_KEY"/>
- <enumeration value="fns:INVALID_FIELD"/>
- <enumeration value="fns:INVALID_FILTER_LANGUAGE"/>
- <enumeration value="fns:INVALID_FILTER_VALUE"/>
- <enumeration value="fns:INVALID_ID_FIELD"/>
- <enumeration value="fns:INVALID_LOCALE_LANGUAGE"/>
- <enumeration value="fns:INVALID_LOCATOR"/>
- <enumeration value="fns:INVALID_LOGIN"/>
- <enumeration value="fns:INVALID_NEW_PASSWORD"/>
- <enumeration value="fns:INVALID_OPERATION"/>
- <enumeration value="fns:INVALID_OPERATION_WITH_EXPIRED_PASSWORD"/>
- <enumeration value="fns:INVALID_QUERY_FILTER_OPERATOR"/>
- <enumeration value="fns:INVALID_QUERY_LOCATOR"/>
- <enumeration value="fns:INVALID_QUERY_SCOPE"/>
- <enumeration value="fns:INVALID_REPLICATION_DATE"/>
- <enumeration value="fns:INVALID_SEARCH"/>
- <enumeration value="fns:INVALID_SEARCH_SCOPE"/>
- <enumeration value="fns:INVALID_SESSION_ID"/>
- <enumeration value="fns:INVALID_SOAP_HEADER"/>
- <enumeration value="fns:INVALID_SSO_GATEWAY_URL"/>
- <enumeration value="fns:INVALID_TYPE"/>
- <enumeration value="fns:INVALID_TYPE_FOR_OPERATION"/>
- <enumeration value="fns:LIMIT_EXCEEDED"/>
- <enumeration value="fns:LOGIN_CHALLENGE_ISSUED"/>
- <enumeration value="fns:LOGIN_CHALLENGE_PENDING"/>
- <enumeration value="fns:LOGIN_DURING_RESTRICTED_DOMAIN"/>
- <enumeration value="fns:LOGIN_DURING_RESTRICTED_TIME"/>
- <enumeration value="fns:LOGIN_MUST_USE_SECURITY_TOKEN"/>
- <enumeration value="fns:MALFORMED_ID"/>
- <enumeration value="fns:MALFORMED_QUERY"/>
- <enumeration value="fns:MALFORMED_SEARCH"/>
- <enumeration value="fns:MISSING_ARGUMENT"/>
- <enumeration value="fns:NOT_MODIFIED"/>
- <enumeration value="fns:NO_SOFTPHONE_LAYOUT"/>
- <enumeration value="fns:NUMBER_OUTSIDE_VALID_RANGE"/>
- <enumeration value="fns:OPERATION_TOO_LARGE"/>
- <enumeration value="fns:ORG_LOCKED"/>
- <enumeration value="fns:ORG_NOT_OWNED_BY_INSTANCE"/>
- <enumeration value="fns:PASSWORD_LOCKOUT"/>
- <enumeration value="fns:PORTAL_NO_ACCESS"/>
- <enumeration value="fns:QUERY_TIMEOUT"/>
- <enumeration value="fns:QUERY_TOO_COMPLICATED"/>
- <enumeration value="fns:REQUEST_LIMIT_EXCEEDED"/>
- <enumeration value="fns:REQUEST_RUNNING_TOO_LONG"/>
- <enumeration value="fns:SERVER_UNAVAILABLE"/>
- <enumeration value="fns:SSO_SERVICE_DOWN"/>
- <enumeration value="fns:TOO_MANY_APEX_REQUESTS"/>
- <enumeration value="fns:TRIAL_EXPIRED"/>
- <enumeration value="fns:UNKNOWN_EXCEPTION"/>
- <enumeration value="fns:UNSUPPORTED_API_VERSION"/>
- <enumeration value="fns:UNSUPPORTED_CLIENT"/>
- </restriction>
- </simpleType>
-
-
- <!-- Fault -->
- <complexType name="ApiFault">
- <sequence>
- <element name="exceptionCode" type="fns:ExceptionCode"/>
- <element name="exceptionMessage" type="xsd:string"/>
-
- </sequence>
- </complexType>
-
- <element name="fault" type="fns:ApiFault" />
-
- <complexType name="ApiQueryFault">
- <complexContent>
- <extension base="fns:ApiFault">
- <sequence>
- <element name="row" type="xsd:int"/>
- <element name="column" type="xsd:int"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="LoginFault">
- <complexContent>
- <extension base="fns:ApiFault"/>
- </complexContent>
- </complexType>
- <element name="LoginFault" type="fns:LoginFault"/>
-
- <complexType name="InvalidQueryLocatorFault">
- <complexContent>
- <extension base="fns:ApiFault"/>
- </complexContent>
- </complexType>
- <element name="InvalidQueryLocatorFault" type="fns:InvalidQueryLocatorFault"/>
-
- <complexType name="InvalidNewPasswordFault">
- <complexContent>
- <extension base="fns:ApiFault"/>
- </complexContent>
- </complexType>
- <element name="InvalidNewPasswordFault" type="fns:InvalidNewPasswordFault"/>
-
- <complexType name="InvalidIdFault">
- <complexContent>
- <extension base="fns:ApiFault"/>
- </complexContent>
- </complexType>
- <element name="InvalidIdFault" type="fns:InvalidIdFault"/>
-
- <complexType name="UnexpectedErrorFault">
- <complexContent>
- <extension base="fns:ApiFault"/>
- </complexContent>
- </complexType>
- <element name="UnexpectedErrorFault" type="fns:UnexpectedErrorFault"/>
-
- <complexType name="InvalidFieldFault">
- <complexContent>
- <extension base="fns:ApiQueryFault"/>
- </complexContent>
- </complexType>
- <element name="InvalidFieldFault" type="fns:InvalidFieldFault"/>
-
- <complexType name="InvalidSObjectFault">
- <complexContent>
- <extension base="fns:ApiQueryFault"/>
- </complexContent>
- </complexType>
- <element name="InvalidSObjectFault" type="fns:InvalidSObjectFault"/>
-
- <complexType name="MalformedQueryFault">
- <complexContent>
- <extension base="fns:ApiQueryFault"/>
- </complexContent>
- </complexType>
- <element name="MalformedQueryFault" type="fns:MalformedQueryFault"/>
-
- <complexType name="MalformedSearchFault">
- <complexContent>
- <extension base="fns:ApiQueryFault"/>
- </complexContent>
- </complexType>
- <element name="MalformedSearchFault" type="fns:MalformedSearchFault"/>
-
-
- </schema>
- </types>
-
- <!-- Header Message -->
- <message name="Header">
- <part element="tns:LoginScopeHeader" name="LoginScopeHeader"/>
- <part element="tns:SessionHeader" name="SessionHeader"/>
-
- <part element="tns:CallOptions" name="CallOptions"/>
-
- <part element="tns:QueryOptions" name="QueryOptions"/>
- <part element="tns:AssignmentRuleHeader" name="AssignmentRuleHeader"/>
- <part element="tns:AllowFieldTruncationHeader" name="AllowFieldTruncationHeader"/>
- <part element="tns:MruHeader" name="MruHeader"/>
- <part element="tns:EmailHeader" name="EmailHeader"/>
-
- <part element="tns:UserTerritoryDeleteHeader" name="UserTerritoryDeleteHeader"/>
-
- <part element="tns:DebuggingHeader" name="DebuggingHeader"/>
- <part element="tns:DebuggingInfo" name="DebuggingInfo"/>
- <part element="tns:LocaleOptions" name="LocaleOptions"/>
- </message>
-
- <!-- Fault Messages -->
-
- <message name="ApiFault">
- <part name="fault" element="fns:fault"/>
- </message>
-
- <message name="LoginFault">
- <part name="fault" element="fns:LoginFault"/>
- </message>
- <message name="InvalidQueryLocatorFault">
- <part name="fault" element="fns:InvalidQueryLocatorFault"/>
- </message>
- <message name="InvalidNewPasswordFault">
- <part name="fault" element="fns:InvalidNewPasswordFault"/>
- </message>
- <message name="InvalidIdFault">
- <part name="fault" element="fns:InvalidIdFault"/>
- </message>
- <message name="UnexpectedErrorFault">
- <part name="fault" element="fns:UnexpectedErrorFault"/>
- </message>
- <message name="InvalidFieldFault">
- <part name="fault" element="fns:InvalidFieldFault"/>
- </message>
- <message name="InvalidSObjectFault">
- <part name="fault" element="fns:InvalidSObjectFault"/>
- </message>
- <message name="MalformedQueryFault">
- <part name="fault" element="fns:MalformedQueryFault"/>
- </message>
- <message name="MalformedSearchFault">
- <part name="fault" element="fns:MalformedSearchFault"/>
- </message>
-
-
- <!-- Method Messages -->
- <message name="loginRequest">
- <part element="tns:login" name="parameters"/>
- </message>
- <message name="loginResponse">
- <part element="tns:loginResponse" name="parameters"/>
- </message>
-
- <message name="describeSObjectRequest">
- <part element="tns:describeSObject" name="parameters"/>
- </message>
- <message name="describeSObjectResponse">
- <part element="tns:describeSObjectResponse" name="parameters"/>
- </message>
-
- <message name="describeSObjectsRequest">
- <part element="tns:describeSObjects" name="parameters"/>
- </message>
- <message name="describeSObjectsResponse">
- <part element="tns:describeSObjectsResponse" name="parameters"/>
- </message>
-
- <message name="describeGlobalRequest">
- <part element="tns:describeGlobal" name="parameters"/>
- </message>
- <message name="describeGlobalResponse">
- <part element="tns:describeGlobalResponse" name="parameters"/>
- </message>
-
- <message name="describeLayoutRequest">
- <part element="tns:describeLayout" name="parameters"/>
- </message>
- <message name="describeLayoutResponse">
- <part element="tns:describeLayoutResponse" name="parameters"/>
- </message>
-
- <message name="describeSoftphoneLayoutRequest">
- <part element="tns:describeSoftphoneLayout" name="parameters"/>
- </message>
- <message name="describeSoftphoneLayoutResponse">
- <part element="tns:describeSoftphoneLayoutResponse" name="parameters"/>
- </message>
-
- <message name="describeTabsRequest">
- <part element="tns:describeTabs" name="parameters"/>
- </message>
- <message name="describeTabsResponse">
- <part element="tns:describeTabsResponse" name="parameters"/>
- </message>
-
- <message name="createRequest">
- <part element="tns:create" name="parameters"/>
- </message>
- <message name="createResponse">
- <part element="tns:createResponse" name="parameters"/>
- </message>
-
- <message name="updateRequest">
- <part element="tns:update" name="parameters"/>
- </message>
- <message name="updateResponse">
- <part element="tns:updateResponse" name="parameters"/>
- </message>
-
- <message name="upsertRequest">
- <part element="tns:upsert" name="parameters"/>
- </message>
- <message name="upsertResponse">
- <part element="tns:upsertResponse" name="parameters"/>
- </message>
-
- <message name="mergeRequest">
- <part element="tns:merge" name="parameters"/>
- </message>
- <message name="mergeResponse">
- <part element="tns:mergeResponse" name="parameters"/>
- </message>
-
- <message name="deleteRequest">
- <part element="tns:delete" name="parameters"/>
- </message>
- <message name="deleteResponse">
- <part element="tns:deleteResponse" name="parameters"/>
- </message>
-
- <message name="undeleteRequest">
- <part element="tns:undelete" name="parameters"/>
- </message>
- <message name="undeleteResponse">
- <part element="tns:undeleteResponse" name="parameters"/>
- </message>
-
- <message name="emptyRecycleBinRequest">
- <part element="tns:emptyRecycleBin" name="parameters"/>
- </message>
- <message name="emptyRecycleBinResponse">
- <part element="tns:emptyRecycleBinResponse" name="parameters"/>
- </message>
-
- <message name="retrieveRequest">
- <part element="tns:retrieve" name="parameters"/>
- </message>
- <message name="retrieveResponse">
- <part element="tns:retrieveResponse" name="parameters"/>
- </message>
-
- <message name="processRequest">
- <part element="tns:process" name="parameters"/>
- </message>
- <message name="processResponse">
- <part element="tns:processResponse" name="parameters"/>
- </message>
-
- <message name="convertLeadRequest">
- <part element="tns:convertLead" name="parameters"/>
- </message>
- <message name="convertLeadResponse">
- <part element="tns:convertLeadResponse" name="parameters"/>
- </message>
-
- <message name="logoutRequest">
- <part element="tns:logout" name="parameters"/>
- </message>
- <message name="logoutResponse">
- <part element="tns:logoutResponse" name="parameters"/>
- </message>
-
- <message name="invalidateSessionsRequest">
- <part element="tns:invalidateSessions" name="parameters"/>
- </message>
- <message name="invalidateSessionsResponse">
- <part element="tns:invalidateSessionsResponse" name="parameters"/>
- </message>
-
- <message name="getDeletedRequest">
- <part element="tns:getDeleted" name="parameters"/>
- </message>
- <message name="getDeletedResponse">
- <part element="tns:getDeletedResponse" name="parameters"/>
- </message>
-
- <message name="getUpdatedRequest">
- <part element="tns:getUpdated" name="parameters"/>
- </message>
- <message name="getUpdatedResponse">
- <part element="tns:getUpdatedResponse" name="parameters"/>
- </message>
-
- <message name="queryRequest">
- <part element="tns:query" name="parameters"/>
- </message>
- <message name="queryResponse">
- <part element="tns:queryResponse" name="parameters"/>
- </message>
-
- <message name="queryAllRequest">
- <part element="tns:queryAll" name="parameters"/>
- </message>
- <message name="queryAllResponse">
- <part element="tns:queryAllResponse" name="parameters"/>
- </message>
-
- <message name="queryMoreRequest">
- <part element="tns:queryMore" name="parameters"/>
- </message>
- <message name="queryMoreResponse">
- <part element="tns:queryMoreResponse" name="parameters"/>
- </message>
-
- <message name="searchRequest">
- <part element="tns:search" name="parameters"/>
- </message>
- <message name="searchResponse">
- <part element="tns:searchResponse" name="parameters"/>
- </message>
-
- <message name="getServerTimestampRequest">
- <part element="tns:getServerTimestamp" name="parameters"/>
- </message>
- <message name="getServerTimestampResponse">
- <part element="tns:getServerTimestampResponse" name="parameters"/>
- </message>
-
- <message name="setPasswordRequest">
- <part element="tns:setPassword" name="parameters"/>
- </message>
- <message name="setPasswordResponse">
- <part element="tns:setPasswordResponse" name="parameters"/>
- </message>
-
- <message name="resetPasswordRequest">
- <part element="tns:resetPassword" name="parameters"/>
- </message>
- <message name="resetPasswordResponse">
- <part element="tns:resetPasswordResponse" name="parameters"/>
- </message>
-
- <message name="getUserInfoRequest">
- <part element="tns:getUserInfo" name="parameters"/>
- </message>
- <message name="getUserInfoResponse">
- <part element="tns:getUserInfoResponse" name="parameters"/>
- </message>
-
- <message name="sendEmailRequest">
- <part element="tns:sendEmail" name="parameters"/>
- </message>
- <message name="sendEmailResponse">
- <part element="tns:sendEmailResponse" name="parameters"/>
- </message>
-
-
-
- <!-- Soap PortType -->
- <portType name="Soap">
- <operation name="login">
- <documentation>Login to the Salesforce.com SOAP Api</documentation>
- <input message="tns:loginRequest"/>
- <output message="tns:loginResponse"/>
- <fault message="tns:LoginFault" name="LoginFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- </operation>
-
- <operation name="describeSObject">
- <documentation>Describe an sObject</documentation>
- <input message="tns:describeSObjectRequest"/>
- <output message="tns:describeSObjectResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="describeSObjects">
- <documentation>Describe a number sObjects</documentation>
- <input message="tns:describeSObjectsRequest"/>
- <output message="tns:describeSObjectsResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="describeGlobal">
- <documentation>Describe the Global state</documentation>
- <input message="tns:describeGlobalRequest"/>
- <output message="tns:describeGlobalResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="describeLayout">
- <documentation>Describe the layout of an sObject</documentation>
- <input message="tns:describeLayoutRequest"/>
- <output message="tns:describeLayoutResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- </operation>
-
- <operation name="describeSoftphoneLayout">
- <documentation>Describe the layout of the SoftPhone</documentation>
- <input message="tns:describeSoftphoneLayoutRequest"/>
- <output message="tns:describeSoftphoneLayoutResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="describeTabs">
- <documentation>Describe the tabs that appear on a users page</documentation>
- <input message="tns:describeTabsRequest"/>
- <output message="tns:describeTabsResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="create">
- <documentation>Create a set of new sObjects</documentation>
- <input message="tns:createRequest"/>
- <output message="tns:createResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- </operation>
-
- <operation name="update">
- <documentation>Update a set of sObjects</documentation>
- <input message="tns:updateRequest"/>
- <output message="tns:updateResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- </operation>
-
- <operation name="upsert">
- <documentation>Update or insert a set of sObjects based on object id</documentation>
- <input message="tns:upsertRequest"/>
- <output message="tns:upsertResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- </operation>
-
- <operation name="merge">
- <documentation>Merge and update a set of sObjects based on object id</documentation>
- <input message="tns:mergeRequest"/>
- <output message="tns:mergeResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- </operation>
-
- <operation name="delete">
- <documentation>Delete a set of sObjects</documentation>
- <input message="tns:deleteRequest"/>
- <output message="tns:deleteResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="undelete">
- <documentation>Undelete a set of sObjects</documentation>
- <input message="tns:undeleteRequest"/>
- <output message="tns:undeleteResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="emptyRecycleBin">
- <documentation>Empty a set of sObjects from the recycle bin</documentation>
- <input message="tns:emptyRecycleBinRequest"/>
- <output message="tns:emptyRecycleBinResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="retrieve">
- <documentation>Get a set of sObjects</documentation>
- <input message="tns:retrieveRequest"/>
- <output message="tns:retrieveResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- </operation>
-
- <operation name="process">
- <documentation>Submit an entity to a workflow process or process a workitem</documentation>
- <input message="tns:processRequest"/>
- <output message="tns:processResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- </operation>
-
- <operation name="convertLead">
- <documentation>convert a set of leads</documentation>
- <input message="tns:convertLeadRequest"/>
- <output message="tns:convertLeadResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="logout">
- <documentation>Logout the current user, invalidating the current session.</documentation>
- <input message="tns:logoutRequest"/>
- <output message="tns:logoutResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="invalidateSessions">
- <documentation>Logs out and invalidates session ids</documentation>
- <input message="tns:invalidateSessionsRequest"/>
- <output message="tns:invalidateSessionsResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="getDeleted">
- <documentation>Get the IDs for deleted sObjects</documentation>
- <input message="tns:getDeletedRequest"/>
- <output message="tns:getDeletedResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="getUpdated">
- <documentation>Get the IDs for updated sObjects</documentation>
- <input message="tns:getUpdatedRequest"/>
- <output message="tns:getUpdatedResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="query">
- <documentation>Create a Query Cursor</documentation>
- <input message="tns:queryRequest"/>
- <output message="tns:queryResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
- </operation>
-
- <operation name="queryAll">
- <documentation>Create a Query Cursor, including deleted sObjects</documentation>
- <input message="tns:queryAllRequest"/>
- <output message="tns:queryAllResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
- </operation>
-
- <operation name="queryMore">
- <documentation>Gets the next batch of sObjects from a query</documentation>
- <input message="tns:queryMoreRequest"/>
- <output message="tns:queryMoreResponse"/>
- <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- </operation>
-
- <operation name="search">
- <documentation>Search for sObjects</documentation>
- <input message="tns:searchRequest"/>
- <output message="tns:searchResponse"/>
- <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
- <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
- <fault message="tns:MalformedSearchFault" name="MalformedSearchFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="getServerTimestamp">
- <documentation>Gets server timestamp</documentation>
- <input message="tns:getServerTimestampRequest"/>
- <output message="tns:getServerTimestampResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="setPassword">
- <documentation>Set a user's password</documentation>
- <input message="tns:setPasswordRequest"/>
- <output message="tns:setPasswordResponse"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:InvalidNewPasswordFault" name="InvalidNewPasswordFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="resetPassword">
- <documentation>Reset a user's password</documentation>
- <input message="tns:resetPasswordRequest"/>
- <output message="tns:resetPasswordResponse"/>
- <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="getUserInfo">
- <documentation>Returns standard information relevant to the current user</documentation>
- <input message="tns:getUserInfoRequest"/>
- <output message="tns:getUserInfoResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- <operation name="sendEmail">
- <documentation>Send outbound email</documentation>
- <input message="tns:sendEmailRequest"/>
- <output message="tns:sendEmailResponse"/>
- <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
- </operation>
-
- </portType>
-
- <!-- Soap Binding -->
- <binding name="SoapBinding" type="tns:Soap">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="login">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="LoginScopeHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="LoginFault">
- <soap:fault name="LoginFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeSObject">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="LocaleOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeSObjects">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="LocaleOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeGlobal">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeLayout">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeSoftphoneLayout">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="describeTabs">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="create">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- </operation>
- <operation name="update">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- </operation>
- <operation name="upsert">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- </operation>
- <operation name="merge">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- </operation>
- <operation name="delete">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="UserTerritoryDeleteHeader"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="undelete">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="emptyRecycleBin">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="retrieve">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- <fault name="MalformedQueryFault">
- <soap:fault name="MalformedQueryFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- </operation>
- <operation name="process">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- </operation>
- <operation name="convertLead">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
- <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="logout">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="invalidateSessions">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="getDeleted">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="getUpdated">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="query">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
- <soap:header use="literal" message="tns:Header" part="MruHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- <fault name="MalformedQueryFault">
- <soap:fault name="MalformedQueryFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidQueryLocatorFault">
- <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="queryAll">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- <fault name="MalformedQueryFault">
- <soap:fault name="MalformedQueryFault" use="literal"/>
- </fault>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidQueryLocatorFault">
- <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="queryMore">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidQueryLocatorFault">
- <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- </operation>
- <operation name="search">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidSObjectFault">
- <soap:fault name="InvalidSObjectFault" use="literal"/>
- </fault>
- <fault name="InvalidFieldFault">
- <soap:fault name="InvalidFieldFault" use="literal"/>
- </fault>
- <fault name="MalformedSearchFault">
- <soap:fault name="MalformedSearchFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="getServerTimestamp">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="setPassword">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="InvalidNewPasswordFault">
- <soap:fault name="InvalidNewPasswordFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="resetPassword">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="InvalidIdFault">
- <soap:fault name="InvalidIdFault" use="literal"/>
- </fault>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="getUserInfo">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
- <operation name="sendEmail">
- <soap:operation soapAction=""/>
- <input>
- <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
- <soap:header use="literal" message="tns:Header" part="CallOptions"/>
- <soap:body parts="parameters" use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="UnexpectedErrorFault">
- <soap:fault name="UnexpectedErrorFault" use="literal"/>
- </fault>
- </operation>
-
- </binding>
-
- <!-- Soap Service Endpoint -->
- <service name="SforceService">
- <documentation>Sforce SOAP API</documentation>
- <port binding="tns:SoapBinding" name="Soap">
- <soap:address location="https://www.salesforce.com/services/Soap/u/15.0"/>
- </port>
- </service>
-</definitions>
-
Added: trunk/connectors/salesforce-api/src/main/resources/partner_v17.wsdl
===================================================================
--- trunk/connectors/salesforce-api/src/main/resources/partner_v17.wsdl (rev 0)
+++ trunk/connectors/salesforce-api/src/main/resources/partner_v17.wsdl 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,2930 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Salesforce.com Partner Web Services API Version 17.0
+Generated on 2010-02-11 17:24:10 +0000.
+
+Copyright 1999-2010 salesforce.com, inc.
+All Rights Reserved
+-->
+<definitions targetNamespace="urn:partner.soap.sforce.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fns="urn:fault.partner.soap.sforce.com" xmlns:tns="urn:partner.soap.sforce.com" xmlns:ens="urn:sobject.partner.soap.sforce.com">
+ <types>
+
+ <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sobject.partner.soap.sforce.com">
+
+ <import namespace="urn:partner.soap.sforce.com"/>
+
+
+ <!-- Dynamic sObject -->
+ <complexType name="sObject">
+ <sequence>
+ <element name="type" type="xsd:string"/>
+ <element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="Id" type="tns:ID" nillable="true"/>
+ <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+ </sequence>
+ </complexType>
+
+ </schema>
+
+ <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:partner.soap.sforce.com">
+
+ <import namespace="urn:sobject.partner.soap.sforce.com"/>
+
+ <!-- Our simple ID Type -->
+ <simpleType name="ID">
+ <restriction base="xsd:string">
+ <length value="18"/>
+ <pattern value="[a-zA-Z0-9]{18}"/>
+ </restriction>
+ </simpleType>
+
+ <simpleType name="QueryLocator">
+ <restriction base="xsd:string"/>
+ </simpleType>
+
+ <!-- Shared Result Types -->
+ <complexType name="QueryResult">
+ <sequence>
+ <element name="done" type="xsd:boolean"/>
+ <element name="queryLocator" type="tns:QueryLocator" nillable="true"/>
+ <element name="records" type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="size" type="xsd:int"/>
+ </sequence>
+ </complexType>
+
+
+
+ <!-- Search Result -->
+ <complexType name="SearchResult">
+ <sequence>
+ <element name="searchRecords" minOccurs="0" maxOccurs="unbounded" type="tns:SearchRecord"/>
+ <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SearchRecord">
+ <sequence>
+ <element name="record" type="ens:sObject"/>
+ </sequence>
+ </complexType>
+
+ <!-- GetUpdated Result -->
+ <complexType name="GetUpdatedResult">
+ <sequence>
+ <element name="ids" minOccurs="0" maxOccurs="unbounded" type="tns:ID"/>
+ <element name="latestDateCovered" type="xsd:dateTime"/>
+ <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <!-- GetDeleted Result -->
+ <complexType name="GetDeletedResult">
+ <sequence>
+ <element name="deletedRecords" minOccurs="0" maxOccurs="unbounded" type="tns:DeletedRecord"/>
+ <element name="earliestDateAvailable" type="xsd:dateTime"/>
+ <element name="latestDateCovered" type="xsd:dateTime"/>
+ <element name="sforceReserved" minOccurs="0" maxOccurs="1" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DeletedRecord">
+ <sequence>
+ <element name="deletedDate" type="xsd:dateTime"/>
+ <element name="id" type="tns:ID"/>
+ </sequence>
+ </complexType>
+
+
+ <complexType name="GetServerTimestampResult">
+ <sequence>
+ <element name="timestamp" type="xsd:dateTime"/>
+ </sequence>
+ </complexType>
+
+
+ <!-- InvalidateSessions Result -->
+ <complexType name="InvalidateSessionsResult">
+ <sequence>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SetPasswordResult">
+ </complexType>
+
+ <complexType name="ResetPasswordResult">
+ <sequence>
+ <element name="password" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="GetUserInfoResult">
+ <sequence>
+ <element name="accessibilityMode" type="xsd:boolean"/>
+ <element name="currencySymbol" type="xsd:string" nillable="true"/>
+ <element name="orgDefaultCurrencyIsoCode" type="xsd:string" nillable="true"/>
+ <element name="orgDisallowHtmlAttachments" type="xsd:boolean"/>
+ <element name="orgHasPersonAccounts" type="xsd:boolean"/>
+ <element name="organizationId" type="tns:ID"/>
+ <element name="organizationMultiCurrency" type="xsd:boolean"/>
+ <element name="organizationName" type="xsd:string"/>
+ <element name="profileId" type="tns:ID"/>
+ <element name="roleId" type="tns:ID" nillable="true"/>
+ <element name="userDefaultCurrencyIsoCode" type="xsd:string" nillable="true"/>
+ <element name="userEmail" type="xsd:string"/>
+ <element name="userFullName" type="xsd:string"/>
+ <element name="userId" type="tns:ID"/>
+ <element name="userLanguage" type="xsd:string"/>
+ <element name="userLocale" type="xsd:string"/>
+ <element name="userName" type="xsd:string"/>
+ <element name="userTimeZone" type="xsd:string"/>
+ <element name="userType" type="xsd:string"/>
+ <element name="userUiSkin" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="LoginResult">
+ <sequence>
+ <element name="metadataServerUrl" type="xsd:string" nillable="true"/>
+ <element name="passwordExpired" type="xsd:boolean"/>
+ <element name="sandbox" type="xsd:boolean"/>
+ <element name="serverUrl" type="xsd:string" nillable="true"/>
+ <element name="sessionId" type="xsd:string" nillable="true"/>
+
+ <element name="userId" type="tns:ID" nillable="true"/>
+ <element name="userInfo" type="tns:GetUserInfoResult" minOccurs="0"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="StatusCode">
+ <restriction base="xsd:string">
+ <enumeration value="ALREADY_IN_PROCESS"/>
+ <enumeration value="ASSIGNEE_TYPE_REQUIRED"/>
+ <enumeration value="BAD_CUSTOM_ENTITY_PARENT_DOMAIN"/>
+ <enumeration value="BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED"/>
+ <enumeration value="CANNOT_CASCADE_PRODUCT_ACTIVE"/>
+ <enumeration value="CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD"/>
+ <enumeration value="CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE"/>
+ <enumeration value="CANNOT_DEACTIVATE_DIVISION"/>
+ <enumeration value="CANNOT_DELETE_LAST_DATED_CONVERSION_RATE"/>
+ <enumeration value="CANNOT_DELETE_MANAGED_OBJECT"/>
+ <enumeration value="CANNOT_DISABLE_LAST_ADMIN"/>
+ <enumeration value="CANNOT_ENABLE_IP_RESTRICT_REQUESTS"/>
+ <enumeration value="CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY"/>
+ <enumeration value="CANNOT_MODIFY_MANAGED_OBJECT"/>
+ <enumeration value="CANNOT_RENAME_APEX_REFERENCED_FIELD"/>
+ <enumeration value="CANNOT_RENAME_APEX_REFERENCED_OBJECT"/>
+ <enumeration value="CANNOT_REPARENT_RECORD"/>
+ <enumeration value="CANNOT_UPDATE_CONVERTED_LEAD"/>
+ <enumeration value="CANT_DISABLE_CORP_CURRENCY"/>
+ <enumeration value="CANT_UNSET_CORP_CURRENCY"/>
+ <enumeration value="CHILD_SHARE_FAILS_PARENT"/>
+ <enumeration value="CIRCULAR_DEPENDENCY"/>
+ <enumeration value="COMMUNITY_NOT_ACCESSIBLE"/>
+ <enumeration value="CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED"/>
+ <enumeration value="CUSTOM_ENTITY_OR_FIELD_LIMIT"/>
+ <enumeration value="CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED"/>
+ <enumeration value="CUSTOM_INDEX_EXISTS"/>
+ <enumeration value="CUSTOM_LINK_LIMIT_EXCEEDED"/>
+ <enumeration value="CUSTOM_TAB_LIMIT_EXCEEDED"/>
+ <enumeration value="DELETE_FAILED"/>
+ <enumeration value="DELETE_REQUIRED_ON_CASCADE"/>
+ <enumeration value="DEPENDENCY_EXISTS"/>
+ <enumeration value="DUPLICATE_CASE_SOLUTION"/>
+ <enumeration value="DUPLICATE_COMM_NICKNAME"/>
+ <enumeration value="DUPLICATE_CUSTOM_ENTITY_DEFINITION"/>
+ <enumeration value="DUPLICATE_CUSTOM_TAB_MOTIF"/>
+ <enumeration value="DUPLICATE_DEVELOPER_NAME"/>
+ <enumeration value="DUPLICATE_EXTERNAL_ID"/>
+ <enumeration value="DUPLICATE_MASTER_LABEL"/>
+ <enumeration value="DUPLICATE_SENDER_DISPLAY_NAME"/>
+ <enumeration value="DUPLICATE_USERNAME"/>
+ <enumeration value="DUPLICATE_VALUE"/>
+ <enumeration value="EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR"/>
+ <enumeration value="EMPTY_SCONTROL_FILE_NAME"/>
+ <enumeration value="ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE"/>
+ <enumeration value="ENTITY_IS_ARCHIVED"/>
+ <enumeration value="ENTITY_IS_DELETED"/>
+ <enumeration value="ENTITY_IS_LOCKED"/>
+ <enumeration value="ERROR_IN_MAILER"/>
+ <enumeration value="FAILED_ACTIVATION"/>
+ <enumeration value="FIELD_CUSTOM_VALIDATION_EXCEPTION"/>
+ <enumeration value="FIELD_INTEGRITY_EXCEPTION"/>
+ <enumeration value="FILTERED_LOOKUP_LIMIT_EXCEEDED"/>
+ <enumeration value="HTML_FILE_UPLOAD_NOT_ALLOWED"/>
+ <enumeration value="IMAGE_TOO_LARGE"/>
+ <enumeration value="INACTIVE_OWNER_OR_USER"/>
+ <enumeration value="INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY"/>
+ <enumeration value="INSUFFICIENT_ACCESS_OR_READONLY"/>
+ <enumeration value="INVALID_ACCESS_LEVEL"/>
+ <enumeration value="INVALID_ARGUMENT_TYPE"/>
+ <enumeration value="INVALID_ASSIGNEE_TYPE"/>
+ <enumeration value="INVALID_ASSIGNMENT_RULE"/>
+ <enumeration value="INVALID_BATCH_OPERATION"/>
+ <enumeration value="INVALID_CONTENT_TYPE"/>
+ <enumeration value="INVALID_CREDIT_CARD_INFO"/>
+ <enumeration value="INVALID_CROSS_REFERENCE_KEY"/>
+ <enumeration value="INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD"/>
+ <enumeration value="INVALID_CURRENCY_CONV_RATE"/>
+ <enumeration value="INVALID_CURRENCY_CORP_RATE"/>
+ <enumeration value="INVALID_CURRENCY_ISO"/>
+ <enumeration value="INVALID_EMAIL_ADDRESS"/>
+ <enumeration value="INVALID_EMPTY_KEY_OWNER"/>
+ <enumeration value="INVALID_FIELD"/>
+ <enumeration value="INVALID_FIELD_FOR_INSERT_UPDATE"/>
+ <enumeration value="INVALID_FIELD_WHEN_USING_TEMPLATE"/>
+ <enumeration value="INVALID_FILTER_ACTION"/>
+ <enumeration value="INVALID_GOOGLE_DOCS_URL"/>
+ <enumeration value="INVALID_ID_FIELD"/>
+ <enumeration value="INVALID_INET_ADDRESS"/>
+ <enumeration value="INVALID_LINEITEM_CLONE_STATE"/>
+ <enumeration value="INVALID_MASTER_OR_TRANSLATED_SOLUTION"/>
+ <enumeration value="INVALID_MESSAGE_ID_REFERENCE"/>
+ <enumeration value="INVALID_OPERATION"/>
+ <enumeration value="INVALID_OPERATOR"/>
+ <enumeration value="INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST"/>
+ <enumeration value="INVALID_PARTNER_NETWORK_STATUS"/>
+ <enumeration value="INVALID_PERSON_ACCOUNT_OPERATION"/>
+ <enumeration value="INVALID_SAVE_AS_ACTIVITY_FLAG"/>
+ <enumeration value="INVALID_SESSION_ID"/>
+ <enumeration value="INVALID_SETUP_OWNER"/>
+ <enumeration value="INVALID_STATUS"/>
+ <enumeration value="INVALID_TYPE"/>
+ <enumeration value="INVALID_TYPE_FOR_OPERATION"/>
+ <enumeration value="INVALID_TYPE_ON_FIELD_IN_RECORD"/>
+ <enumeration value="IP_RANGE_LIMIT_EXCEEDED"/>
+ <enumeration value="LICENSE_LIMIT_EXCEEDED"/>
+ <enumeration value="LIGHT_PORTAL_USER_EXCEPTION"/>
+ <enumeration value="LIMIT_EXCEEDED"/>
+ <enumeration value="MALFORMED_ID"/>
+ <enumeration value="MANAGER_NOT_DEFINED"/>
+ <enumeration value="MASSMAIL_RETRY_LIMIT_EXCEEDED"/>
+ <enumeration value="MASS_MAIL_LIMIT_EXCEEDED"/>
+ <enumeration value="MAXIMUM_CCEMAILS_EXCEEDED"/>
+ <enumeration value="MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED"/>
+ <enumeration value="MAXIMUM_HIERARCHY_LEVELS_REACHED"/>
+ <enumeration value="MAXIMUM_SIZE_OF_ATTACHMENT"/>
+ <enumeration value="MAXIMUM_SIZE_OF_DOCUMENT"/>
+ <enumeration value="MAX_ACTIONS_PER_RULE_EXCEEDED"/>
+ <enumeration value="MAX_ACTIVE_RULES_EXCEEDED"/>
+ <enumeration value="MAX_APPROVAL_STEPS_EXCEEDED"/>
+ <enumeration value="MAX_FORMULAS_PER_RULE_EXCEEDED"/>
+ <enumeration value="MAX_RULES_EXCEEDED"/>
+ <enumeration value="MAX_RULE_ENTRIES_EXCEEDED"/>
+ <enumeration value="MAX_TASK_DESCRIPTION_EXCEEEDED"/>
+ <enumeration value="MAX_TM_RULES_EXCEEDED"/>
+ <enumeration value="MAX_TM_RULE_ITEMS_EXCEEDED"/>
+ <enumeration value="MERGE_FAILED"/>
+ <enumeration value="MISSING_ARGUMENT"/>
+ <enumeration value="MIXED_DML_OPERATION"/>
+ <enumeration value="NONUNIQUE_SHIPPING_ADDRESS"/>
+ <enumeration value="NO_APPLICABLE_PROCESS"/>
+ <enumeration value="NO_ATTACHMENT_PERMISSION"/>
+ <enumeration value="NO_INACTIVE_DIVISION_MEMBERS"/>
+ <enumeration value="NO_MASS_MAIL_PERMISSION"/>
+ <enumeration value="NUMBER_OUTSIDE_VALID_RANGE"/>
+ <enumeration value="NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED"/>
+ <enumeration value="OPTED_OUT_OF_MASS_MAIL"/>
+ <enumeration value="PACKAGE_LICENSE_REQUIRED"/>
+ <enumeration value="PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT"/>
+ <enumeration value="PRIVATE_CONTACT_ON_ASSET"/>
+ <enumeration value="RECORD_IN_USE_BY_WORKFLOW"/>
+ <enumeration value="REQUEST_RUNNING_TOO_LONG"/>
+ <enumeration value="REQUIRED_FIELD_MISSING"/>
+ <enumeration value="SELF_REFERENCE_FROM_TRIGGER"/>
+ <enumeration value="SHARE_NEEDED_FOR_CHILD_OWNER"/>
+ <enumeration value="STANDARD_PRICE_NOT_DEFINED"/>
+ <enumeration value="STORAGE_LIMIT_EXCEEDED"/>
+ <enumeration value="STRING_TOO_LONG"/>
+ <enumeration value="TABSET_LIMIT_EXCEEDED"/>
+ <enumeration value="TEMPLATE_NOT_ACTIVE"/>
+ <enumeration value="TERRITORY_REALIGN_IN_PROGRESS"/>
+ <enumeration value="TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET"/>
+ <enumeration value="TOO_MANY_APEX_REQUESTS"/>
+ <enumeration value="TOO_MANY_ENUM_VALUE"/>
+ <enumeration value="TRANSFER_REQUIRES_READ"/>
+ <enumeration value="UNABLE_TO_LOCK_ROW"/>
+ <enumeration value="UNAVAILABLE_RECORDTYPE_EXCEPTION"/>
+ <enumeration value="UNDELETE_FAILED"/>
+ <enumeration value="UNKNOWN_EXCEPTION"/>
+ <enumeration value="UNSPECIFIED_EMAIL_ADDRESS"/>
+ <enumeration value="UNSUPPORTED_APEX_TRIGGER_OPERATON"/>
+ <enumeration value="UNVERIFIED_SENDER_ADDRESS"/>
+ <enumeration value="WEBLINK_SIZE_LIMIT_EXCEEDED"/>
+ <enumeration value="WRONG_CONTROLLER_TYPE"/>
+ </restriction>
+ </simpleType>
+
+
+ <complexType name="Error">
+ <sequence>
+ <element name="fields" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="message" type="xsd:string"/>
+ <element name="statusCode" type="tns:StatusCode"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SendEmailError">
+ <sequence>
+ <element name="fields" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="message" type="xsd:string"/>
+ <element name="statusCode" type="tns:StatusCode"/>
+ <element name="targetObjectId" type="tns:ID" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="SaveResult">
+ <sequence>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="UpsertResult">
+ <sequence>
+ <element name="created" type="xsd:boolean"/>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="MergeRequest">
+ <sequence>
+ <element name="masterRecord" type="ens:sObject"/>
+ <element name="recordToMergeIds" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="MergeResult">
+ <sequence>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="mergedRecordIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="success" type="xsd:boolean"/>
+ <element name="updatedRelatedIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ProcessRequest">
+ <sequence>
+ <element name="comments" type="xsd:string" nillable="true"/>
+ <element name="nextApproverIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ProcessSubmitRequest">
+ <complexContent>
+ <extension base="tns:ProcessRequest">
+ <sequence>
+ <element name="objectId" type="tns:ID"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ProcessWorkitemRequest">
+ <complexContent>
+ <extension base="tns:ProcessRequest">
+ <sequence>
+ <element name="action" type="xsd:string"/>
+ <element name="workitemId" type="tns:ID"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+
+
+ <complexType name="ProcessResult">
+ <sequence>
+ <element name="actorIds" type="tns:ID" nillable="false" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="entityId" type="tns:ID" nillable="true"/>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="instanceId" type="tns:ID" nillable="true"/>
+ <element name="instanceStatus" type="xsd:string" nillable="true"/>
+ <element name="newWorkitemIds" type="tns:ID" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+
+
+
+
+ <complexType name="DeleteResult">
+ <sequence>
+ <element name="errors" type="tns:Error" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="UndeleteResult">
+ <sequence>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="EmptyRecycleBinResult">
+ <sequence>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="LeadConvert">
+ <sequence>
+ <element name="accountId" type="tns:ID" nillable="true"/>
+ <element name="contactId" type="tns:ID" nillable="true"/>
+ <element name="convertedStatus" type="xsd:string"/>
+ <element name="doNotCreateOpportunity" type="xsd:boolean"/>
+ <element name="leadId" type="tns:ID"/>
+ <element name="opportunityName" type="xsd:string" nillable="true"/>
+ <element name="overwriteLeadSource" type="xsd:boolean"/>
+ <element name="ownerId" type="tns:ID" nillable="true"/>
+ <element name="sendNotificationEmail" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="LeadConvertResult">
+ <sequence>
+ <element name="accountId" type="tns:ID" nillable="true"/>
+ <element name="contactId" type="tns:ID" nillable="true"/>
+ <element name="errors" type="tns:Error" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="leadId" type="tns:ID" nillable="true"/>
+ <element name="opportunityId" type="tns:ID" nillable="true"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSObjectResult">
+ <sequence>
+ <element name="activateable" type="xsd:boolean"/>
+ <element name="childRelationships" type="tns:ChildRelationship" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="createable" type="xsd:boolean"/>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="customSetting" type="xsd:boolean"/>
+ <element name="deletable" type="xsd:boolean"/>
+ <element name="deprecatedAndHidden" type="xsd:boolean"/>
+ <element name="fields" type="tns:Field" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="keyPrefix" type="xsd:string" nillable="true"/>
+ <element name="label" type="xsd:string"/>
+ <element name="labelPlural" type="xsd:string"/>
+ <element name="layoutable" type="xsd:boolean"/>
+ <element name="mergeable" type="xsd:boolean"/>
+ <element name="name" type="xsd:string"/>
+ <element name="queryable" type="xsd:boolean"/>
+ <element name="recordTypeInfos" type="tns:RecordTypeInfo" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="replicateable" type="xsd:boolean"/>
+ <element name="retrieveable" type="xsd:boolean"/>
+ <element name="searchable" type="xsd:boolean"/>
+ <element name="triggerable" type="xsd:boolean" minOccurs="0"/>
+ <element name="undeletable" type="xsd:boolean"/>
+ <element name="updateable" type="xsd:boolean"/>
+ <element name="urlDetail" type="xsd:string" nillable="true"/>
+ <element name="urlEdit" type="xsd:string" nillable="true"/>
+ <element name="urlNew" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <!-- this is a subset of properties for each SObject that is returned by the describeGlobal call -->
+ <complexType name="DescribeGlobalSObjectResult">
+ <sequence>
+ <element name="activateable" type="xsd:boolean"/>
+ <element name="createable" type="xsd:boolean"/>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="customSetting" type="xsd:boolean"/>
+ <element name="deletable" type="xsd:boolean"/>
+ <element name="deprecatedAndHidden" type="xsd:boolean"/>
+ <element name="keyPrefix" type="xsd:string" nillable="true"/>
+ <element name="label" type="xsd:string"/>
+ <element name="labelPlural" type="xsd:string"/>
+ <element name="layoutable" type="xsd:boolean"/>
+ <element name="mergeable" type="xsd:boolean"/>
+ <element name="name" type="xsd:string"/>
+ <element name="queryable" type="xsd:boolean"/>
+ <element name="replicateable" type="xsd:boolean"/>
+ <element name="retrieveable" type="xsd:boolean"/>
+ <element name="searchable" type="xsd:boolean"/>
+ <element name="triggerable" type="xsd:boolean"/>
+ <element name="undeletable" type="xsd:boolean"/>
+ <element name="updateable" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="ChildRelationship">
+ <sequence>
+ <element name="cascadeDelete" type="xsd:boolean"/>
+ <element name="childSObject" type="xsd:string"/>
+ <element name="deprecatedAndHidden" type="xsd:boolean"/>
+ <element name="field" type="xsd:string"/>
+ <element name="relationshipName" type="xsd:string" minOccurs="0"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeGlobalResult">
+ <sequence>
+ <element name="encoding" type="xsd:string" nillable="true"/>
+ <element name="maxBatchSize" type="xsd:int"/>
+ <element name="sobjects" type="tns:DescribeGlobalSObjectResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="fieldType">
+ <restriction base="xsd:string">
+ <enumeration value="string"/>
+ <enumeration value="picklist"/>
+ <enumeration value="multipicklist"/>
+ <enumeration value="combobox"/>
+ <enumeration value="reference"/>
+ <enumeration value="base64"/>
+ <enumeration value="boolean"/>
+ <enumeration value="currency"/>
+ <enumeration value="textarea"/>
+ <enumeration value="int"/>
+ <enumeration value="double"/>
+ <enumeration value="percent"/>
+ <enumeration value="phone"/>
+ <enumeration value="id"/>
+ <enumeration value="date"/>
+ <enumeration value="datetime"/>
+ <enumeration value="time"/>
+ <enumeration value="url"/>
+ <enumeration value="email"/>
+ <enumeration value="encryptedstring"/>
+ <enumeration value="anyType"/> <!-- can be string, picklist, reference, boolean, currency, int, double, percent, id, date, datetime, url, email -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="soapType">
+ <restriction base="xsd:string">
+ <enumeration value="tns:ID"/>
+ <enumeration value="xsd:base64Binary"/>
+ <enumeration value="xsd:boolean"/>
+ <enumeration value="xsd:double"/>
+ <enumeration value="xsd:int"/>
+ <enumeration value="xsd:string"/>
+ <enumeration value="xsd:date"/>
+ <enumeration value="xsd:dateTime"/>
+ <enumeration value="xsd:time"/>
+ <enumeration value="xsd:anyType"/> <!-- can be id, booolean, double, int, string, date, dateTime -->
+ </restriction>
+ </simpleType>
+
+ <complexType name="Field">
+ <sequence>
+ <element name="autoNumber" type="xsd:boolean"/>
+ <element name="byteLength" type="xsd:int"/>
+ <element name="calculated" type="xsd:boolean"/>
+ <element name="calculatedFormula" type="xsd:string" minOccurs="0"/>
+ <element name="caseSensitive" type="xsd:boolean"/>
+ <element name="controllerName" type="xsd:string" minOccurs="0"/>
+ <element name="createable" type="xsd:boolean"/>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="defaultValueFormula" type="xsd:string" minOccurs="0"/>
+ <element name="defaultedOnCreate" type="xsd:boolean"/>
+ <element name="dependentPicklist" type="xsd:boolean" minOccurs="0"/>
+ <element name="deprecatedAndHidden" type="xsd:boolean"/>
+ <element name="digits" type="xsd:int"/>
+ <element name="externalId" type="xsd:boolean" minOccurs="0"/>
+ <element name="filterable" type="xsd:boolean"/>
+ <element name="htmlFormatted" type="xsd:boolean" minOccurs="0"/>
+ <element name="idLookup" type="xsd:boolean"/>
+ <element name="inlineHelpText" type="xsd:string" minOccurs="0"/>
+ <element name="label" type="xsd:string"/>
+ <element name="length" type="xsd:int"/>
+ <element name="name" type="xsd:string"/>
+ <element name="nameField" type="xsd:boolean"/>
+ <element name="namePointing" type="xsd:boolean" minOccurs="0"/>
+ <element name="nillable" type="xsd:boolean"/>
+ <element name="picklistValues" type="tns:PicklistEntry" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="precision" type="xsd:int"/>
+ <element name="referenceTo" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="relationshipName" type="xsd:string" minOccurs="0"/>
+ <element name="relationshipOrder" type="xsd:int" minOccurs="0"/>
+ <element name="restrictedPicklist" type="xsd:boolean"/>
+ <element name="scale" type="xsd:int"/>
+ <element name="soapType" type="tns:soapType"/>
+ <element name="sortable" type="xsd:boolean" minOccurs="0"/>
+ <element name="type" type="tns:fieldType"/>
+ <element name="unique" type="xsd:boolean"/>
+ <element name="updateable" type="xsd:boolean"/>
+ <element name="writeRequiresMasterRead" type="xsd:boolean" minOccurs="0"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="PicklistEntry">
+ <sequence>
+ <element name="active" type="xsd:boolean"/>
+ <element name="defaultValue" type="xsd:boolean"/>
+ <element name="label" type="xsd:string" nillable="true"/>
+ <element name="validFor" type="xsd:base64Binary" minOccurs="0"/>
+ <element name="value" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSoftphoneLayoutResult">
+ <sequence>
+ <element name="callTypes" type="tns:DescribeSoftphoneLayoutCallType" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID"/>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSoftphoneLayoutCallType">
+ <sequence>
+ <element name="infoFields" type="tns:DescribeSoftphoneLayoutInfoField" maxOccurs="unbounded"/>
+ <element name="name" type="xsd:string"/>
+ <element name="sections" type="tns:DescribeSoftphoneLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSoftphoneLayoutInfoField">
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSoftphoneLayoutSection">
+ <sequence>
+ <element name="entityApiName" type="xsd:string"/>
+ <element name="items" type="tns:DescribeSoftphoneLayoutItem" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeSoftphoneLayoutItem">
+ <sequence>
+ <element name="itemApiName" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutResult">
+ <sequence>
+ <element name="layouts" type="tns:DescribeLayout" maxOccurs="unbounded"/>
+ <element name="recordTypeMappings" type="tns:RecordTypeMapping" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="recordTypeSelectorRequired" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayout">
+ <sequence>
+ <element name="buttonLayoutSection" type="tns:DescribeLayoutButtonSection" minOccurs="0"/>
+ <element name="detailLayoutSections" type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="editLayoutSections" type="tns:DescribeLayoutSection" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="id" type="tns:ID"/>
+
+
+ <element name="relatedLists" type="tns:RelatedList" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutSection">
+ <sequence>
+ <element name="columns" type="xsd:int"/>
+ <element name="heading" type="xsd:string"/>
+ <element name="layoutRows" type="tns:DescribeLayoutRow" maxOccurs="unbounded"/>
+ <element name="rows" type="xsd:int"/>
+ <element name="useCollapsibleSection" type="xsd:boolean"/>
+ <element name="useHeading" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutButtonSection">
+ <sequence>
+ <element name="detailButtons" type="tns:DescribeLayoutButton" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutRow">
+ <sequence>
+ <element name="layoutItems" type="tns:DescribeLayoutItem" maxOccurs="unbounded"/>
+ <element name="numItems" type="xsd:int"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutItem">
+ <sequence>
+ <element name="editable" type="xsd:boolean"/>
+ <element name="label" type="xsd:string" nillable="true"/>
+ <element name="layoutComponents" type="tns:DescribeLayoutComponent" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="placeholder" type="xsd:boolean"/>
+ <element name="required" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutButton">
+ <sequence>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="label" type="xsd:string" nillable="true"/>
+ <element name="name" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeLayoutComponent">
+ <sequence>
+ <element name="displayLines" type="xsd:int"/>
+ <element name="tabOrder" type="xsd:int"/>
+ <element name="type" type="tns:layoutComponentType"/>
+ <element name="value" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <simpleType name="layoutComponentType">
+ <restriction base="xsd:string">
+ <enumeration value="Field"/>
+ <enumeration value="Separator"/>
+ <enumeration value="SControl"/>
+ <enumeration value="EmptySpace"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="RecordTypeInfo">
+ <sequence>
+ <element name="available" type="xsd:boolean"/>
+ <element name="defaultRecordTypeMapping" type="xsd:boolean"/>
+ <element name="name" type="xsd:string"/>
+ <element name="recordTypeId" type="tns:ID" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="RecordTypeMapping">
+ <sequence>
+ <element name="available" type="xsd:boolean"/>
+ <element name="defaultRecordTypeMapping" type="xsd:boolean"/>
+ <element name="layoutId" type="tns:ID"/>
+ <element name="name" type="xsd:string"/>
+ <element name="picklistsForRecordType" type="tns:PicklistForRecordType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="recordTypeId" type="tns:ID" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="PicklistForRecordType">
+ <sequence>
+ <element name="picklistName" type="xsd:string"/>
+ <element name="picklistValues" type="tns:PicklistEntry" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="RelatedList">
+ <sequence>
+ <element name="columns" type="tns:RelatedListColumn" maxOccurs="unbounded"/>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="field" type="xsd:string" nillable="true"/>
+ <element name="label" type="xsd:string"/>
+ <element name="limitRows" type="xsd:int"/>
+ <element name="name" type="xsd:string"/>
+ <element name="sobject" type="xsd:string" nillable="true"/>
+ <element name="sort" type="tns:RelatedListSort" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="RelatedListColumn">
+ <sequence>
+ <element name="field" type="xsd:string" nillable="true"/>
+ <element name="format" type="xsd:string" nillable="true"/>
+ <element name="label" type="xsd:string"/>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="RelatedListSort">
+ <sequence>
+ <element name="ascending" type="xsd:boolean"/>
+ <element name="column" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+
+
+ <complexType name="EmailFileAttachment">
+ <sequence>
+ <element name="body" nillable="true" minOccurs="0" type="xsd:base64Binary"/>
+ <element name="contentType" nillable="true" minOccurs="0" type="xsd:string"/>
+ <element name="fileName" type="xsd:string"/>
+ <element name="inline" type="xsd:boolean" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ <simpleType name="EmailPriority">
+ <restriction base="xsd:string">
+ <enumeration value="Highest"/>
+ <enumeration value="High"/>
+ <enumeration value="Normal"/>
+ <enumeration value="Low"/>
+ <enumeration value="Lowest"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="Email">
+ <sequence>
+ <element name="bccSender" type="xsd:boolean" nillable="true"/>
+ <element name="emailPriority" type="tns:EmailPriority" nillable="true"/>
+ <element name="replyTo" type="xsd:string" nillable="true"/>
+ <element name="saveAsActivity" type="xsd:boolean" nillable="true"/>
+ <element name="senderDisplayName" type="xsd:string" nillable="true"/>
+ <element name="subject" type="xsd:string" nillable="true"/>
+ <element name="useSignature" type="xsd:boolean" nillable="true"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="MassEmailMessage">
+ <complexContent>
+ <extension base="tns:Email">
+ <sequence>
+ <element name="description" type="xsd:string" nillable="true"/>
+ <element name="targetObjectIds" minOccurs="0" maxOccurs="250" type="tns:ID"/>
+ <element name="templateId" type="tns:ID"/>
+ <element name="whatIds" minOccurs="0" maxOccurs="250" type="tns:ID"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="SingleEmailMessage">
+ <complexContent>
+ <extension base="tns:Email">
+ <sequence>
+ <element name="bccAddresses" minOccurs="0" maxOccurs="25" type="xsd:string" nillable="true"/>
+ <element name="ccAddresses" minOccurs="0" maxOccurs="25" type="xsd:string" nillable="true"/>
+ <element name="charset" type="xsd:string" nillable="true"/>
+ <element name="documentAttachments" minOccurs="0" maxOccurs="unbounded" type="tns:ID"/>
+ <element name="htmlBody" type="xsd:string" nillable="true"/>
+ <element name="inReplyTo" minOccurs="0" type="xsd:string" nillable="true"/>
+ <element name="fileAttachments" minOccurs="0" maxOccurs="unbounded" type="tns:EmailFileAttachment"/>
+ <element name="orgWideEmailAddressId" minOccurs="0" maxOccurs="1" type="tns:ID" nillable="true"/>
+ <element name="plainTextBody" type="xsd:string" nillable="true"/>
+ <element name="references" minOccurs="0" type="xsd:string" nillable="true"/>
+ <element name="targetObjectId" type="tns:ID" nillable="true"/>
+ <element name="templateId" type="tns:ID" nillable="true"/>
+ <element name="toAddresses" minOccurs="0" maxOccurs="100" type="xsd:string" nillable="true"/>
+ <element name="whatId" type="tns:ID" nillable="true"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="SendEmailResult">
+ <sequence>
+ <element name="errors" minOccurs="0" maxOccurs="unbounded" type="tns:SendEmailError"/>
+ <element name="success" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+
+
+
+ <complexType name="DescribeTabSetResult">
+ <sequence>
+ <element name="label" type="xsd:string"/>
+ <element name="logoUrl" type="xsd:string"/>
+ <element name="namespace" type="xsd:string" minOccurs="0"/>
+ <element name="selected" type="xsd:boolean"/>
+ <element name="tabs" type="tns:DescribeTab" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="DescribeTab">
+ <sequence>
+ <element name="custom" type="xsd:boolean"/>
+ <element name="iconUrl" type="xsd:string"/>
+ <element name="label" type="xsd:string"/>
+ <element name="miniIconUrl" type="xsd:string"/>
+ <element name="sobjectName" type="xsd:string" nillable="true"/>
+ <element name="url" type="xsd:string"/>
+ </sequence>
+ </complexType>
+
+
+
+
+
+ <!-- Login Message Types -->
+ <element name="login">
+ <complexType>
+ <sequence>
+ <element name="username" type="xsd:string"/>
+ <element name="password" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="loginResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:LoginResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Describe Message Types -->
+ <element name="describeSObject">
+ <complexType>
+ <sequence>
+ <element name="sObjectType" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="describeSObjectResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeSObjectResult" nillable="true"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- DescibeSObjects Message Types -->
+ <element name="describeSObjects">
+ <complexType>
+ <sequence>
+ <element name="sObjectType" type="xsd:string" minOccurs="0" maxOccurs="100"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="describeSObjectsResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeSObjectResult" nillable="true" minOccurs="0" maxOccurs="100"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Describe Global Message Types -->
+ <element name="describeGlobal">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <element name="describeGlobalResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeGlobalResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="describeLayout">
+ <complexType>
+ <sequence>
+ <element name="sObjectType" type="xsd:string"/>
+ <element name="recordTypeIds" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="describeLayoutResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeLayoutResult" nillable="true"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="describeSoftphoneLayout">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <element name="describeSoftphoneLayoutResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeSoftphoneLayoutResult" nillable="true"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <element name="describeTabs">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <element name="describeTabsResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DescribeTabSetResult" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Create Message Types -->
+ <element name="create">
+ <complexType>
+ <sequence>
+ <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="createResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:SaveResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <!-- Send Email Types -->
+ <element name="sendEmail">
+ <complexType>
+ <sequence>
+ <element name="messages" type="tns:Email" minOccurs="0" maxOccurs="10"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="sendEmailResponse">
+ <complexType>
+ <sequence>
+ <element name="result" minOccurs="0" maxOccurs="10" type="tns:SendEmailResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <!-- Update Message Types -->
+ <element name="update">
+ <complexType>
+ <sequence>
+ <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="updateResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:SaveResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Upsert Message Types -->
+ <element name="upsert">
+ <complexType>
+ <sequence>
+ <element name="externalIDFieldName" type="xsd:string"/>
+ <element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="upsertResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:UpsertResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Merge Message Types -->
+ <element name="merge">
+ <complexType>
+ <sequence>
+ <element name="request" type="tns:MergeRequest" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="mergeResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:MergeResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Delete Message Types -->
+ <element name="delete">
+ <complexType>
+ <sequence>
+ <element name="ids" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="deleteResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:DeleteResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Undelete Message Types -->
+ <element name="undelete">
+ <complexType>
+ <sequence>
+ <element name="ids" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="undeleteResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:UndeleteResult" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- EmptyRecycleBin Message Types -->
+ <element name="emptyRecycleBin">
+ <complexType>
+ <sequence>
+ <element name="ids" type="tns:ID" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="emptyRecycleBinResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:EmptyRecycleBinResult" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Process Message Types -->
+ <element name="process">
+ <complexType>
+ <sequence>
+ <element name="actions" type="tns:ProcessRequest" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="processResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:ProcessResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+
+ <!-- Retrieve (ID List) Message Types -->
+ <element name="retrieve">
+ <complexType>
+ <sequence>
+ <element name="fieldList" type="xsd:string"/>
+ <element name="sObjectType" type="xsd:string"/>
+ <element name="ids" type="tns:ID" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="retrieveResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="ens:sObject" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Convert Lead Message Types -->
+ <element name="convertLead">
+ <complexType>
+ <sequence>
+ <element name="leadConverts" type="tns:LeadConvert" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="convertLeadResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:LeadConvertResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Get Updated Message Types -->
+ <element name="getUpdated">
+ <complexType>
+ <sequence>
+ <element name="sObjectType" type="xsd:string"/>
+ <element name="startDate" type="xsd:dateTime"/>
+ <element name="endDate" type="xsd:dateTime"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getUpdatedResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:GetUpdatedResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Get Deleted Message Types -->
+ <element name="getDeleted">
+ <complexType>
+ <sequence>
+ <element name="sObjectType" type="xsd:string"/>
+ <element name="startDate" type="xsd:dateTime"/>
+ <element name="endDate" type="xsd:dateTime"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getDeletedResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:GetDeletedResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <!-- Logout current session -->
+ <element name="logout">
+ <complexType>
+ </complexType>
+ </element>
+
+ <element name="logoutResponse">
+ <complexType>
+ </complexType>
+ </element>
+
+ <!-- Invalidate a list of session ids -->
+ <element name="invalidateSessions">
+ <complexType>
+ <sequence>
+ <element name="sessionIds" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="invalidateSessionsResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:InvalidateSessionsResult" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Create Query -->
+ <element name="query">
+ <complexType>
+ <sequence>
+ <element name="queryString" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="queryResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:QueryResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Create Query All -->
+ <element name="queryAll">
+ <complexType>
+ <sequence>
+ <element name="queryString" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="queryAllResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:QueryResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Next Batch of sObjects from a query -->
+ <element name="queryMore">
+ <complexType>
+ <sequence>
+ <element name="queryLocator" type="tns:QueryLocator"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="queryMoreResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:QueryResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <!-- Create Search -->
+ <element name="search">
+ <complexType>
+ <sequence>
+ <element name="searchString" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="searchResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:SearchResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <element name="getServerTimestamp">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <element name="getServerTimestampResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:GetServerTimestampResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="setPassword">
+ <complexType>
+ <sequence>
+ <element name="userId" type="tns:ID"/>
+ <element name="password" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="setPasswordResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:SetPasswordResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="resetPassword">
+ <complexType>
+ <sequence>
+ <element name="userId" type="tns:ID"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="resetPasswordResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:ResetPasswordResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getUserInfo">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <element name="getUserInfoResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="tns:GetUserInfoResult"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <!-- Header Elements -->
+ <element name="SessionHeader">
+ <complexType>
+ <sequence>
+ <element name="sessionId" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="LoginScopeHeader">
+ <complexType>
+ <sequence>
+ <element name="organizationId" type="tns:ID"/>
+ <element name="portalId" type="tns:ID" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <element name="CallOptions">
+ <complexType>
+ <sequence>
+ <element name="client" type="xsd:string" nillable="true"/>
+ <element name="defaultNamespace" type="xsd:string" nillable="true"/>
+
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <element name="QueryOptions">
+ <complexType>
+ <sequence>
+ <element name="batchSize" type="xsd:int" minOccurs="0"/>
+
+ </sequence>
+ </complexType>
+ </element>
+
+
+ <simpleType name="DebugLevel">
+ <restriction base="xsd:string">
+ <enumeration value="None"/>
+ <enumeration value="DebugOnly"/>
+ <enumeration value="Db"/>
+ </restriction>
+ </simpleType>
+ <element name="DebuggingHeader">
+ <complexType>
+ <sequence>
+ <element name="debugLevel" type="tns:DebugLevel"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="DebuggingInfo">
+ <complexType>
+ <sequence>
+ <element name="debugLog" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <xsd:complexType name="PackageVersion">
+ <xsd:sequence>
+ <xsd:element name="majorNumber" type="xsd:int"/>
+ <xsd:element name="minorNumber" type="xsd:int"/>
+ <xsd:element name="namespace" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="PackageVersionHeader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="packageVersions" minOccurs="0" maxOccurs="unbounded" type="tns:PackageVersion"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <element name="AllowFieldTruncationHeader">
+ <complexType>
+ <sequence>
+ <element name="allowFieldTruncation" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <!-- ideally this could of just been elem name="..." type="xsd:boolean"
+ but is required to be nested within a complexType for .NET 1.1 compatibility -->
+ <element name="MruHeader">
+ <complexType>
+ <sequence>
+ <element name="updateMru" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="EmailHeader">
+ <complexType>
+ <sequence>
+ <element name="triggerAutoResponseEmail" type="xsd:boolean"/>
+ <element name="triggerOtherEmail" type="xsd:boolean"/>
+ <element name="triggerUserEmail" type="xsd:boolean"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="AssignmentRuleHeader">
+ <complexType>
+ <sequence>
+ <element name="assignmentRuleId" type="tns:ID" nillable="true"/>
+ <element name="useDefaultRule" type="xsd:boolean" nillable="true"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="UserTerritoryDeleteHeader">
+ <complexType>
+ <sequence>
+ <element name="transferToUserId" type="tns:ID" nillable="true"/>
+ </sequence>
+ </complexType>
+ </element>
+
+
+
+ <element name="LocaleOptions">
+ <complexType>
+ <sequence>
+ <element name="language" type="xsd:string" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+
+ <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:fault.partner.soap.sforce.com" xmlns:fns="urn:fault.partner.soap.sforce.com">
+
+ <simpleType name="ExceptionCode">
+ <restriction base="xsd:string">
+ <enumeration value="API_CURRENTLY_DISABLED"/>
+ <enumeration value="API_DISABLED_FOR_ORG"/>
+ <enumeration value="CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY"/>
+ <enumeration value="CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY"/>
+ <enumeration value="CIRCULAR_OBJECT_GRAPH"/>
+ <enumeration value="CLIENT_NOT_ACCESSIBLE_FOR_USER"/>
+ <enumeration value="CLIENT_REQUIRE_UPDATE_FOR_USER"/>
+ <enumeration value="CUSTOM_METADATA_LIMIT_EXCEEDED"/>
+ <enumeration value="DUPLICATE_VALUE"/>
+ <enumeration value="EMAIL_BATCH_SIZE_LIMIT_EXCEEDED"/>
+ <enumeration value="EMAIL_TO_CASE_INVALID_ROUTING"/>
+ <enumeration value="EMAIL_TO_CASE_LIMIT_EXCEEDED"/>
+ <enumeration value="EMAIL_TO_CASE_NOT_ENABLED"/>
+ <enumeration value="EXCEEDED_ID_LIMIT"/>
+ <enumeration value="EXCEEDED_LEAD_CONVERT_LIMIT"/>
+ <enumeration value="EXCEEDED_MAX_SIZE_REQUEST"/>
+ <enumeration value="EXCEEDED_MAX_TYPES_LIMIT"/>
+ <enumeration value="EXCEEDED_QUOTA"/>
+ <enumeration value="FUNCTIONALITY_NOT_ENABLED"/>
+ <enumeration value="INACTIVE_OWNER_OR_USER"/>
+ <enumeration value="INACTIVE_PORTAL"/>
+ <enumeration value="INSUFFICIENT_ACCESS"/>
+ <enumeration value="INVALID_ASSIGNMENT_RULE"/>
+ <enumeration value="INVALID_BATCH_SIZE"/>
+ <enumeration value="INVALID_CLIENT"/>
+ <enumeration value="INVALID_CROSS_REFERENCE_KEY"/>
+ <enumeration value="INVALID_FIELD"/>
+ <enumeration value="INVALID_FILTER_LANGUAGE"/>
+ <enumeration value="INVALID_FILTER_VALUE"/>
+ <enumeration value="INVALID_ID_FIELD"/>
+ <enumeration value="INVALID_LOCALE_LANGUAGE"/>
+ <enumeration value="INVALID_LOCATOR"/>
+ <enumeration value="INVALID_LOGIN"/>
+ <enumeration value="INVALID_NEW_PASSWORD"/>
+ <enumeration value="INVALID_OPERATION"/>
+ <enumeration value="INVALID_OPERATION_WITH_EXPIRED_PASSWORD"/>
+ <enumeration value="INVALID_QUERY_FILTER_OPERATOR"/>
+ <enumeration value="INVALID_QUERY_LOCATOR"/>
+ <enumeration value="INVALID_QUERY_SCOPE"/>
+ <enumeration value="INVALID_REPLICATION_DATE"/>
+ <enumeration value="INVALID_SEARCH"/>
+ <enumeration value="INVALID_SEARCH_SCOPE"/>
+ <enumeration value="INVALID_SESSION_ID"/>
+ <enumeration value="INVALID_SOAP_HEADER"/>
+ <enumeration value="INVALID_SSO_GATEWAY_URL"/>
+ <enumeration value="INVALID_TYPE"/>
+ <enumeration value="INVALID_TYPE_FOR_OPERATION"/>
+ <enumeration value="LIMIT_EXCEEDED"/>
+ <enumeration value="LOGIN_CHALLENGE_ISSUED"/>
+ <enumeration value="LOGIN_CHALLENGE_PENDING"/>
+ <enumeration value="LOGIN_DURING_RESTRICTED_DOMAIN"/>
+ <enumeration value="LOGIN_DURING_RESTRICTED_TIME"/>
+ <enumeration value="LOGIN_MUST_USE_SECURITY_TOKEN"/>
+ <enumeration value="MALFORMED_ID"/>
+ <enumeration value="MALFORMED_QUERY"/>
+ <enumeration value="MALFORMED_SEARCH"/>
+ <enumeration value="MISSING_ARGUMENT"/>
+ <enumeration value="NOT_MODIFIED"/>
+ <enumeration value="NO_SOFTPHONE_LAYOUT"/>
+ <enumeration value="NUMBER_OUTSIDE_VALID_RANGE"/>
+ <enumeration value="OPERATION_TOO_LARGE"/>
+ <enumeration value="ORG_LOCKED"/>
+ <enumeration value="ORG_NOT_OWNED_BY_INSTANCE"/>
+ <enumeration value="PASSWORD_LOCKOUT"/>
+ <enumeration value="PORTAL_NO_ACCESS"/>
+ <enumeration value="QUERY_TIMEOUT"/>
+ <enumeration value="QUERY_TOO_COMPLICATED"/>
+ <enumeration value="REQUEST_LIMIT_EXCEEDED"/>
+ <enumeration value="REQUEST_RUNNING_TOO_LONG"/>
+ <enumeration value="SERVER_UNAVAILABLE"/>
+ <enumeration value="SSO_SERVICE_DOWN"/>
+ <enumeration value="TOO_MANY_APEX_REQUESTS"/>
+ <enumeration value="TRIAL_EXPIRED"/>
+ <enumeration value="UNKNOWN_EXCEPTION"/>
+ <enumeration value="UNSUPPORTED_API_VERSION"/>
+ <enumeration value="UNSUPPORTED_CLIENT"/>
+ </restriction>
+ </simpleType>
+ <!-- For convenience these QNames are returned in the standard soap faultcode element -->
+ <simpleType name="FaultCode">
+ <restriction base="xsd:QName">
+ <enumeration value="fns:API_CURRENTLY_DISABLED"/>
+ <enumeration value="fns:API_DISABLED_FOR_ORG"/>
+ <enumeration value="fns:CANT_ADD_STANDADRD_PORTAL_USER_TO_TERRITORY"/>
+ <enumeration value="fns:CANT_ADD_STANDARD_PORTAL_USER_TO_TERRITORY"/>
+ <enumeration value="fns:CIRCULAR_OBJECT_GRAPH"/>
+ <enumeration value="fns:CLIENT_NOT_ACCESSIBLE_FOR_USER"/>
+ <enumeration value="fns:CLIENT_REQUIRE_UPDATE_FOR_USER"/>
+ <enumeration value="fns:CUSTOM_METADATA_LIMIT_EXCEEDED"/>
+ <enumeration value="fns:DUPLICATE_VALUE"/>
+ <enumeration value="fns:EMAIL_BATCH_SIZE_LIMIT_EXCEEDED"/>
+ <enumeration value="fns:EMAIL_TO_CASE_INVALID_ROUTING"/>
+ <enumeration value="fns:EMAIL_TO_CASE_LIMIT_EXCEEDED"/>
+ <enumeration value="fns:EMAIL_TO_CASE_NOT_ENABLED"/>
+ <enumeration value="fns:EXCEEDED_ID_LIMIT"/>
+ <enumeration value="fns:EXCEEDED_LEAD_CONVERT_LIMIT"/>
+ <enumeration value="fns:EXCEEDED_MAX_SIZE_REQUEST"/>
+ <enumeration value="fns:EXCEEDED_MAX_TYPES_LIMIT"/>
+ <enumeration value="fns:EXCEEDED_QUOTA"/>
+ <enumeration value="fns:FUNCTIONALITY_NOT_ENABLED"/>
+ <enumeration value="fns:INACTIVE_OWNER_OR_USER"/>
+ <enumeration value="fns:INACTIVE_PORTAL"/>
+ <enumeration value="fns:INSUFFICIENT_ACCESS"/>
+ <enumeration value="fns:INVALID_ASSIGNMENT_RULE"/>
+ <enumeration value="fns:INVALID_BATCH_SIZE"/>
+ <enumeration value="fns:INVALID_CLIENT"/>
+ <enumeration value="fns:INVALID_CROSS_REFERENCE_KEY"/>
+ <enumeration value="fns:INVALID_FIELD"/>
+ <enumeration value="fns:INVALID_FILTER_LANGUAGE"/>
+ <enumeration value="fns:INVALID_FILTER_VALUE"/>
+ <enumeration value="fns:INVALID_ID_FIELD"/>
+ <enumeration value="fns:INVALID_LOCALE_LANGUAGE"/>
+ <enumeration value="fns:INVALID_LOCATOR"/>
+ <enumeration value="fns:INVALID_LOGIN"/>
+ <enumeration value="fns:INVALID_NEW_PASSWORD"/>
+ <enumeration value="fns:INVALID_OPERATION"/>
+ <enumeration value="fns:INVALID_OPERATION_WITH_EXPIRED_PASSWORD"/>
+ <enumeration value="fns:INVALID_QUERY_FILTER_OPERATOR"/>
+ <enumeration value="fns:INVALID_QUERY_LOCATOR"/>
+ <enumeration value="fns:INVALID_QUERY_SCOPE"/>
+ <enumeration value="fns:INVALID_REPLICATION_DATE"/>
+ <enumeration value="fns:INVALID_SEARCH"/>
+ <enumeration value="fns:INVALID_SEARCH_SCOPE"/>
+ <enumeration value="fns:INVALID_SESSION_ID"/>
+ <enumeration value="fns:INVALID_SOAP_HEADER"/>
+ <enumeration value="fns:INVALID_SSO_GATEWAY_URL"/>
+ <enumeration value="fns:INVALID_TYPE"/>
+ <enumeration value="fns:INVALID_TYPE_FOR_OPERATION"/>
+ <enumeration value="fns:LIMIT_EXCEEDED"/>
+ <enumeration value="fns:LOGIN_CHALLENGE_ISSUED"/>
+ <enumeration value="fns:LOGIN_CHALLENGE_PENDING"/>
+ <enumeration value="fns:LOGIN_DURING_RESTRICTED_DOMAIN"/>
+ <enumeration value="fns:LOGIN_DURING_RESTRICTED_TIME"/>
+ <enumeration value="fns:LOGIN_MUST_USE_SECURITY_TOKEN"/>
+ <enumeration value="fns:MALFORMED_ID"/>
+ <enumeration value="fns:MALFORMED_QUERY"/>
+ <enumeration value="fns:MALFORMED_SEARCH"/>
+ <enumeration value="fns:MISSING_ARGUMENT"/>
+ <enumeration value="fns:NOT_MODIFIED"/>
+ <enumeration value="fns:NO_SOFTPHONE_LAYOUT"/>
+ <enumeration value="fns:NUMBER_OUTSIDE_VALID_RANGE"/>
+ <enumeration value="fns:OPERATION_TOO_LARGE"/>
+ <enumeration value="fns:ORG_LOCKED"/>
+ <enumeration value="fns:ORG_NOT_OWNED_BY_INSTANCE"/>
+ <enumeration value="fns:PASSWORD_LOCKOUT"/>
+ <enumeration value="fns:PORTAL_NO_ACCESS"/>
+ <enumeration value="fns:QUERY_TIMEOUT"/>
+ <enumeration value="fns:QUERY_TOO_COMPLICATED"/>
+ <enumeration value="fns:REQUEST_LIMIT_EXCEEDED"/>
+ <enumeration value="fns:REQUEST_RUNNING_TOO_LONG"/>
+ <enumeration value="fns:SERVER_UNAVAILABLE"/>
+ <enumeration value="fns:SSO_SERVICE_DOWN"/>
+ <enumeration value="fns:TOO_MANY_APEX_REQUESTS"/>
+ <enumeration value="fns:TRIAL_EXPIRED"/>
+ <enumeration value="fns:UNKNOWN_EXCEPTION"/>
+ <enumeration value="fns:UNSUPPORTED_API_VERSION"/>
+ <enumeration value="fns:UNSUPPORTED_CLIENT"/>
+ </restriction>
+ </simpleType>
+
+
+ <!-- Fault -->
+ <complexType name="ApiFault">
+ <sequence>
+ <element name="exceptionCode" type="fns:ExceptionCode"/>
+ <element name="exceptionMessage" type="xsd:string"/>
+
+ </sequence>
+ </complexType>
+
+ <element name="fault" type="fns:ApiFault"/>
+
+ <complexType name="ApiQueryFault">
+ <complexContent>
+ <extension base="fns:ApiFault">
+ <sequence>
+ <element name="row" type="xsd:int"/>
+ <element name="column" type="xsd:int"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="LoginFault">
+ <complexContent>
+ <extension base="fns:ApiFault"/>
+ </complexContent>
+ </complexType>
+ <element name="LoginFault" type="fns:LoginFault"/>
+
+ <complexType name="InvalidQueryLocatorFault">
+ <complexContent>
+ <extension base="fns:ApiFault"/>
+ </complexContent>
+ </complexType>
+ <element name="InvalidQueryLocatorFault" type="fns:InvalidQueryLocatorFault"/>
+
+ <complexType name="InvalidNewPasswordFault">
+ <complexContent>
+ <extension base="fns:ApiFault"/>
+ </complexContent>
+ </complexType>
+ <element name="InvalidNewPasswordFault" type="fns:InvalidNewPasswordFault"/>
+
+ <complexType name="InvalidIdFault">
+ <complexContent>
+ <extension base="fns:ApiFault"/>
+ </complexContent>
+ </complexType>
+ <element name="InvalidIdFault" type="fns:InvalidIdFault"/>
+
+ <complexType name="UnexpectedErrorFault">
+ <complexContent>
+ <extension base="fns:ApiFault"/>
+ </complexContent>
+ </complexType>
+ <element name="UnexpectedErrorFault" type="fns:UnexpectedErrorFault"/>
+
+ <complexType name="InvalidFieldFault">
+ <complexContent>
+ <extension base="fns:ApiQueryFault"/>
+ </complexContent>
+ </complexType>
+ <element name="InvalidFieldFault" type="fns:InvalidFieldFault"/>
+
+ <complexType name="InvalidSObjectFault">
+ <complexContent>
+ <extension base="fns:ApiQueryFault"/>
+ </complexContent>
+ </complexType>
+ <element name="InvalidSObjectFault" type="fns:InvalidSObjectFault"/>
+
+ <complexType name="MalformedQueryFault">
+ <complexContent>
+ <extension base="fns:ApiQueryFault"/>
+ </complexContent>
+ </complexType>
+ <element name="MalformedQueryFault" type="fns:MalformedQueryFault"/>
+
+ <complexType name="MalformedSearchFault">
+ <complexContent>
+ <extension base="fns:ApiQueryFault"/>
+ </complexContent>
+ </complexType>
+ <element name="MalformedSearchFault" type="fns:MalformedSearchFault"/>
+
+
+ </schema>
+ </types>
+
+ <!-- Header Message -->
+ <message name="Header">
+ <part element="tns:LoginScopeHeader" name="LoginScopeHeader"/>
+ <part element="tns:SessionHeader" name="SessionHeader"/>
+
+ <part element="tns:CallOptions" name="CallOptions"/>
+
+ <part element="tns:QueryOptions" name="QueryOptions"/>
+ <part element="tns:AssignmentRuleHeader" name="AssignmentRuleHeader"/>
+ <part element="tns:AllowFieldTruncationHeader" name="AllowFieldTruncationHeader"/>
+
+ <part element="tns:MruHeader" name="MruHeader"/>
+ <part element="tns:EmailHeader" name="EmailHeader"/>
+
+ <part element="tns:UserTerritoryDeleteHeader" name="UserTerritoryDeleteHeader"/>
+
+ <part element="tns:DebuggingHeader" name="DebuggingHeader"/>
+ <part element="tns:PackageVersionHeader" name="PackageVersionHeader"/>
+ <part element="tns:DebuggingInfo" name="DebuggingInfo"/>
+ <part element="tns:LocaleOptions" name="LocaleOptions"/>
+ </message>
+
+ <!-- Fault Messages -->
+
+ <message name="ApiFault">
+ <part name="fault" element="fns:fault"/>
+ </message>
+
+ <message name="LoginFault">
+ <part name="fault" element="fns:LoginFault"/>
+ </message>
+ <message name="InvalidQueryLocatorFault">
+ <part name="fault" element="fns:InvalidQueryLocatorFault"/>
+ </message>
+ <message name="InvalidNewPasswordFault">
+ <part name="fault" element="fns:InvalidNewPasswordFault"/>
+ </message>
+ <message name="InvalidIdFault">
+ <part name="fault" element="fns:InvalidIdFault"/>
+ </message>
+ <message name="UnexpectedErrorFault">
+ <part name="fault" element="fns:UnexpectedErrorFault"/>
+ </message>
+ <message name="InvalidFieldFault">
+ <part name="fault" element="fns:InvalidFieldFault"/>
+ </message>
+ <message name="InvalidSObjectFault">
+ <part name="fault" element="fns:InvalidSObjectFault"/>
+ </message>
+ <message name="MalformedQueryFault">
+ <part name="fault" element="fns:MalformedQueryFault"/>
+ </message>
+ <message name="MalformedSearchFault">
+ <part name="fault" element="fns:MalformedSearchFault"/>
+ </message>
+
+
+ <!-- Method Messages -->
+ <message name="loginRequest">
+ <part element="tns:login" name="parameters"/>
+ </message>
+ <message name="loginResponse">
+ <part element="tns:loginResponse" name="parameters"/>
+ </message>
+
+ <message name="describeSObjectRequest">
+ <part element="tns:describeSObject" name="parameters"/>
+ </message>
+ <message name="describeSObjectResponse">
+ <part element="tns:describeSObjectResponse" name="parameters"/>
+ </message>
+
+ <message name="describeSObjectsRequest">
+ <part element="tns:describeSObjects" name="parameters"/>
+ </message>
+ <message name="describeSObjectsResponse">
+ <part element="tns:describeSObjectsResponse" name="parameters"/>
+ </message>
+
+ <message name="describeGlobalRequest">
+ <part element="tns:describeGlobal" name="parameters"/>
+ </message>
+ <message name="describeGlobalResponse">
+ <part element="tns:describeGlobalResponse" name="parameters"/>
+ </message>
+
+ <message name="describeLayoutRequest">
+ <part element="tns:describeLayout" name="parameters"/>
+ </message>
+ <message name="describeLayoutResponse">
+ <part element="tns:describeLayoutResponse" name="parameters"/>
+ </message>
+
+ <message name="describeSoftphoneLayoutRequest">
+ <part element="tns:describeSoftphoneLayout" name="parameters"/>
+ </message>
+ <message name="describeSoftphoneLayoutResponse">
+ <part element="tns:describeSoftphoneLayoutResponse" name="parameters"/>
+ </message>
+
+ <message name="describeTabsRequest">
+ <part element="tns:describeTabs" name="parameters"/>
+ </message>
+ <message name="describeTabsResponse">
+ <part element="tns:describeTabsResponse" name="parameters"/>
+ </message>
+
+ <message name="createRequest">
+ <part element="tns:create" name="parameters"/>
+ </message>
+ <message name="createResponse">
+ <part element="tns:createResponse" name="parameters"/>
+ </message>
+
+ <message name="updateRequest">
+ <part element="tns:update" name="parameters"/>
+ </message>
+ <message name="updateResponse">
+ <part element="tns:updateResponse" name="parameters"/>
+ </message>
+
+ <message name="upsertRequest">
+ <part element="tns:upsert" name="parameters"/>
+ </message>
+ <message name="upsertResponse">
+ <part element="tns:upsertResponse" name="parameters"/>
+ </message>
+
+ <message name="mergeRequest">
+ <part element="tns:merge" name="parameters"/>
+ </message>
+ <message name="mergeResponse">
+ <part element="tns:mergeResponse" name="parameters"/>
+ </message>
+
+ <message name="deleteRequest">
+ <part element="tns:delete" name="parameters"/>
+ </message>
+ <message name="deleteResponse">
+ <part element="tns:deleteResponse" name="parameters"/>
+ </message>
+
+ <message name="undeleteRequest">
+ <part element="tns:undelete" name="parameters"/>
+ </message>
+ <message name="undeleteResponse">
+ <part element="tns:undeleteResponse" name="parameters"/>
+ </message>
+
+ <message name="emptyRecycleBinRequest">
+ <part element="tns:emptyRecycleBin" name="parameters"/>
+ </message>
+ <message name="emptyRecycleBinResponse">
+ <part element="tns:emptyRecycleBinResponse" name="parameters"/>
+ </message>
+
+ <message name="retrieveRequest">
+ <part element="tns:retrieve" name="parameters"/>
+ </message>
+ <message name="retrieveResponse">
+ <part element="tns:retrieveResponse" name="parameters"/>
+ </message>
+
+ <message name="processRequest">
+ <part element="tns:process" name="parameters"/>
+ </message>
+ <message name="processResponse">
+ <part element="tns:processResponse" name="parameters"/>
+ </message>
+
+ <message name="convertLeadRequest">
+ <part element="tns:convertLead" name="parameters"/>
+ </message>
+ <message name="convertLeadResponse">
+ <part element="tns:convertLeadResponse" name="parameters"/>
+ </message>
+
+ <message name="logoutRequest">
+ <part element="tns:logout" name="parameters"/>
+ </message>
+ <message name="logoutResponse">
+ <part element="tns:logoutResponse" name="parameters"/>
+ </message>
+
+ <message name="invalidateSessionsRequest">
+ <part element="tns:invalidateSessions" name="parameters"/>
+ </message>
+ <message name="invalidateSessionsResponse">
+ <part element="tns:invalidateSessionsResponse" name="parameters"/>
+ </message>
+
+ <message name="getDeletedRequest">
+ <part element="tns:getDeleted" name="parameters"/>
+ </message>
+ <message name="getDeletedResponse">
+ <part element="tns:getDeletedResponse" name="parameters"/>
+ </message>
+
+ <message name="getUpdatedRequest">
+ <part element="tns:getUpdated" name="parameters"/>
+ </message>
+ <message name="getUpdatedResponse">
+ <part element="tns:getUpdatedResponse" name="parameters"/>
+ </message>
+
+ <message name="queryRequest">
+ <part element="tns:query" name="parameters"/>
+ </message>
+ <message name="queryResponse">
+ <part element="tns:queryResponse" name="parameters"/>
+ </message>
+
+ <message name="queryAllRequest">
+ <part element="tns:queryAll" name="parameters"/>
+ </message>
+ <message name="queryAllResponse">
+ <part element="tns:queryAllResponse" name="parameters"/>
+ </message>
+
+ <message name="queryMoreRequest">
+ <part element="tns:queryMore" name="parameters"/>
+ </message>
+ <message name="queryMoreResponse">
+ <part element="tns:queryMoreResponse" name="parameters"/>
+ </message>
+
+ <message name="searchRequest">
+ <part element="tns:search" name="parameters"/>
+ </message>
+ <message name="searchResponse">
+ <part element="tns:searchResponse" name="parameters"/>
+ </message>
+
+ <message name="getServerTimestampRequest">
+ <part element="tns:getServerTimestamp" name="parameters"/>
+ </message>
+ <message name="getServerTimestampResponse">
+ <part element="tns:getServerTimestampResponse" name="parameters"/>
+ </message>
+
+ <message name="setPasswordRequest">
+ <part element="tns:setPassword" name="parameters"/>
+ </message>
+ <message name="setPasswordResponse">
+ <part element="tns:setPasswordResponse" name="parameters"/>
+ </message>
+
+ <message name="resetPasswordRequest">
+ <part element="tns:resetPassword" name="parameters"/>
+ </message>
+ <message name="resetPasswordResponse">
+ <part element="tns:resetPasswordResponse" name="parameters"/>
+ </message>
+
+ <message name="getUserInfoRequest">
+ <part element="tns:getUserInfo" name="parameters"/>
+ </message>
+ <message name="getUserInfoResponse">
+ <part element="tns:getUserInfoResponse" name="parameters"/>
+ </message>
+
+ <message name="sendEmailRequest">
+ <part element="tns:sendEmail" name="parameters"/>
+ </message>
+ <message name="sendEmailResponse">
+ <part element="tns:sendEmailResponse" name="parameters"/>
+ </message>
+
+
+
+ <!-- Soap PortType -->
+ <portType name="Soap">
+ <operation name="login">
+ <documentation>Login to the Salesforce.com SOAP Api</documentation>
+ <input message="tns:loginRequest"/>
+ <output message="tns:loginResponse"/>
+ <fault message="tns:LoginFault" name="LoginFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ </operation>
+
+ <operation name="describeSObject">
+ <documentation>Describe an sObject</documentation>
+ <input message="tns:describeSObjectRequest"/>
+ <output message="tns:describeSObjectResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="describeSObjects">
+ <documentation>Describe a number sObjects</documentation>
+ <input message="tns:describeSObjectsRequest"/>
+ <output message="tns:describeSObjectsResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="describeGlobal">
+ <documentation>Describe the Global state</documentation>
+ <input message="tns:describeGlobalRequest"/>
+ <output message="tns:describeGlobalResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="describeLayout">
+ <documentation>Describe the layout of an sObject</documentation>
+ <input message="tns:describeLayoutRequest"/>
+ <output message="tns:describeLayoutResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ </operation>
+
+ <operation name="describeSoftphoneLayout">
+ <documentation>Describe the layout of the SoftPhone</documentation>
+ <input message="tns:describeSoftphoneLayoutRequest"/>
+ <output message="tns:describeSoftphoneLayoutResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="describeTabs">
+ <documentation>Describe the tabs that appear on a users page</documentation>
+ <input message="tns:describeTabsRequest"/>
+ <output message="tns:describeTabsResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="create">
+ <documentation>Create a set of new sObjects</documentation>
+ <input message="tns:createRequest"/>
+ <output message="tns:createResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ </operation>
+
+ <operation name="update">
+ <documentation>Update a set of sObjects</documentation>
+ <input message="tns:updateRequest"/>
+ <output message="tns:updateResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ </operation>
+
+ <operation name="upsert">
+ <documentation>Update or insert a set of sObjects based on object id</documentation>
+ <input message="tns:upsertRequest"/>
+ <output message="tns:upsertResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ </operation>
+
+ <operation name="merge">
+ <documentation>Merge and update a set of sObjects based on object id</documentation>
+ <input message="tns:mergeRequest"/>
+ <output message="tns:mergeResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ </operation>
+
+ <operation name="delete">
+ <documentation>Delete a set of sObjects</documentation>
+ <input message="tns:deleteRequest"/>
+ <output message="tns:deleteResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="undelete">
+ <documentation>Undelete a set of sObjects</documentation>
+ <input message="tns:undeleteRequest"/>
+ <output message="tns:undeleteResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="emptyRecycleBin">
+ <documentation>Empty a set of sObjects from the recycle bin</documentation>
+ <input message="tns:emptyRecycleBinRequest"/>
+ <output message="tns:emptyRecycleBinResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="retrieve">
+ <documentation>Get a set of sObjects</documentation>
+ <input message="tns:retrieveRequest"/>
+ <output message="tns:retrieveResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ </operation>
+
+ <operation name="process">
+ <documentation>Submit an entity to a workflow process or process a workitem</documentation>
+ <input message="tns:processRequest"/>
+ <output message="tns:processResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ </operation>
+
+ <operation name="convertLead">
+ <documentation>convert a set of leads</documentation>
+ <input message="tns:convertLeadRequest"/>
+ <output message="tns:convertLeadResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="logout">
+ <documentation>Logout the current user, invalidating the current session.</documentation>
+ <input message="tns:logoutRequest"/>
+ <output message="tns:logoutResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="invalidateSessions">
+ <documentation>Logs out and invalidates session ids</documentation>
+ <input message="tns:invalidateSessionsRequest"/>
+ <output message="tns:invalidateSessionsResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="getDeleted">
+ <documentation>Get the IDs for deleted sObjects</documentation>
+ <input message="tns:getDeletedRequest"/>
+ <output message="tns:getDeletedResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="getUpdated">
+ <documentation>Get the IDs for updated sObjects</documentation>
+ <input message="tns:getUpdatedRequest"/>
+ <output message="tns:getUpdatedResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="query">
+ <documentation>Create a Query Cursor</documentation>
+ <input message="tns:queryRequest"/>
+ <output message="tns:queryResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
+ </operation>
+
+ <operation name="queryAll">
+ <documentation>Create a Query Cursor, including deleted sObjects</documentation>
+ <input message="tns:queryAllRequest"/>
+ <output message="tns:queryAllResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ <fault message="tns:MalformedQueryFault" name="MalformedQueryFault"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
+ </operation>
+
+ <operation name="queryMore">
+ <documentation>Gets the next batch of sObjects from a query</documentation>
+ <input message="tns:queryMoreRequest"/>
+ <output message="tns:queryMoreResponse"/>
+ <fault message="tns:InvalidQueryLocatorFault" name="InvalidQueryLocatorFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ </operation>
+
+ <operation name="search">
+ <documentation>Search for sObjects</documentation>
+ <input message="tns:searchRequest"/>
+ <output message="tns:searchResponse"/>
+ <fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
+ <fault message="tns:InvalidFieldFault" name="InvalidFieldFault"/>
+ <fault message="tns:MalformedSearchFault" name="MalformedSearchFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="getServerTimestamp">
+ <documentation>Gets server timestamp</documentation>
+ <input message="tns:getServerTimestampRequest"/>
+ <output message="tns:getServerTimestampResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="setPassword">
+ <documentation>Set a user's password</documentation>
+ <input message="tns:setPasswordRequest"/>
+ <output message="tns:setPasswordResponse"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:InvalidNewPasswordFault" name="InvalidNewPasswordFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="resetPassword">
+ <documentation>Reset a user's password</documentation>
+ <input message="tns:resetPasswordRequest"/>
+ <output message="tns:resetPasswordResponse"/>
+ <fault message="tns:InvalidIdFault" name="InvalidIdFault"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="getUserInfo">
+ <documentation>Returns standard information relevant to the current user</documentation>
+ <input message="tns:getUserInfoRequest"/>
+ <output message="tns:getUserInfoResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ <operation name="sendEmail">
+ <documentation>Send outbound email</documentation>
+ <input message="tns:sendEmailRequest"/>
+ <output message="tns:sendEmailResponse"/>
+ <fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
+ </operation>
+
+ </portType>
+
+ <!-- Soap Binding -->
+ <binding name="SoapBinding" type="tns:Soap">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="login">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="LoginScopeHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="LoginFault">
+ <soap:fault name="LoginFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeSObject">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="LocaleOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeSObjects">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="LocaleOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeGlobal">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeLayout">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeSoftphoneLayout">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="describeTabs">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="create">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="update">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="upsert">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="merge">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AssignmentRuleHeader"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="delete">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="UserTerritoryDeleteHeader"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="undelete">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="emptyRecycleBin">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="retrieve">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ <fault name="MalformedQueryFault">
+ <soap:fault name="MalformedQueryFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="process">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="convertLead">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="AllowFieldTruncationHeader"/>
+ <soap:header use="literal" message="tns:Header" part="DebuggingHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:header use="literal" message="tns:Header" part="DebuggingInfo"/>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="logout">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="invalidateSessions">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getDeleted">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getUpdated">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="query">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
+ <soap:header use="literal" message="tns:Header" part="MruHeader"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ <fault name="MalformedQueryFault">
+ <soap:fault name="MalformedQueryFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidQueryLocatorFault">
+ <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="queryAll">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ <fault name="MalformedQueryFault">
+ <soap:fault name="MalformedQueryFault" use="literal"/>
+ </fault>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidQueryLocatorFault">
+ <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="queryMore">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="QueryOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidQueryLocatorFault">
+ <soap:fault name="InvalidQueryLocatorFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="search">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="PackageVersionHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidSObjectFault">
+ <soap:fault name="InvalidSObjectFault" use="literal"/>
+ </fault>
+ <fault name="InvalidFieldFault">
+ <soap:fault name="InvalidFieldFault" use="literal"/>
+ </fault>
+ <fault name="MalformedSearchFault">
+ <soap:fault name="MalformedSearchFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getServerTimestamp">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="setPassword">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="InvalidNewPasswordFault">
+ <soap:fault name="InvalidNewPasswordFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="resetPassword">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:header use="literal" message="tns:Header" part="EmailHeader"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="InvalidIdFault">
+ <soap:fault name="InvalidIdFault" use="literal"/>
+ </fault>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getUserInfo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="sendEmail">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:header use="literal" message="tns:Header" part="SessionHeader"/>
+ <soap:header use="literal" message="tns:Header" part="CallOptions"/>
+ <soap:body parts="parameters" use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="UnexpectedErrorFault">
+ <soap:fault name="UnexpectedErrorFault" use="literal"/>
+ </fault>
+ </operation>
+
+ </binding>
+
+ <!-- Soap Service Endpoint -->
+ <service name="SforceService">
+ <documentation>Sforce SOAP API</documentation>
+ <port binding="tns:SoapBinding" name="Soap">
+ <soap:address location="https://www.salesforce.com/services/Soap/u/17.0"/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: trunk/connectors/salesforce-api/src/main/resources/partner_v17.wsdl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooCapabilities.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.yahoo;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-
-/**
- * Specifies the capabilities of this connector. The Yahoo connector
- * supports only some basic criteria capability
- */
-public class YahooCapabilities extends BasicConnectorCapabilities {
-
- public static final int YAHOO_MAX_SET_SIZE = 100;
-
- /**
- * Construct the capabilities class
- */
- public YahooCapabilities() {
- }
-
- public List getSupportedFunctions() {
- return Collections.EMPTY_LIST;
- }
-
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- public boolean supportsInCriteria() {
- return true;
- }
-
- public int getMaxInCriteriaSize() {
- return YAHOO_MAX_SET_SIZE;
- }
-
-}
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -47,7 +47,6 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
@@ -56,7 +55,7 @@
/**
* Represents the execution of a command.
*/
-public class YahooExecution extends BasicExecution implements ResultSetExecution {
+public class YahooExecution implements ResultSetExecution {
public static final String JAVA_PROP_HTTP_PROXY_HOST = "http.proxyHost"; //$NON-NLS-1$
public static final String JAVA_PROP_HTTP_PROXY_PORT = "http.proxyPort"; //$NON-NLS-1$
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 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,29 +22,44 @@
package org.teiid.translator.yahoo;
+import java.util.Collections;
+import java.util.List;
+
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
-public class YahooExecutionFactory extends BasicExecutionFactory {
+public class YahooExecutionFactory extends ExecutionFactory {
+ public static final int YAHOO_MAX_SET_SIZE = 100;
+
@Override
public void start() throws ConnectorException {
}
@Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return YahooCapabilities.class;
- }
-
- @Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
throws ConnectorException {
return new YahooExecution((Select)command, metadata);
}
+
+ public List getSupportedFunctions() {
+ return Collections.EMPTY_LIST;
+ }
+
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ public int getMaxInCriteriaSize() {
+ return YAHOO_MAX_SET_SIZE;
+ }
}
Modified: trunk/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/sandbox/translator-yahoo/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.yahoo.YahooExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.yahoo.YahooExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -35,14 +35,14 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
+import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
/**
*/
-public abstract class JDBCBaseExecution extends BasicExecution {
+public abstract class JDBCBaseExecution implements Execution {
// ===========================================================================================================================
// Fields
@@ -50,8 +50,8 @@
// Passed to constructor
protected Connection connection;
- protected Translator sqlTranslator;
protected ExecutionContext context;
+ protected JDBCExecutionFactory executionFactory;
// Derived from properties
protected boolean trimString;
@@ -65,17 +65,18 @@
// Constructors
// ===========================================================================================================================
- protected JDBCBaseExecution(Connection connection, ExecutionContext context, JDBCExecutionFactory env, Translator translator) {
+ protected JDBCBaseExecution(Connection connection, ExecutionContext context, JDBCExecutionFactory jef) {
this.connection = connection;
- this.sqlTranslator = translator;
this.context = context;
- trimString = env.isTrimStrings();
- fetchSize = (env.getFetchSize() != -1)?env.getFetchSize():context.getBatchSize();
- maxResultRows = env.getMaxResultRows();
+ this.executionFactory = jef;
+
+ trimString = jef.isTrimStrings();
+ fetchSize = (jef.getFetchSize() != -1)?jef.getFetchSize():context.getBatchSize();
+ maxResultRows = jef.getMaxResultRows();
//if the connector work needs to throw an excpetion, set the size plus 1
- if (maxResultRows > 0 && env.isExceptionOnMaxRows()) {
+ if (maxResultRows > 0 && jef.isExceptionOnMaxRows()) {
maxResultRows++;
}
if (maxResultRows > 0) {
@@ -97,7 +98,7 @@
value = ((List<?>)value).get(row);
}
Class<?> paramType = paramValue.getType();
- sqlTranslator.bindValue(stmt, value, paramType, i+1);
+ this.executionFactory.bindValue(stmt, value, paramType, i+1);
}
if (rowCount > 1) {
stmt.addBatch();
@@ -110,7 +111,7 @@
// ===========================================================================================================================
protected TranslatedCommand translateCommand(Command command) throws ConnectorException {
- TranslatedCommand translatedCommand = new TranslatedCommand(context, sqlTranslator);
+ TranslatedCommand translatedCommand = new TranslatedCommand(context, this.executionFactory);
translatedCommand.translateCommand(command);
if (translatedCommand.getSql() != null && LogManager.isMessageToBeRecorded(LogConstants.CTX_CONNECTOR, MessageLevel.DETAIL)) {
@@ -199,10 +200,6 @@
return this.connection;
}
- public Translator getSqlTranslator() {
- return sqlTranslator;
- }
-
public void addStatementWarnings() throws SQLException {
SQLWarning warning = this.statement.getWarnings();
while (warning != null) {
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,331 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-
-/**
- */
-public class JDBCCapabilities extends BasicConnectorCapabilities {
-
- /**
- *
- */
- public JDBCCapabilities() {
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- return Arrays.asList(new String[] { "+", "-", "*", "/" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#getMaxInCriteriaSize()
- * @since 4.2
- */
- public int getMaxInCriteriaSize() {
- return 1000;
- }
-
- @Override
- public boolean supportsGroupBy() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesAvg()
- */
- public boolean supportsAggregatesAvg() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesCount()
- */
- public boolean supportsAggregatesCount() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesCountStar()
- */
- public boolean supportsAggregatesCountStar() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesDistinct()
- */
- public boolean supportsAggregatesDistinct() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesMax()
- */
- public boolean supportsAggregatesMax() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesMin()
- */
- public boolean supportsAggregatesMin() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesSum()
- */
- public boolean supportsAggregatesSum() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAliasedGroup()
- */
- public boolean supportsAliasedGroup() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsBetweenCriteria()
- */
- public boolean supportsBetweenCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCaseExpressions()
- */
- public boolean supportsCaseExpressions() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
- */
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCorrelatedSubqueries()
- */
- public boolean supportsCorrelatedSubqueries() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsExistsCriteria()
- */
- public boolean supportsExistsCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteria()
- */
- public boolean supportsInCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteriaSubquery()
- */
- public boolean supportsInCriteriaSubquery() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsIsNullCriteria()
- */
- public boolean supportsIsNullCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteria()
- */
- public boolean supportsLikeCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteriaEscapeCharacter()
- */
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsNotCriteria()
- */
- public boolean supportsNotCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOrCriteria()
- */
- public boolean supportsOrCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOrderBy()
- */
- public boolean supportsOrderBy() {
- return true;
- }
-
- @Override
- public boolean supportsOrderByUnrelated() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOuterJoins()
- */
- public boolean supportsOuterJoins() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
- */
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsScalarSubqueries()
- */
- public boolean supportsScalarSubqueries() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSearchedCaseExpressions()
- */
- public boolean supportsSearchedCaseExpressions() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSelectDistinct()
- */
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSelfJoins()
- */
- public boolean supportsSelfJoins() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsInlineViews()
- */
- public boolean supportsInlineViews() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsQuantifiedCompareCriteriaSome()
- */
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsSetQueryOrderBy()
- */
- @Override
- public boolean supportsSetQueryOrderBy() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsUnions()
- */
- public boolean supportsUnions() {
- return true;
- }
-
- @Override
- public boolean supportsBulkUpdate() {
- return true;
- }
-
- @Override
- 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;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return true;
- }
-
-}
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 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,73 +22,143 @@
package org.teiid.translator.jdbc;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.CallableStatement;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
import javax.sql.DataSource;
-import org.teiid.core.TeiidException;
import org.teiid.core.util.PropertiesUtils;
-import org.teiid.core.util.ReflectionHelper;
-import org.teiid.core.util.StringUtil;
+import org.teiid.language.Argument;
import org.teiid.language.Call;
+import org.teiid.language.ColumnReference;
import org.teiid.language.Command;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageObject;
+import org.teiid.language.Limit;
+import org.teiid.language.Literal;
import org.teiid.language.QueryExpression;
+import org.teiid.language.SetQuery;
+import org.teiid.language.Argument.Direction;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
+import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TranslatorProperty;
+import org.teiid.translator.TypeFacility;
import org.teiid.translator.UpdateExecution;
/**
* JDBC implementation of Connector interface.
*/
-public class JDBCExecutionFactory extends BasicExecutionFactory implements MetadataProvider {
+public class JDBCExecutionFactory extends ExecutionFactory implements MetadataProvider {
+
+ public static final int DEFAULT_MAX_IN_CRITERIA = 1000;
+
+ public enum NullOrder {
+ HIGH,
+ LOW,
+ FIRST,
+ LAST
+ }
- private ConnectorCapabilities capabilities;
- private Translator sqlTranslator;
+ // Because the retrieveValue() method will be hit for every value of
+ // every JDBC result set returned, we do lots of weird special stuff here
+ // to improve the performance (most importantly to remove big if/else checks
+ // of every possible type.
+
+ private static final Map<Class<?>, Integer> TYPE_CODE_MAP = new HashMap<Class<?>, Integer>();
+
+ private static final int INTEGER_CODE = 0;
+ private static final int LONG_CODE = 1;
+ private static final int DOUBLE_CODE = 2;
+ private static final int BIGDECIMAL_CODE = 3;
+ private static final int SHORT_CODE = 4;
+ private static final int FLOAT_CODE = 5;
+ private static final int TIME_CODE = 6;
+ private static final int DATE_CODE = 7;
+ private static final int TIMESTAMP_CODE = 8;
+ private static final int BLOB_CODE = 9;
+ private static final int CLOB_CODE = 10;
+ private static final int BOOLEAN_CODE = 11;
+
+ static {
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.INTEGER, new Integer(INTEGER_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.LONG, new Integer(LONG_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.DOUBLE, new Integer(DOUBLE_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BIG_DECIMAL, new Integer(BIGDECIMAL_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.SHORT, new Integer(SHORT_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.FLOAT, new Integer(FLOAT_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.TIME, new Integer(TIME_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.DATE, new Integer(DATE_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.TIMESTAMP, new Integer(TIMESTAMP_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BLOB, new Integer(BLOB_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.CLOB, new Integer(CLOB_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BOOLEAN, new Integer(BOOLEAN_CODE));
+ TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BYTE, new Integer(SHORT_CODE));
+ }
+
+ private static final ThreadLocal<MessageFormat> COMMENT = new ThreadLocal<MessageFormat>() {
+ protected MessageFormat initialValue() {
+ return new MessageFormat("/*teiid sessionid:{0}, requestid:{1}.{2}*/ "); //$NON-NLS-1$
+ }
+ };
+ public final static TimeZone DEFAULT_TIME_ZONE = TimeZone.getDefault();
+
+ private static final ThreadLocal<Calendar> CALENDAR = new ThreadLocal<Calendar>() {
+ @Override
+ protected Calendar initialValue() {
+ return Calendar.getInstance();
+ }
+ };
+
+ private Map<String, FunctionModifier> functionModifiers = new HashMap<String, FunctionModifier>();
+
private boolean useBindVariables;
private String databaseTimeZone;
- private String extensionTranslationClassName;
private boolean trimStrings;
private boolean useCommentsInSourceQuery;
private int fetchSize;
+
+ boolean initialConnection = true;
@Override
public void start() throws ConnectorException {
super.start();
- capabilities = getTranslator().getConnectorCapabilities();
+
+ String timeZone = getDatabaseTimeZone();
+ if(timeZone != null && timeZone.trim().length() > 0) {
+ TimeZone tz = TimeZone.getTimeZone(timeZone);
+ if(!DEFAULT_TIME_ZONE.hasSameRules(tz)) {
+ CALENDAR.set(Calendar.getInstance(tz));
+ }
+ }
}
-
- public Translator getTranslator() throws ConnectorException {
- if (this.sqlTranslator == null) {
- try {
- String className = getExtensionTranslationClassName();
- if (!StringUtil.isValid(className)) {
- this.sqlTranslator = new Translator();
- } else {
- this.sqlTranslator = (Translator)ReflectionHelper.create(className, null, Thread.currentThread().getContextClassLoader());
- }
- sqlTranslator.initialize(this);
- } catch (TeiidException e) {
- throw new ConnectorException(e);
- }
- }
- return this.sqlTranslator;
- }
- @Override
- public ConnectorCapabilities getCapabilities() {
- return capabilities;
- }
-
@TranslatorProperty(name="UseBindVariables", display="Use Bind Variables", description="Use prepared statements and bind variables",advanced=true, defaultValue="false")
public boolean isUseBindVariables() {
return this.useBindVariables;
@@ -107,29 +177,6 @@
this.databaseTimeZone = databaseTimeZone;
}
- @TranslatorProperty(name="ExtensionTranslationClassName", display="Extension SQL Translation Class", required=true,
- defaultValue="org.teiid.translator.jdbc.translator.Translator",
- allowed= {"org.teiid.translator.jdbc.translator.Translator",
- "org.teiid.translator.jdbc.access.AccessSQLTranslator",
- "org.teiid.translator.jdbc.db2.DB2SQLTranslator",
- "org.teiid.translator.jdbc.derby.DerbySQLTranslator",
- "org.teiid.translator.jdbc.h2.H2Translator",
- "org.teiid.translator.jdbc.hsql.HsqlTranslator",
- "org.teiid.translator.jdbc.mysql.MySQLTranslator",
- "org.teiid.translator.jdbc.mysql.MySQL5Translator",
- "org.teiid.translator.jdbc.oracle.OracleSQLTranslator",
- "org.teiid.translator.jdbc.postgresql.PostgreSQLTranslator",
- "org.teiid.translator.jdbc.sqlserver.SqlServerSQLTranslator",
- "org.teiid.translator.jdbc.sybase.SybaseSQLTranslator"
- })
- public String getExtensionTranslationClassName() {
- return this.extensionTranslationClassName;
- }
-
- public void setExtensionTranslationClassName(String extensionTranslationClassName) {
- this.extensionTranslationClassName = extensionTranslationClassName;
- }
-
@TranslatorProperty(name="TrimStrings",display="Trim string flag", description="Right Trim fixed character types returned as Strings - note that the native type must be char or nchar and the source must support the rtrim function.",advanced=true, defaultValue="false")
public boolean isTrimStrings() {
return this.trimStrings;
@@ -170,8 +217,8 @@
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
//TODO: This is not correct; this should be only called once for connection creation
- getTranslator().afterConnectionCreation(conn);
- return new JDBCQueryExecution(command, conn, executionContext, this, getTranslator());
+ afterConnectionCreation(conn);
+ return new JDBCQueryExecution(command, conn, executionContext, this);
} catch(SQLException e) {
throw new ConnectorException(e);
}
@@ -184,8 +231,8 @@
DataSource ds = (DataSource)connectionFactory;
Connection conn = ds.getConnection();
//TODO: This is not correct; this should be only called once for connection creation
- getTranslator().afterConnectionCreation(conn);
- return new JDBCProcedureExecution(command, conn, executionContext, this, getTranslator());
+ afterConnectionCreation(conn);
+ return new JDBCProcedureExecution(command, conn, executionContext, this);
} catch (SQLException e) {
throw new ConnectorException(e);
}
@@ -199,8 +246,8 @@
Connection conn = ds.getConnection();
//TODO: This is not correct; this should be only called once for connection creation
- getTranslator().afterConnectionCreation(conn);
- return new JDBCUpdateExecution(command, conn, executionContext, this, getTranslator());
+ afterConnectionCreation(conn);
+ return new JDBCUpdateExecution(command, conn, executionContext, this);
} catch (SQLException e) {
throw new ConnectorException(e);
}
@@ -226,4 +273,841 @@
throw new ConnectorException(e);
}
}
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ return getDefaultSupportedFunctions();
+ }
+
+ public List<String> getDefaultSupportedFunctions(){
+ return Arrays.asList(new String[] { "+", "-", "*", "/" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return DEFAULT_MAX_IN_CRITERIA;
+ }
+
+ @Override
+ public boolean supportsGroupBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesAvg() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesCount() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesMax() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesMin() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesSum() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAliasedGroup() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrderByUnrelated() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSearchedCaseExpressions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelectDistinct() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelfJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSetQueryOrderBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsBulkUpdate() {
+ return true;
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return true;
+ }
+
+ /**
+ * Gets the database calendar. This will be set to the time zone
+ * specified by the property {@link JDBCPropertyNames#DATABASE_TIME_ZONE}, or
+ * the local time zone if none is specified.
+ * @return
+ */
+ public Calendar getDatabaseCalendar() {
+ return CALENDAR.get();
+ }
+
+ /**
+ * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
+ * if to rely on the default translation. Override with care.
+ * @param command
+ * @param context
+ * @return
+ */
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ List<?> parts = null;
+ if (obj instanceof Function) {
+ Function function = (Function)obj;
+ if (functionModifiers != null) {
+ FunctionModifier modifier = functionModifiers.get(function.getName().toLowerCase());
+ if (modifier != null) {
+ parts = modifier.translate(function);
+ }
+ }
+ } else if (obj instanceof Command) {
+ parts = translateCommand((Command)obj, context);
+ } else if (obj instanceof Limit) {
+ parts = translateLimit((Limit)obj, context);
+ } else if (obj instanceof ColumnReference) {
+ ColumnReference elem = (ColumnReference)obj;
+ if (isTrimStrings() && elem.getType() == TypeFacility.RUNTIME_TYPES.STRING && elem.getMetadataObject() != null
+ && ("char".equalsIgnoreCase(elem.getMetadataObject().getNativeType()) || "nchar".equalsIgnoreCase(elem.getMetadataObject().getNativeType()))) { //$NON-NLS-1$ //$NON-NLS-2$
+ return Arrays.asList(getLanguageFactory().createFunction(SourceSystemFunctions.RTRIM, new Expression[] {elem}, TypeFacility.RUNTIME_TYPES.STRING));
+ }
+ }
+ return parts;
+ }
+
+ /**
+ * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
+ * if to rely on the default translation.
+ * @param command
+ * @param context
+ * @return
+ */
+ public List<?> translateCommand(Command command, ExecutionContext context) {
+ return null;
+ }
+
+ /**
+ * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
+ * if to rely on the default translation.
+ * @param limit
+ * @param context
+ * @return
+ */
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ return null;
+ }
+
+ /**
+ * Return a map of function name in lower case to FunctionModifier.
+ * @return Map of function name to FunctionModifier.
+ */
+ public Map<String, FunctionModifier> getFunctionModifiers() {
+ return functionModifiers;
+ }
+
+ /**
+ * Add the {@link FunctionModifier} to the set of known modifiers.
+ * @param name
+ * @param modifier
+ */
+ public void registerFunctionModifier(String name, FunctionModifier modifier) {
+ this.functionModifiers.put(name, modifier);
+ }
+
+ /**
+ * Subclasses should override this method to provide a different sql translation
+ * of the literal boolean value. By default, a boolean literal is represented as:
+ * <code>'0'</code> or <code>'1'</code>.
+ * @param booleanValue Boolean value, never null
+ * @return Translated string
+ */
+ public String translateLiteralBoolean(Boolean booleanValue) {
+ if(booleanValue.booleanValue()) {
+ return "1"; //$NON-NLS-1$
+ }
+ return "0"; //$NON-NLS-1$
+ }
+
+ /**
+ * Subclasses should override this method to provide a different sql translation
+ * of the literal date value. By default, a date literal is represented as:
+ * <code>{d '2002-12-31'}</code>
+ * @param dateValue Date value, never null
+ * @return Translated string
+ */
+ public String translateLiteralDate(java.sql.Date dateValue) {
+ return "{d '" + formatDateValue(dateValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Subclasses should override this method to provide a different sql translation
+ * of the literal time value. By default, a time literal is represented as:
+ * <code>{t '23:59:59'}</code>
+ *
+ * See {@link JDBCExecutionFactory#hasTimeType()} to represent literal times as timestamps.
+ *
+ * @param timeValue Time value, never null
+ * @return Translated string
+ */
+ public String translateLiteralTime(Time timeValue) {
+ if (!hasTimeType()) {
+ return "{ts '1970-01-01 " + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return "{t '" + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Subclasses should override this method to provide a different sql translation
+ * of the literal timestamp value. By default, a timestamp literal is
+ * represented as: <code>{ts '2002-12-31 23:59:59'}</code>.
+ *
+ * See {@link JDBCExecutionFactory#getTimestampNanoPrecision()} to control the literal
+ * precision.
+ *
+ * @param timestampValue Timestamp value, never null
+ * @return Translated string
+ */
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "{ts '" + formatDateValue(timestampValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Format the dateObject (of type date, time, or timestamp) into a string
+ * using the DatabaseTimeZone format.
+ * @param dateObject
+ * @return Formatted string
+ */
+ public String formatDateValue(java.util.Date dateObject) {
+ if (dateObject instanceof Timestamp && getTimestampNanoPrecision() < 9) {
+ Timestamp ts = (Timestamp)dateObject;
+ Timestamp newTs = new Timestamp(ts.getTime());
+ if (getTimestampNanoPrecision() > 0) {
+ int mask = (int)Math.pow(10, 9-getTimestampNanoPrecision());
+ newTs.setNanos(ts.getNanos()/mask*mask);
+ } else {
+ newTs.setNanos(0);
+ }
+ dateObject = newTs;
+ }
+ return getTypeFacility().convertDate(dateObject, DEFAULT_TIME_ZONE, getDatabaseCalendar(), dateObject.getClass()).toString();
+ }
+
+ /**
+ * Returns true to indicate that SQL should include a comment
+ * indicating the session and request ids.
+ */
+ public boolean addSourceComment() {
+ return isUseCommentsInSourceQuery();
+ }
+
+ /**
+ * Indicates whether group alias should be of the form
+ * "...FROM groupA AS X" or "...FROM groupA X". Certain
+ * data sources (such as Oracle) may not support the first
+ * form.
+ * @return boolean
+ */
+ public boolean useAsInGroupAlias(){
+ return true;
+ }
+
+ /**
+ * Use PreparedStatements (or CallableStatements) as
+ * appropriate for all commands. Bind values will be
+ * determined by the {@link BindValueVisitor}. {@link Literal#setBindValue(boolean)}
+ * can be used to force a literal to be a bind value.
+ */
+ public boolean usePreparedStatements() {
+ return isUseBindVariables();
+ }
+
+ /**
+ * Set to true to indicate that every branch of a set query
+ * should have parenthesis, i.e. (query) union (query)
+ * @return
+ */
+ public boolean useParensForSetQueries() {
+ return false;
+ }
+
+ /**
+ * Return false to indicate that time support should be emulated
+ * with timestamps.
+ * @return
+ */
+ public boolean hasTimeType() {
+ return true;
+ }
+
+ /**
+ * Returns the name for a given {@link SetQuery.Operation}
+ * @param operation
+ * @return
+ */
+ public String getSetOperationString(SetQuery.Operation operation) {
+ return operation.toString();
+ }
+
+ /**
+ * Returns the source comment for
+ * @param context
+ * @param command
+ * @return
+ */
+ public String getSourceComment(ExecutionContext context, Command command) {
+ if (addSourceComment() && context != null) {
+ return COMMENT.get().format(new Object[] {context.getConnectionIdentifier(), context.getRequestIdentifier(), context.getPartIdentifier()});
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Override to return a name other than the default [group.]element
+ * @param group
+ * @param element
+ * @return
+ */
+ public String replaceElementName(String group, String element) {
+ return null;
+ }
+
+ /**
+ * Return the precision of timestamp literals. Defaults to 9
+ * @return
+ */
+ public int getTimestampNanoPrecision() {
+ return 9;
+ }
+
+ /**
+ * This is a generic implementation. Because different databases handle
+ * stored procedures differently, subclasses should override this method
+ * if necessary.
+ */
+ public ResultSet executeStoredProcedure(CallableStatement statement, TranslatedCommand command, Class<?> returnType) throws SQLException {
+ List params = command.getPreparedValues();
+ int index = 1;
+
+ if(returnType != null){
+ registerSpecificTypeOfOutParameter(statement, returnType, index++);
+ }
+
+ Iterator iter = params.iterator();
+ while(iter.hasNext()){
+ Argument param = (Argument)iter.next();
+
+ if(param.getDirection() == Direction.INOUT){
+ registerSpecificTypeOfOutParameter(statement,param.getType(), index);
+ }else if(param.getDirection() == Direction.OUT){
+ registerSpecificTypeOfOutParameter(statement,param.getType(), index++);
+ }
+
+ if(param.getDirection() == Direction.IN || param.getDirection() == Direction.INOUT){
+ bindValue(statement, param.getArgumentValue().getValue(), param.getType(), index++);
+ }
+ }
+ boolean resultSetNext = statement.execute();
+
+ while (!resultSetNext) {
+ int update_count = statement.getUpdateCount();
+ if (update_count == -1) {
+ break;
+ }
+ resultSetNext = statement.getMoreResults();
+ }
+ return statement.getResultSet();
+ }
+
+ /**
+ * For registering specific output parameter types we need to translate these into the appropriate
+ * java.sql.Types output parameters
+ * We will need to match these up with the appropriate standard sql types
+ * @param cstmt
+ * @param parameter
+ * @throws SQLException
+ */
+ protected void registerSpecificTypeOfOutParameter(CallableStatement statement, Class<?> runtimeType, int index) throws SQLException {
+ int typeToSet = TypeFacility.getSQLTypeFromRuntimeType(runtimeType);
+
+ statement.registerOutParameter(index,typeToSet);
+ }
+
+ /**
+ * Sets prepared statement parameter i with param.
+ *
+ * Performs special handling to translate dates using the database time zone and to
+ * translate biginteger, float, and char to JDBC safe objects.
+ *
+ * @param stmt
+ * @param param
+ * @param paramType
+ * @param i
+ * @param cal
+ * @throws SQLException
+ */
+ public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i) throws SQLException {
+ int type = TypeFacility.getSQLTypeFromRuntimeType(paramType);
+
+ if (param == null) {
+ stmt.setNull(i, type);
+ return;
+ }
+ //if this is a Date object, then use the database calendar
+ if (paramType.equals(TypeFacility.RUNTIME_TYPES.DATE)) {
+ stmt.setDate(i,(java.sql.Date)param, getDatabaseCalendar());
+ return;
+ }
+ if (paramType.equals(TypeFacility.RUNTIME_TYPES.TIME)) {
+ stmt.setTime(i,(java.sql.Time)param, getDatabaseCalendar());
+ return;
+ }
+ if (paramType.equals(TypeFacility.RUNTIME_TYPES.TIMESTAMP)) {
+ stmt.setTimestamp(i,(java.sql.Timestamp)param, getDatabaseCalendar());
+ return;
+ }
+ //convert these the following to jdbc safe values
+ if (TypeFacility.RUNTIME_TYPES.BIG_INTEGER.equals(paramType)) {
+ param = new BigDecimal((BigInteger)param);
+ } else if (TypeFacility.RUNTIME_TYPES.FLOAT.equals(paramType)) {
+ param = new Double(((Float)param).doubleValue());
+ } else if (TypeFacility.RUNTIME_TYPES.CHAR.equals(paramType)) {
+ param = ((Character)param).toString();
+ }
+ stmt.setObject(i, param, type);
+ }
+
+ /**
+ * Retrieve the value on the current resultset row for the given column index.
+ * @param results
+ * @param columnIndex
+ * @param expectedType
+ * @return
+ * @throws SQLException
+ */
+ public Object retrieveValue(ResultSet results, int columnIndex, Class<?> expectedType) throws SQLException {
+ Integer code = TYPE_CODE_MAP.get(expectedType);
+ if(code != null) {
+ // Calling the specific methods here is more likely to get uniform (and fast) results from different
+ // data sources as the driver likely knows the best and fastest way to convert from the underlying
+ // raw form of the data to the expected type. We use a switch with codes in order without gaps
+ // as there is a special bytecode instruction that treats this case as a map such that not every value
+ // needs to be tested, which means it is very fast.
+ switch(code.intValue()) {
+ case INTEGER_CODE: {
+ int value = results.getInt(columnIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Integer.valueOf(value);
+ }
+ case LONG_CODE: {
+ long value = results.getLong(columnIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Long.valueOf(value);
+ }
+ case DOUBLE_CODE: {
+ double value = results.getDouble(columnIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Double.valueOf(value);
+ }
+ case BIGDECIMAL_CODE: {
+ return results.getBigDecimal(columnIndex);
+ }
+ case SHORT_CODE: {
+ short value = results.getShort(columnIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Short.valueOf(value);
+ }
+ case FLOAT_CODE: {
+ float value = results.getFloat(columnIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Float.valueOf(value);
+ }
+ case TIME_CODE: {
+ return results.getTime(columnIndex, getDatabaseCalendar());
+ }
+ case DATE_CODE: {
+ return results.getDate(columnIndex, getDatabaseCalendar());
+ }
+ case TIMESTAMP_CODE: {
+ return results.getTimestamp(columnIndex, getDatabaseCalendar());
+ }
+ case BLOB_CODE: {
+ try {
+ return results.getBlob(columnIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ try {
+ return results.getBytes(columnIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ break;
+ }
+ case CLOB_CODE: {
+ try {
+ return results.getClob(columnIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ break;
+ }
+ case BOOLEAN_CODE: {
+ return results.getBoolean(columnIndex);
+ }
+ }
+ }
+
+ return results.getObject(columnIndex);
+ }
+
+ /**
+ * Retrieve the value for the given parameter index
+ * @param results
+ * @param parameterIndex
+ * @param expectedType
+ * @return
+ * @throws SQLException
+ */
+ public Object retrieveValue(CallableStatement results, int parameterIndex, Class expectedType) throws SQLException{
+ Integer code = TYPE_CODE_MAP.get(expectedType);
+ if(code != null) {
+ switch(code.intValue()) {
+ case INTEGER_CODE: {
+ int value = results.getInt(parameterIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Integer.valueOf(value);
+ }
+ case LONG_CODE: {
+ long value = results.getLong(parameterIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Long.valueOf(value);
+ }
+ case DOUBLE_CODE: {
+ double value = results.getDouble(parameterIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return new Double(value);
+ }
+ case BIGDECIMAL_CODE: {
+ return results.getBigDecimal(parameterIndex);
+ }
+ case SHORT_CODE: {
+ short value = results.getShort(parameterIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return Short.valueOf(value);
+ }
+ case FLOAT_CODE: {
+ float value = results.getFloat(parameterIndex);
+ if(results.wasNull()) {
+ return null;
+ }
+ return new Float(value);
+ }
+ case TIME_CODE: {
+ return results.getTime(parameterIndex, getDatabaseCalendar());
+ }
+ case DATE_CODE: {
+ return results.getDate(parameterIndex, getDatabaseCalendar());
+ }
+ case TIMESTAMP_CODE: {
+ return results.getTimestamp(parameterIndex, getDatabaseCalendar());
+ }
+ case BLOB_CODE: {
+ try {
+ return results.getBlob(parameterIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ try {
+ return results.getBytes(parameterIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
+ case CLOB_CODE: {
+ try {
+ return results.getClob(parameterIndex);
+ } catch (SQLException e) {
+ // ignore
+ }
+ }
+ case BOOLEAN_CODE: {
+ return results.getBoolean(parameterIndex);
+ }
+ }
+ }
+
+ // otherwise fall through and call getObject() and rely on the normal
+ // translation routines
+ return results.getObject(parameterIndex);
+ }
+
+ /**
+ * Called exactly once for this source.
+ * @param connection
+ */
+ protected void afterInitialConnectionCreation(Connection connection) {
+ // now dig some details about this driver/database for log.
+ try {
+ StringBuffer sb = new StringBuffer();
+ DatabaseMetaData dbmd = connection.getMetaData();
+ sb.append("Commit=").append(connection.getAutoCommit()); //$NON-NLS-1$
+ sb.append(";DatabaseProductName=").append(dbmd.getDatabaseProductName()); //$NON-NLS-1$
+ sb.append(";DatabaseProductVersion=").append(dbmd.getDatabaseProductVersion()); //$NON-NLS-1$
+ sb.append(";DriverMajorVersion=").append(dbmd.getDriverMajorVersion()); //$NON-NLS-1$
+ sb.append(";DriverMajorVersion=").append(dbmd.getDriverMinorVersion()); //$NON-NLS-1$
+ sb.append(";DriverName=").append(dbmd.getDriverName()); //$NON-NLS-1$
+ sb.append(";DriverVersion=").append(dbmd.getDriverVersion()); //$NON-NLS-1$
+ sb.append(";IsolationLevel=").append(dbmd.getDefaultTransactionIsolation()); //$NON-NLS-1$
+
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR, sb.toString());
+ } catch (SQLException e) {
+ String errorStr = JDBCPlugin.Util.getString("ConnectionListener.failed_to_report_jdbc_connection_details"); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
+ }
+ }
+
+ /**
+ * Provides a hook to call source specific logic when
+ * a connection is created.
+ *
+ * defect request 13979 & 13978
+ */
+ public void afterConnectionCreation(Connection connection) {
+ if (initialConnection) {
+ synchronized (this) {
+ if (!initialConnection) {
+ return;
+ }
+ initialConnection = false;
+ afterInitialConnectionCreation(connection);
+ }
+ }
+ }
+
+
+
+ /**
+ * Create the {@link SQLConversionVisitor} that will perform translation. Typical custom
+ * JDBC connectors will not need to create custom conversion visitors, rather implementors
+ * should override existing {@link JDBCExecutionFactory} methods.
+ * @return
+ */
+ public SQLConversionVisitor getSQLConversionVisitor() {
+ return new SQLConversionVisitor(this);
+ }
+
+ /**
+ * Set to true to indicate that every branch of a join
+ * should have parenthesis.
+ * @return
+ */
+ public boolean useParensForJoins() {
+ return false;
+ }
+
+ /**
+ * get the default null ordering
+ * @return
+ */
+ public NullOrder getDefaultNullOrder() {
+ return NullOrder.LOW;
+ }
+
+ /**
+ *
+ * @return true if nulls high|low can be specified
+ */
+ public boolean supportsExplicitNullOrdering() {
+ return false;
+ }
+
+ /**
+ *
+ * @return true if the limit clause is part of the select
+ */
+ public boolean useSelectLimit() {
+ return false;
+ }
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -47,8 +47,8 @@
* @param props
* @param id
*/
- public JDBCProcedureExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env, Translator translator) {
- super(command, connection, context, env, translator);
+ public JDBCProcedureExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env) {
+ super(command, connection, context, env);
}
@Override
@@ -64,7 +64,7 @@
try{
//create parameter index map
CallableStatement cstmt = getCallableStatement(sql);
- this.results = sqlTranslator.executeStoredProcedure(cstmt, translatedComm, procedure.getReturnType());
+ this.results = this.executionFactory.executeStoredProcedure(cstmt, translatedComm, procedure.getReturnType());
addStatementWarnings();
}catch(SQLException e){
throw new ConnectorException(e, JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql)); //$NON-NLS-1$
@@ -108,7 +108,7 @@
private void addParameterValue(List<Object> result, int paramIndex,
Class<?> type) throws SQLException {
- Object value = sqlTranslator.retrieveValue((CallableStatement)this.statement, paramIndex, type);
+ Object value = this.executionFactory.retrieveValue((CallableStatement)this.statement, paramIndex, type);
result.add(value);
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCQueryExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -57,8 +57,8 @@
// Constructors
// ===========================================================================================================================
- public JDBCQueryExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env, Translator translator) {
- super(connection, context, env, translator);
+ public JDBCQueryExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env) {
+ super(connection, context, env);
this.command = command;
}
@@ -96,7 +96,7 @@
for (int i = 0; i < columnDataTypes.length; i++) {
// Convert from 0-based to 1-based
- Object value = sqlTranslator.retrieveValue(results, i+1, columnDataTypes[i]);
+ Object value = this.executionFactory.retrieveValue(results, i+1, columnDataTypes[i]);
vals.add(value);
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -51,8 +51,8 @@
* @param props
* @param id
*/
- public JDBCUpdateExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env, Translator translator) {
- super(connection, context, env, translator);
+ public JDBCUpdateExecution(Command command, Connection connection, ExecutionContext context, JDBCExecutionFactory env) {
+ super(connection, context, env);
this.command = command;
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -56,7 +56,7 @@
import org.teiid.language.visitor.SQLStringVisitor;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.Translator.NullOrder;
+import org.teiid.translator.jdbc.JDBCExecutionFactory.NullOrder;
/**
@@ -71,7 +71,7 @@
private static double SCIENTIC_HIGH = Math.pow(10, 7);
private ExecutionContext context;
- private Translator translator;
+ private JDBCExecutionFactory executionFactory;
private boolean prepared;
@@ -82,9 +82,9 @@
private boolean replaceWithBinding = false;
- public SQLConversionVisitor(Translator translator) {
- this.translator = translator;
- this.prepared = translator.usePreparedStatements();
+ public SQLConversionVisitor(JDBCExecutionFactory ef) {
+ this.executionFactory = ef;
+ this.prepared = executionFactory.usePreparedStatements();
}
@Override
@@ -107,7 +107,7 @@
} else if (trans instanceof LanguageObject) {
obj = (LanguageObject)trans;
} else {
- parts = translator.translate(obj, context);
+ parts = executionFactory.translate(obj, context);
if (parts != null) {
this.translations.put(obj, parts);
} else {
@@ -134,8 +134,8 @@
@Override
public void visit(SortSpecification obj) {
super.visit(obj);
- NullOrder nullOrder = this.translator.getDefaultNullOrder();
- if (!this.translator.supportsExplicitNullOrdering() || nullOrder == NullOrder.LOW) {
+ NullOrder nullOrder = this.executionFactory.getDefaultNullOrder();
+ if (!this.executionFactory.supportsExplicitNullOrdering() || nullOrder == NullOrder.LOW) {
return;
}
if (obj.getOrdering() == Ordering.ASC) {
@@ -179,13 +179,13 @@
valuesbuffer.append(obj);
}
} else if(type.equals(TypeFacility.RUNTIME_TYPES.BOOLEAN)) {
- valuesbuffer.append(translator.translateLiteralBoolean((Boolean)obj));
+ valuesbuffer.append(executionFactory.translateLiteralBoolean((Boolean)obj));
} else if(type.equals(TypeFacility.RUNTIME_TYPES.TIMESTAMP)) {
- valuesbuffer.append(translator.translateLiteralTimestamp((Timestamp)obj));
+ valuesbuffer.append(executionFactory.translateLiteralTimestamp((Timestamp)obj));
} else if(type.equals(TypeFacility.RUNTIME_TYPES.TIME)) {
- valuesbuffer.append(translator.translateLiteralTime((Time)obj));
+ valuesbuffer.append(executionFactory.translateLiteralTime((Time)obj));
} else if(type.equals(TypeFacility.RUNTIME_TYPES.DATE)) {
- valuesbuffer.append(translator.translateLiteralDate((java.sql.Date)obj));
+ valuesbuffer.append(executionFactory.translateLiteralDate((java.sql.Date)obj));
} else {
// If obj is string, toSting() will not create a new String
// object, it returns it self, so new object creation.
@@ -282,7 +282,7 @@
}
protected String getSourceComment(Command command) {
- return this.translator.getSourceComment(this.context, command);
+ return this.executionFactory.getSourceComment(this.context, command);
}
/**
@@ -342,31 +342,31 @@
@Override
protected boolean useAsInGroupAlias() {
- return this.translator.useAsInGroupAlias();
+ return this.executionFactory.useAsInGroupAlias();
}
@Override
protected boolean useParensForSetQueries() {
- return translator.useParensForSetQueries();
+ return executionFactory.useParensForSetQueries();
}
@Override
protected String replaceElementName(String group, String element) {
- return translator.replaceElementName(group, element);
+ return executionFactory.replaceElementName(group, element);
}
@Override
protected void appendSetOperation(Operation operation) {
- buffer.append(translator.getSetOperationString(operation));
+ buffer.append(executionFactory.getSetOperationString(operation));
}
@Override
protected boolean useParensForJoins() {
- return translator.useParensForJoins();
+ return executionFactory.useParensForJoins();
}
protected boolean useSelectLimit() {
- return translator.useSelectLimit();
+ return executionFactory.useSelectLimit();
}
}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,274 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc;
-
-import java.util.List;
-
-
-/**
- * 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 {
-
- public SimpleCapabilities() {
- }
-
- @Override
- public int getMaxInCriteriaSize() {
- return 250;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCompareCriteriaEquals()
- */
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsInCriteria()
- */
- public boolean supportsInCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsIsNullCriteria()
- */
- public boolean supportsIsNullCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteria()
- */
- public boolean supportsLikeCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsNotCriteria()
- */
- public boolean supportsNotCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOrCriteria()
- */
- public boolean supportsOrCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSelectDistinct()
- */
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAliasedGroup()
- */
- public boolean supportsAliasedGroup() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSelfJoins()
- */
- public boolean supportsSelfJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOuterJoins()
- */
- public boolean supportsOuterJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsBetweenCriteria()
- */
- public boolean supportsBetweenCriteria() {
- return false;
- }
-
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsLikeCriteriaEscapeCharacter()
- */
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsInCriteriaSubquery()
- */
- public boolean supportsInCriteriaSubquery() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsExistsCriteria()
- */
- public boolean supportsExistsCriteria() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaSome()
- */
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
- */
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsOrderBy()
- */
- public boolean supportsOrderBy() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesSum()
- */
- public boolean supportsAggregatesSum() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesAvg()
- */
- public boolean supportsAggregatesAvg() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesMin()
- */
- public boolean supportsAggregatesMin() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesMax()
- */
- public boolean supportsAggregatesMax() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesCount()
- */
- public boolean supportsAggregatesCount() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesCountStar()
- */
- public boolean supportsAggregatesCountStar() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsAggregatesDistinct()
- */
- public boolean supportsAggregatesDistinct() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsScalarSubqueries()
- */
- public boolean supportsScalarSubqueries() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCorrelatedSubqueries()
- */
- public boolean supportsCorrelatedSubqueries() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsCaseExpressions()
- */
- public boolean supportsCaseExpressions() {
- return false;
- }
-
- /*
- * @see com.metamatrix.data.api.ConnectorCapabilities#supportsSearchedCaseExpressions()
- */
- public boolean supportsSearchedCaseExpressions() {
- return false;
- }
-
- /**
- * Return null to indicate no functions are supported.
- * @return null
- * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
- */
- public List getSupportedFunctions() {
- return null;
- }
-
- public boolean supportsInlineViews() {
- return false;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsUnions()
- * @since 4.2
- */
- public boolean supportsUnions() {
- return false;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleCapabilities.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc;
+
+import java.util.List;
+
+
+/**
+ * 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 SimpleJDBCExecutionFactory extends JDBCExecutionFactory {
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 250;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelectDistinct() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAliasedGroup() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSelfJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return false;
+ }
+
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesSum() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesAvg() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMin() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesMax() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCount() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsSearchedCaseExpressions() {
+ return false;
+ }
+
+ @Override
+ public List getSupportedFunctions() {
+ return null;
+ }
+
+ public boolean supportsInlineViews() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
+}
Property changes on: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SimpleJDBCExecutionFactory.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/TranslatedCommand.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -45,15 +45,15 @@
private boolean prepared;
private List preparedValues;
- private Translator sqlTranslator;
+ private JDBCExecutionFactory executionFactory;
private ExecutionContext context;
/**
* Constructor, takes a SQLConversionVisitor subclass
* @param visitor a SQLConversionVisitor subclass
*/
- public TranslatedCommand(ExecutionContext context, Translator sqlTranslator){
- this.sqlTranslator = sqlTranslator;
+ public TranslatedCommand(ExecutionContext context, JDBCExecutionFactory executionFactory){
+ this.executionFactory = executionFactory;
this.context = context;
}
@@ -65,9 +65,9 @@
* @throws ConnectorException
*/
public void translateCommand(Command command) throws ConnectorException {
- SQLConversionVisitor sqlConversionVisitor = sqlTranslator.getSQLConversionVisitor();
+ SQLConversionVisitor sqlConversionVisitor = executionFactory.getSQLConversionVisitor();
sqlConversionVisitor.setExecutionContext(context);
- if (sqlTranslator.usePreparedStatements() || hasBindValue(command)) {
+ if (executionFactory.usePreparedStatements() || hasBindValue(command)) {
sqlConversionVisitor.setPrepared(true);
}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/Translator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,818 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TimeZone;
-
-import org.teiid.core.util.ReflectionHelper;
-import org.teiid.language.Argument;
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Command;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.language.LanguageObject;
-import org.teiid.language.Limit;
-import org.teiid.language.Literal;
-import org.teiid.language.SetQuery;
-import org.teiid.language.Argument.Direction;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.TypeFacility;
-
-
-/**
- * Base class for creating source SQL queries and retrieving results.
- * Specific databases should override as necessary.
- */
-public class Translator {
-
- public enum NullOrder {
- HIGH,
- LOW,
- FIRST,
- LAST
- }
-
- // Because the retrieveValue() method will be hit for every value of
- // every JDBC result set returned, we do lots of weird special stuff here
- // to improve the performance (most importantly to remove big if/else checks
- // of every possible type.
-
- private static final Map<Class<?>, Integer> TYPE_CODE_MAP = new HashMap<Class<?>, Integer>();
-
- private static final int INTEGER_CODE = 0;
- private static final int LONG_CODE = 1;
- private static final int DOUBLE_CODE = 2;
- private static final int BIGDECIMAL_CODE = 3;
- private static final int SHORT_CODE = 4;
- private static final int FLOAT_CODE = 5;
- private static final int TIME_CODE = 6;
- private static final int DATE_CODE = 7;
- private static final int TIMESTAMP_CODE = 8;
- private static final int BLOB_CODE = 9;
- private static final int CLOB_CODE = 10;
- private static final int BOOLEAN_CODE = 11;
-
- static {
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.INTEGER, new Integer(INTEGER_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.LONG, new Integer(LONG_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.DOUBLE, new Integer(DOUBLE_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BIG_DECIMAL, new Integer(BIGDECIMAL_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.SHORT, new Integer(SHORT_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.FLOAT, new Integer(FLOAT_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.TIME, new Integer(TIME_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.DATE, new Integer(DATE_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.TIMESTAMP, new Integer(TIMESTAMP_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BLOB, new Integer(BLOB_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.CLOB, new Integer(CLOB_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BOOLEAN, new Integer(BOOLEAN_CODE));
- TYPE_CODE_MAP.put(TypeFacility.RUNTIME_TYPES.BYTE, new Integer(SHORT_CODE));
- }
-
- private static final ThreadLocal<MessageFormat> COMMENT = new ThreadLocal<MessageFormat>() {
- protected MessageFormat initialValue() {
- return new MessageFormat("/*teiid sessionid:{0}, requestid:{1}.{2}*/ "); //$NON-NLS-1$
- }
- };
- public final static TimeZone DEFAULT_TIME_ZONE = TimeZone.getDefault();
-
- private static final ThreadLocal<Calendar> CALENDAR = new ThreadLocal<Calendar>() {
- @Override
- protected Calendar initialValue() {
- return Calendar.getInstance();
- }
- };
-
- private Map<String, FunctionModifier> functionModifiers = new HashMap<String, FunctionModifier>();
- private JDBCExecutionFactory environment;
-
- private boolean useComments;
- private boolean usePreparedStatements;
-
- private TypeFacility typeFacility;
-
- private volatile boolean initialConnection;
- private boolean trimChar;
-
- /**
- * Initialize the SQLTranslator.
- * @param env
- * @param metadata
- * @throws ConnectorException
- */
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- this.environment = env;
- this.typeFacility = env.getTypeFacility();
-
- String timeZone = this.environment.getDatabaseTimeZone();
- if(timeZone != null && timeZone.trim().length() > 0) {
- TimeZone tz = TimeZone.getTimeZone(timeZone);
- if(!DEFAULT_TIME_ZONE.hasSameRules(tz)) {
- CALENDAR.set(Calendar.getInstance(tz));
- }
- }
-
- this.useComments = this.environment.isUseCommentsInSourceQuery();
- this.usePreparedStatements = this.environment.isUseBindVariables();
- trimChar = this.environment.isTrimStrings();
- }
-
- /**
- * Gets the database calendar. This will be set to the time zone
- * specified by the property {@link JDBCPropertyNames#DATABASE_TIME_ZONE}, or
- * the local time zone if none is specified.
- * @return
- */
- public Calendar getDatabaseCalendar() {
- return CALENDAR.get();
- }
-
- /**
- * Gets the {@link LanguageFactory}
- */
- public final LanguageFactory getLanguageFactory() {
- return environment.getLanguageFactory();
- }
-
- /**
- * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
- * if to rely on the default translation. Override with care.
- * @param command
- * @param context
- * @return
- */
- public List<?> translate(LanguageObject obj, ExecutionContext context) {
- List<?> parts = null;
- if (obj instanceof Function) {
- Function function = (Function)obj;
- if (functionModifiers != null) {
- FunctionModifier modifier = functionModifiers.get(function.getName().toLowerCase());
- if (modifier != null) {
- parts = modifier.translate(function);
- }
- }
- } else if (obj instanceof Command) {
- parts = translateCommand((Command)obj, context);
- } else if (obj instanceof Limit) {
- parts = translateLimit((Limit)obj, context);
- } else if (obj instanceof ColumnReference) {
- ColumnReference elem = (ColumnReference)obj;
- if (trimChar && elem.getType() == TypeFacility.RUNTIME_TYPES.STRING && elem.getMetadataObject() != null
- && ("char".equalsIgnoreCase(elem.getMetadataObject().getNativeType()) || "nchar".equalsIgnoreCase(elem.getMetadataObject().getNativeType()))) { //$NON-NLS-1$ //$NON-NLS-2$
- return Arrays.asList(getLanguageFactory().createFunction(SourceSystemFunctions.RTRIM, new Expression[] {elem}, TypeFacility.RUNTIME_TYPES.STRING));
- }
- }
- return parts;
- }
-
- /**
- * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
- * if to rely on the default translation.
- * @param command
- * @param context
- * @return
- */
- public List<?> translateCommand(Command command, ExecutionContext context) {
- return null;
- }
-
- /**
- * Return a List of translated parts ({@link LanguageObject}s and Objects), or null
- * if to rely on the default translation.
- * @param limit
- * @param context
- * @return
- */
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- return null;
- }
-
- /**
- * Return a map of function name in lower case to FunctionModifier.
- * @return Map of function name to FunctionModifier.
- */
- public Map<String, FunctionModifier> getFunctionModifiers() {
- return functionModifiers;
- }
-
- /**
- * Add the {@link FunctionModifier} to the set of known modifiers.
- * @param name
- * @param modifier
- */
- public void registerFunctionModifier(String name, FunctionModifier modifier) {
- this.functionModifiers.put(name, modifier);
- }
-
- /**
- * Subclasses should override this method to provide a different sql translation
- * of the literal boolean value. By default, a boolean literal is represented as:
- * <code>'0'</code> or <code>'1'</code>.
- * @param booleanValue Boolean value, never null
- * @return Translated string
- */
- public String translateLiteralBoolean(Boolean booleanValue) {
- if(booleanValue.booleanValue()) {
- return "1"; //$NON-NLS-1$
- }
- return "0"; //$NON-NLS-1$
- }
-
- /**
- * Subclasses should override this method to provide a different sql translation
- * of the literal date value. By default, a date literal is represented as:
- * <code>{d '2002-12-31'}</code>
- * @param dateValue Date value, never null
- * @return Translated string
- */
- public String translateLiteralDate(java.sql.Date dateValue) {
- return "{d '" + formatDateValue(dateValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Subclasses should override this method to provide a different sql translation
- * of the literal time value. By default, a time literal is represented as:
- * <code>{t '23:59:59'}</code>
- *
- * See {@link Translator#hasTimeType()} to represent literal times as timestamps.
- *
- * @param timeValue Time value, never null
- * @return Translated string
- */
- public String translateLiteralTime(Time timeValue) {
- if (!hasTimeType()) {
- return "{ts '1970-01-01 " + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- return "{t '" + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Subclasses should override this method to provide a different sql translation
- * of the literal timestamp value. By default, a timestamp literal is
- * represented as: <code>{ts '2002-12-31 23:59:59'}</code>.
- *
- * See {@link Translator#getTimestampNanoPrecision()} to control the literal
- * precision.
- *
- * @param timestampValue Timestamp value, never null
- * @return Translated string
- */
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return "{ts '" + formatDateValue(timestampValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Format the dateObject (of type date, time, or timestamp) into a string
- * using the DatabaseTimeZone format.
- * @param dateObject
- * @return Formatted string
- */
- public String formatDateValue(java.util.Date dateObject) {
- if (dateObject instanceof Timestamp && getTimestampNanoPrecision() < 9) {
- Timestamp ts = (Timestamp)dateObject;
- Timestamp newTs = new Timestamp(ts.getTime());
- if (getTimestampNanoPrecision() > 0) {
- int mask = (int)Math.pow(10, 9-getTimestampNanoPrecision());
- newTs.setNanos(ts.getNanos()/mask*mask);
- } else {
- newTs.setNanos(0);
- }
- dateObject = newTs;
- }
- return this.environment.getTypeFacility().convertDate(dateObject,
- DEFAULT_TIME_ZONE, getDatabaseCalendar(), dateObject.getClass()).toString();
- }
-
- /**
- * Returns true to indicate that SQL should include a comment
- * indicating the session and request ids.
- */
- public boolean addSourceComment() {
- return useComments;
- }
-
- /**
- * Indicates whether group alias should be of the form
- * "...FROM groupA AS X" or "...FROM groupA X". Certain
- * data sources (such as Oracle) may not support the first
- * form.
- * @return boolean
- */
- public boolean useAsInGroupAlias(){
- return true;
- }
-
- /**
- * Use PreparedStatements (or CallableStatements) as
- * appropriate for all commands. Bind values will be
- * determined by the {@link BindValueVisitor}. {@link Literal#setBindValue(boolean)}
- * can be used to force a literal to be a bind value.
- */
- public boolean usePreparedStatements() {
- return this.usePreparedStatements;
- }
-
- /**
- * Set to true to indicate that every branch of a set query
- * should have parenthesis, i.e. (query) union (query)
- * @return
- */
- public boolean useParensForSetQueries() {
- return false;
- }
-
- /**
- * Return false to indicate that time support should be emulated
- * with timestamps.
- * @return
- */
- public boolean hasTimeType() {
- return true;
- }
-
- /**
- * Returns the name for a given {@link SetQuery.Operation}
- * @param operation
- * @return
- */
- public String getSetOperationString(SetQuery.Operation operation) {
- return operation.toString();
- }
-
- /**
- * Returns the source comment for
- * @param context
- * @param command
- * @return
- */
- public String getSourceComment(ExecutionContext context, Command command) {
- if (addSourceComment() && context != null) {
- return COMMENT.get().format(new Object[] {context.getConnectionIdentifier(), context.getRequestIdentifier(), context.getPartIdentifier()});
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Override to return a name other than the default [group.]element
- * @param group
- * @param element
- * @return
- */
- public String replaceElementName(String group, String element) {
- return null;
- }
-
- /**
- * Return the precision of timestamp literals. Defaults to 9
- * @return
- */
- public int getTimestampNanoPrecision() {
- return 9;
- }
-
- public TypeFacility getTypeFacility() {
- return typeFacility;
- }
-
- /**
- * This is a generic implementation. Because different databases handle
- * stored procedures differently, subclasses should override this method
- * if necessary.
- */
- public ResultSet executeStoredProcedure(CallableStatement statement, TranslatedCommand command, Class<?> returnType) throws SQLException {
- List params = command.getPreparedValues();
- int index = 1;
-
- if(returnType != null){
- registerSpecificTypeOfOutParameter(statement, returnType, index++);
- }
-
- Iterator iter = params.iterator();
- while(iter.hasNext()){
- Argument param = (Argument)iter.next();
-
- if(param.getDirection() == Direction.INOUT){
- registerSpecificTypeOfOutParameter(statement,param.getType(), index);
- }else if(param.getDirection() == Direction.OUT){
- registerSpecificTypeOfOutParameter(statement,param.getType(), index++);
- }
-
- if(param.getDirection() == Direction.IN || param.getDirection() == Direction.INOUT){
- bindValue(statement, param.getArgumentValue().getValue(), param.getType(), index++);
- }
- }
- boolean resultSetNext = statement.execute();
-
- while (!resultSetNext) {
- int update_count = statement.getUpdateCount();
- if (update_count == -1) {
- break;
- }
- resultSetNext = statement.getMoreResults();
- }
- return statement.getResultSet();
- }
-
- /**
- * For registering specific output parameter types we need to translate these into the appropriate
- * java.sql.Types output parameters
- * We will need to match these up with the appropriate standard sql types
- * @param cstmt
- * @param parameter
- * @throws SQLException
- */
- protected void registerSpecificTypeOfOutParameter(CallableStatement statement, Class<?> runtimeType, int index) throws SQLException {
- int typeToSet = TypeFacility.getSQLTypeFromRuntimeType(runtimeType);
-
- statement.registerOutParameter(index,typeToSet);
- }
-
- /**
- * Sets prepared statement parameter i with param.
- *
- * Performs special handling to translate dates using the database time zone and to
- * translate biginteger, float, and char to JDBC safe objects.
- *
- * @param stmt
- * @param param
- * @param paramType
- * @param i
- * @param cal
- * @throws SQLException
- */
- public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i) throws SQLException {
- int type = TypeFacility.getSQLTypeFromRuntimeType(paramType);
-
- if (param == null) {
- stmt.setNull(i, type);
- return;
- }
- //if this is a Date object, then use the database calendar
- if (paramType.equals(TypeFacility.RUNTIME_TYPES.DATE)) {
- stmt.setDate(i,(java.sql.Date)param, getDatabaseCalendar());
- return;
- }
- if (paramType.equals(TypeFacility.RUNTIME_TYPES.TIME)) {
- stmt.setTime(i,(java.sql.Time)param, getDatabaseCalendar());
- return;
- }
- if (paramType.equals(TypeFacility.RUNTIME_TYPES.TIMESTAMP)) {
- stmt.setTimestamp(i,(java.sql.Timestamp)param, getDatabaseCalendar());
- return;
- }
- //convert these the following to jdbc safe values
- if (TypeFacility.RUNTIME_TYPES.BIG_INTEGER.equals(paramType)) {
- param = new BigDecimal((BigInteger)param);
- } else if (TypeFacility.RUNTIME_TYPES.FLOAT.equals(paramType)) {
- param = new Double(((Float)param).doubleValue());
- } else if (TypeFacility.RUNTIME_TYPES.CHAR.equals(paramType)) {
- param = ((Character)param).toString();
- }
- stmt.setObject(i, param, type);
- }
-
- /**
- * Retrieve the value on the current resultset row for the given column index.
- * @param results
- * @param columnIndex
- * @param expectedType
- * @return
- * @throws SQLException
- */
- public Object retrieveValue(ResultSet results, int columnIndex, Class<?> expectedType) throws SQLException {
- Integer code = TYPE_CODE_MAP.get(expectedType);
- if(code != null) {
- // Calling the specific methods here is more likely to get uniform (and fast) results from different
- // data sources as the driver likely knows the best and fastest way to convert from the underlying
- // raw form of the data to the expected type. We use a switch with codes in order without gaps
- // as there is a special bytecode instruction that treats this case as a map such that not every value
- // needs to be tested, which means it is very fast.
- switch(code.intValue()) {
- case INTEGER_CODE: {
- int value = results.getInt(columnIndex);
- if(results.wasNull()) {
- return null;
- }
- return Integer.valueOf(value);
- }
- case LONG_CODE: {
- long value = results.getLong(columnIndex);
- if(results.wasNull()) {
- return null;
- }
- return Long.valueOf(value);
- }
- case DOUBLE_CODE: {
- double value = results.getDouble(columnIndex);
- if(results.wasNull()) {
- return null;
- }
- return Double.valueOf(value);
- }
- case BIGDECIMAL_CODE: {
- return results.getBigDecimal(columnIndex);
- }
- case SHORT_CODE: {
- short value = results.getShort(columnIndex);
- if(results.wasNull()) {
- return null;
- }
- return Short.valueOf(value);
- }
- case FLOAT_CODE: {
- float value = results.getFloat(columnIndex);
- if(results.wasNull()) {
- return null;
- }
- return Float.valueOf(value);
- }
- case TIME_CODE: {
- return results.getTime(columnIndex, getDatabaseCalendar());
- }
- case DATE_CODE: {
- return results.getDate(columnIndex, getDatabaseCalendar());
- }
- case TIMESTAMP_CODE: {
- return results.getTimestamp(columnIndex, getDatabaseCalendar());
- }
- case BLOB_CODE: {
- try {
- return results.getBlob(columnIndex);
- } catch (SQLException e) {
- // ignore
- }
- try {
- return results.getBytes(columnIndex);
- } catch (SQLException e) {
- // ignore
- }
- break;
- }
- case CLOB_CODE: {
- try {
- return results.getClob(columnIndex);
- } catch (SQLException e) {
- // ignore
- }
- break;
- }
- case BOOLEAN_CODE: {
- return results.getBoolean(columnIndex);
- }
- }
- }
-
- return results.getObject(columnIndex);
- }
-
- /**
- * Retrieve the value for the given parameter index
- * @param results
- * @param parameterIndex
- * @param expectedType
- * @return
- * @throws SQLException
- */
- public Object retrieveValue(CallableStatement results, int parameterIndex, Class expectedType) throws SQLException{
- Integer code = TYPE_CODE_MAP.get(expectedType);
- if(code != null) {
- switch(code.intValue()) {
- case INTEGER_CODE: {
- int value = results.getInt(parameterIndex);
- if(results.wasNull()) {
- return null;
- }
- return Integer.valueOf(value);
- }
- case LONG_CODE: {
- long value = results.getLong(parameterIndex);
- if(results.wasNull()) {
- return null;
- }
- return Long.valueOf(value);
- }
- case DOUBLE_CODE: {
- double value = results.getDouble(parameterIndex);
- if(results.wasNull()) {
- return null;
- }
- return new Double(value);
- }
- case BIGDECIMAL_CODE: {
- return results.getBigDecimal(parameterIndex);
- }
- case SHORT_CODE: {
- short value = results.getShort(parameterIndex);
- if(results.wasNull()) {
- return null;
- }
- return Short.valueOf(value);
- }
- case FLOAT_CODE: {
- float value = results.getFloat(parameterIndex);
- if(results.wasNull()) {
- return null;
- }
- return new Float(value);
- }
- case TIME_CODE: {
- return results.getTime(parameterIndex, getDatabaseCalendar());
- }
- case DATE_CODE: {
- return results.getDate(parameterIndex, getDatabaseCalendar());
- }
- case TIMESTAMP_CODE: {
- return results.getTimestamp(parameterIndex, getDatabaseCalendar());
- }
- case BLOB_CODE: {
- try {
- return results.getBlob(parameterIndex);
- } catch (SQLException e) {
- // ignore
- }
- try {
- return results.getBytes(parameterIndex);
- } catch (SQLException e) {
- // ignore
- }
- }
- case CLOB_CODE: {
- try {
- return results.getClob(parameterIndex);
- } catch (SQLException e) {
- // ignore
- }
- }
- case BOOLEAN_CODE: {
- return results.getBoolean(parameterIndex);
- }
- }
- }
-
- // otherwise fall through and call getObject() and rely on the normal
- // translation routines
- return results.getObject(parameterIndex);
- }
-
- /**
- * Called exactly once for this source.
- * @param connection
- */
- protected void afterInitialConnectionCreation(Connection connection) {
- // now dig some details about this driver/database for log.
- try {
- StringBuffer sb = new StringBuffer();
- DatabaseMetaData dbmd = connection.getMetaData();
- sb.append("Commit=").append(connection.getAutoCommit()); //$NON-NLS-1$
- sb.append(";DatabaseProductName=").append(dbmd.getDatabaseProductName()); //$NON-NLS-1$
- sb.append(";DatabaseProductVersion=").append(dbmd.getDatabaseProductVersion()); //$NON-NLS-1$
- sb.append(";DriverMajorVersion=").append(dbmd.getDriverMajorVersion()); //$NON-NLS-1$
- sb.append(";DriverMajorVersion=").append(dbmd.getDriverMinorVersion()); //$NON-NLS-1$
- sb.append(";DriverName=").append(dbmd.getDriverName()); //$NON-NLS-1$
- sb.append(";DriverVersion=").append(dbmd.getDriverVersion()); //$NON-NLS-1$
- sb.append(";IsolationLevel=").append(dbmd.getDefaultTransactionIsolation()); //$NON-NLS-1$
-
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, sb.toString());
- } catch (SQLException e) {
- String errorStr = JDBCPlugin.Util.getString("ConnectionListener.failed_to_report_jdbc_connection_details"); //$NON-NLS-1$
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
- }
- }
-
- /**
- * Provides a hook to call source specific logic when
- * a connection is created.
- *
- * defect request 13979 & 13978
- */
- public void afterConnectionCreation(Connection connection) {
- if (initialConnection) {
- synchronized (this) {
- if (!initialConnection) {
- return;
- }
- initialConnection = false;
- afterInitialConnectionCreation(connection);
- }
- }
- }
-
-
-
- /**
- * Create the {@link SQLConversionVisitor} that will perform translation. Typical custom
- * JDBC connectors will not need to create custom conversion visitors, rather implementors
- * should override existing {@link Translator} methods.
- * @return
- */
- public SQLConversionVisitor getSQLConversionVisitor() {
- return new SQLConversionVisitor(this);
- }
-
- /**
- * Get the default capabilities class. Will be used by {@link #getConnectorCapabilities()} to
- * return a capabilities instance.
- * @return
- */
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return JDBCCapabilities.class;
- }
-
- /**
- * Get the capabilties for the source.
- * @return
- * @throws ConnectorException
- */
- public ConnectorCapabilities getConnectorCapabilities() throws ConnectorException {
- // create Capabilities
- String className = this.environment.getCapabilitiesClass();
- try {
- ConnectorCapabilities result = null;
- if (className != null && className.length() > 0) {
- result = (ConnectorCapabilities) ReflectionHelper.create(className, null, Thread.currentThread().getContextClassLoader());
- } else {
- result = getDefaultCapabilities().newInstance();
- }
-
- return result;
- } catch (Exception e) {
- throw new ConnectorException(e);
- }
- }
-
- /**
- * Set to true to indicate that every branch of a join
- * should have parenthesis.
- * @return
- */
- public boolean useParensForJoins() {
- return false;
- }
-
- /**
- * get the default null ordering
- * @return
- */
- public NullOrder getDefaultNullOrder() {
- return NullOrder.LOW;
- }
-
- /**
- *
- * @return true if nulls high|low can be specified
- */
- public boolean supportsExplicitNullOrdering() {
- return false;
- }
-
- /**
- *
- * @return true if the limit clause is part of the select
- */
- public boolean useSelectLimit() {
- return false;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.access;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-public class AccessCapabilities extends JDBCCapabilities{
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOrderBy()
- */
- public boolean supportsOrderBy() {
- return false;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsInsertWithQueryExpression() {
- return false;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java (from rev 2119, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.access;
+
+import java.util.List;
+
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.sybase.SybaseExecutionFactory;
+
+
+public class AccessExecutionFactory extends SybaseExecutionFactory {
+
+ @Override
+ public String translateLiteralBoolean(Boolean booleanValue) {
+ if(booleanValue.booleanValue()) {
+ return "-1"; //$NON-NLS-1$
+ }
+ return "0"; //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean addSourceComment() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInsertWithQueryExpression() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return false;
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA;
+ }
+
+ @Override
+ public int getMaxFromGroups() {
+ return DEFAULT_MAX_FROM_GROUPS;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ return getDefaultSupportedFunctions();
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.access;
-
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.jdbc.sybase.SybaseSQLTranslator;
-
-
-public class AccessSQLTranslator extends SybaseSQLTranslator {
-
- @Override
- public String translateLiteralBoolean(Boolean booleanValue) {
- if(booleanValue.booleanValue()) {
- return "-1"; //$NON-NLS-1$
- }
- return "0"; //$NON-NLS-1$
- }
-
- @Override
- public boolean addSourceComment() {
- return false;
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return AccessCapabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2Capabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2Capabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2Capabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.db2;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class DB2Capabilities extends JDBCCapabilities {
-
- public DB2Capabilities() {
- }
-
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- //supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- //supportedFunctions.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- //supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- //supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- //supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("DAY"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2SQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,246 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.db2;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.DerivedColumn;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.Join;
+import org.teiid.language.LanguageObject;
+import org.teiid.language.Limit;
+import org.teiid.language.Literal;
+import org.teiid.language.Comparison.Operator;
+import org.teiid.language.Join.JoinType;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.LocateFunctionModifier;
+import org.teiid.translator.jdbc.ModFunctionModifier;
+
+public class DB2ExecutionFactory extends JDBCExecutionFactory {
+
+ private final class NullHandlingFormatModifier extends
+ ConvertModifier.FormatModifier {
+ private NullHandlingFormatModifier(String alias) {
+ super(alias);
+ }
+
+ @Override
+ public List<?> translate(Function function) {
+ Expression arg = function.getParameters().get(0);
+ if (arg instanceof Literal && ((Literal)arg).getValue() == null) {
+ ((Literal)function.getParameters().get(1)).setValue(this.alias);
+ return null;
+ }
+ return super.translate(function);
+ }
+ }
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr")); //$NON-NLS-1$
+
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("MOD", getLanguageFactory())); //$NON-NLS-1$
+
+ //add in type conversion
+ ConvertModifier convertModifier = new ConvertModifier();
+ convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(31,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(31,12)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convertModifier.addTypeMapping("blob", FunctionModifier.BLOB, FunctionModifier.OBJECT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("clob", FunctionModifier.CLOB, FunctionModifier.XML); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("timestamp('1970-01-01', ", function.getParameters().get(0), ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.TIMESTAMP, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("timestamp(",function.getParameters().get(0), ", '00:00:00')"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ //the next convert is not strictly necessary for db2, but it also works for derby
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.FLOAT, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(double(", function.getParameters().get(0), ") as real)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("char"), FunctionModifier.STRING); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("smallint"), FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("integer"), FunctionModifier.INTEGER); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("bigint"), FunctionModifier.LONG); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("double"), FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("date"), FunctionModifier.DATE); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("time"), FunctionModifier.TIME); //$NON-NLS-1$
+ convertModifier.addTypeConversion(new NullHandlingFormatModifier("timestamp"), FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convertModifier.addNumericBooleanConversions();
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ //DB2 doesn't support cross join
+ if (obj instanceof Join) {
+ Join join = (Join)obj;
+ if (join.getJoinType() == JoinType.CROSS_JOIN) {
+ Literal one = getLanguageFactory().createLiteral(1, TypeFacility.RUNTIME_TYPES.INTEGER);
+ join.setCondition(getLanguageFactory().createCompareCriteria(Operator.EQ, one, one));
+ join.setJoinType(JoinType.INNER_JOIN);
+ }
+ }
+ //DB2 needs projected nulls wrapped in casts
+ if (obj instanceof DerivedColumn) {
+ DerivedColumn selectSymbol = (DerivedColumn)obj;
+ if (selectSymbol.getExpression() instanceof Literal) {
+ Literal literal = (Literal)selectSymbol.getExpression();
+ if (literal.getValue() == null) {
+ selectSymbol.setExpression(ConvertModifier.createConvertFunction(getLanguageFactory(), literal, TypeFacility.getDataTypeName(literal.getType())));
+ }
+ }
+ }
+ return super.translate(obj, context);
+ }
+
+
+ @Override
+ public NullOrder getDefaultNullOrder() {
+ return NullOrder.HIGH;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ //supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ //supportedFunctions.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ //supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ //supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ //supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("DAY"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+ supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2SQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2SQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/db2/DB2SQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.db2;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.Join;
-import org.teiid.language.LanguageObject;
-import org.teiid.language.Limit;
-import org.teiid.language.Literal;
-import org.teiid.language.Comparison.Operator;
-import org.teiid.language.Join.JoinType;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.LocateFunctionModifier;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-
-public class DB2SQLTranslator extends Translator {
-
- private final class NullHandlingFormatModifier extends
- ConvertModifier.FormatModifier {
- private NullHandlingFormatModifier(String alias) {
- super(alias);
- }
-
- @Override
- public List<?> translate(Function function) {
- Expression arg = function.getParameters().get(0);
- if (arg instanceof Literal && ((Literal)arg).getValue() == null) {
- ((Literal)function.getParameters().get(1)).setValue(this.alias);
- return null;
- }
- return super.translate(function);
- }
- }
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr")); //$NON-NLS-1$
-
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("MOD", getLanguageFactory())); //$NON-NLS-1$
-
- //add in type conversion
- ConvertModifier convertModifier = new ConvertModifier();
- convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(31,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(31,12)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convertModifier.addTypeMapping("blob", FunctionModifier.BLOB, FunctionModifier.OBJECT); //$NON-NLS-1$
- convertModifier.addTypeMapping("clob", FunctionModifier.CLOB, FunctionModifier.XML); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("timestamp('1970-01-01', ", function.getParameters().get(0), ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.TIMESTAMP, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("timestamp(",function.getParameters().get(0), ", '00:00:00')"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- //the next convert is not strictly necessary for db2, but it also works for derby
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.FLOAT, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("cast(double(", function.getParameters().get(0), ") as real)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("char"), FunctionModifier.STRING); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("smallint"), FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("integer"), FunctionModifier.INTEGER); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("bigint"), FunctionModifier.LONG); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("double"), FunctionModifier.DOUBLE); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("date"), FunctionModifier.DATE); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("time"), FunctionModifier.TIME); //$NON-NLS-1$
- convertModifier.addTypeConversion(new NullHandlingFormatModifier("timestamp"), FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convertModifier.addNumericBooleanConversions();
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- return Arrays.asList("FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- public List<?> translate(LanguageObject obj, ExecutionContext context) {
- //DB2 doesn't support cross join
- if (obj instanceof Join) {
- Join join = (Join)obj;
- if (join.getJoinType() == JoinType.CROSS_JOIN) {
- Literal one = getLanguageFactory().createLiteral(1, TypeFacility.RUNTIME_TYPES.INTEGER);
- join.setCondition(getLanguageFactory().createCompareCriteria(Operator.EQ, one, one));
- join.setJoinType(JoinType.INNER_JOIN);
- }
- }
- //DB2 needs projected nulls wrapped in casts
- if (obj instanceof DerivedColumn) {
- DerivedColumn selectSymbol = (DerivedColumn)obj;
- if (selectSymbol.getExpression() instanceof Literal) {
- Literal literal = (Literal)selectSymbol.getExpression();
- if (literal.getValue() == null) {
- selectSymbol.setExpression(ConvertModifier.createConvertFunction(getLanguageFactory(), literal, TypeFacility.getDataTypeName(literal.getType())));
- }
- }
- }
- return super.translate(obj, context);
- }
-
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return DB2Capabilities.class;
- }
-
- @Override
- public NullOrder getDefaultNullOrder() {
- return NullOrder.HIGH;
- }
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,192 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.derby;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-
-/**
- * @since 5.0
- */
-public class DerbyCapabilities extends JDBCCapabilities {
-
- public static final String TEN_1 = "10.1"; //$NON-NLS-1$
- public static final String TEN_2 = "10.2"; //$NON-NLS-1$
- public static final String TEN_4 = "10.4"; //$NON-NLS-1$
- public static final String TEN_5 = "10.5"; //$NON-NLS-1$
-
- private String version = TEN_1;
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- if (version.compareTo(TEN_2) >= 0) {
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- }
- if (version.compareTo(TEN_4) >= 0) {
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- }
- // These are executed within the server and never pushed down
- //supportedFunctions.add("BITAND"); //$NON-NLS-1$
- //supportedFunctions.add("BITNOT"); //$NON-NLS-1$
- //supportedFunctions.add("BITOR"); //$NON-NLS-1$
- //supportedFunctions.add("BITXOR"); //$NON-NLS-1$
- if (version.compareTo(TEN_2) >= 0) {
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- }
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- if (version.compareTo(TEN_2) >= 0) {
- supportedFunctions.add("PI"); //$NON-NLS-1$
- //supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- //supportedFunctions.add("ROUND"); //$NON-NLS-1$
- if (version.compareTo(TEN_4) >= 0) {
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- }
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- }
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- //supportedFunctions.add("TAN"); //$NON-NLS-1$
-
- //supportedFunctions.add("ASCII"); //$NON-NLS-1$
- //supportedFunctions.add("CHR"); //$NON-NLS-1$
- //supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- //supportedFunctions.add("INSERT"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- //supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- //supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- //supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- //supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- //supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
-
- // These are executed within the server and never pushed down
- //supportedFunctions.add("CURDATE"); //$NON-NLS-1$
- //supportedFunctions.add("CURTIME"); //$NON-NLS-1$
- //supportedFunctions.add("NOW"); //$NON-NLS-1$
- //supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- //supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- //supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- //supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- //supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- //supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
-
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
- public void setDatabaseVersion(String version) {
- this.version = version;
- }
-
- /**
- * Derby supports only SearchedCaseExpression, not CaseExpression.
- * @see org.teiid.translator.ConnectorCapabilities#supportsCaseExpressions()
- * @since 5.0
- */
- public boolean supportsCaseExpressions() {
- return false;
- }
-
- /**
- * Derby supports only left and right outer joins.
- * @see org.teiid.translator.ConnectorCapabilities#supportsFullOuterJoins()
- * @since 5.0
- */
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- /**
- * Inline views (subqueries in the FROM clause) are supported.
- * @see org.teiid.translator.ConnectorCapabilities#supportsInlineViews()
- * @since 4.3
- */
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
- @Override
- public boolean supportsRowLimit() {
- return this.version.compareTo(TEN_5) >= 0;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbySQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbyExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,206 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.derby;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.TranslatorProperty;
+import org.teiid.translator.jdbc.EscapeSyntaxModifier;
+import org.teiid.translator.jdbc.db2.DB2ExecutionFactory;
+import org.teiid.translator.jdbc.oracle.LeftOrRightFunctionModifier;
+
+
+
+/**
+ * @since 4.3
+ */
+public class DerbyExecutionFactory extends DB2ExecutionFactory {
+
+ public static final String TEN_1 = "10.1"; //$NON-NLS-1$
+ public static final String TEN_2 = "10.2"; //$NON-NLS-1$
+ public static final String TEN_4 = "10.4"; //$NON-NLS-1$
+ public static final String TEN_5 = "10.5"; //$NON-NLS-1$
+
+ private String version = TEN_1;
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ //additional derby functions
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
+
+ //overrides of db2 functions
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new EscapeSyntaxModifier());
+ }
+
+ @Override
+ public boolean addSourceComment() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsExplicitNullOrdering() {
+ return version.compareTo(TEN_4) >= 0;
+ }
+
+ @TranslatorProperty(name="DatabaseVersion", description= "Version of the postgres", defaultValue=TEN_1)
+ public String getDatabaseVersion() {
+ return this.version;
+ }
+
+ public void setDatabaseVersion(String version) {
+ this.version = version;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getDefaultSupportedFunctions());
+
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ if (version.compareTo(TEN_2) >= 0) {
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ }
+ if (version.compareTo(TEN_4) >= 0) {
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ }
+ // These are executed within the server and never pushed down
+ //supportedFunctions.add("BITAND"); //$NON-NLS-1$
+ //supportedFunctions.add("BITNOT"); //$NON-NLS-1$
+ //supportedFunctions.add("BITOR"); //$NON-NLS-1$
+ //supportedFunctions.add("BITXOR"); //$NON-NLS-1$
+ if (version.compareTo(TEN_2) >= 0) {
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ }
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ if (version.compareTo(TEN_2) >= 0) {
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ //supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ //supportedFunctions.add("ROUND"); //$NON-NLS-1$
+ if (version.compareTo(TEN_4) >= 0) {
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ }
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ }
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ //supportedFunctions.add("TAN"); //$NON-NLS-1$
+
+ //supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ //supportedFunctions.add("CHR"); //$NON-NLS-1$
+ //supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ //supportedFunctions.add("INSERT"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ //supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ //supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ //supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ //supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ //supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+
+ // These are executed within the server and never pushed down
+ //supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+ //supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+ //supportedFunctions.add("NOW"); //$NON-NLS-1$
+ //supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ //supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ //supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ //supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ //supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ //supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+
+ /**
+ * Derby supports only SearchedCaseExpression, not CaseExpression.
+ * @see org.teiid.translator.ConnectorCapabilities#supportsCaseExpressions()
+ * @since 5.0
+ */
+ @Override
+ public boolean supportsCaseExpressions() {
+ return false;
+ }
+
+ /**
+ * Derby supports only left and right outer joins.
+ * @see org.teiid.translator.ConnectorCapabilities#supportsFullOuterJoins()
+ * @since 5.0
+ */
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return this.version.compareTo(TEN_5) >= 0;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return false;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbySQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/derby/DerbySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.derby;
-
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.EscapeSyntaxModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.db2.DB2SQLTranslator;
-import org.teiid.translator.jdbc.oracle.LeftOrRightFunctionModifier;
-
-
-
-/**
- * @since 4.3
- */
-public class DerbySQLTranslator extends DB2SQLTranslator {
-
- private String version = DerbyCapabilities.TEN_1;
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- //additional derby functions
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
-
- //overrides of db2 functions
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new EscapeSyntaxModifier());
- }
-
- @Override
- public boolean addSourceComment() {
- return false;
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return DerbyCapabilities.class;
- }
-
- @Override
- public boolean supportsExplicitNullOrdering() {
- return version.compareTo(DerbyCapabilities.TEN_4) >= 0;
- }
-
- public void setDatabaseVersion(String version) {
- this.version = version;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Capabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Capabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Capabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.h2;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-public class H2Capabilities extends JDBCCapabilities {
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add(SourceSystemFunctions.ABS);
- supportedFunctions.add(SourceSystemFunctions.ACOS);
- supportedFunctions.add(SourceSystemFunctions.ASIN);
- supportedFunctions.add(SourceSystemFunctions.ATAN);
- supportedFunctions.add(SourceSystemFunctions.ATAN2);
- supportedFunctions.add(SourceSystemFunctions.BITAND);
- //supportedFunctions.add(SourceSystemFunctions.BITNOT);
- supportedFunctions.add(SourceSystemFunctions.BITOR);
- supportedFunctions.add(SourceSystemFunctions.BITXOR);
- supportedFunctions.add(SourceSystemFunctions.CEILING);
- supportedFunctions.add(SourceSystemFunctions.COS);
- supportedFunctions.add(SourceSystemFunctions.COT);
- supportedFunctions.add(SourceSystemFunctions.DEGREES);
- supportedFunctions.add(SourceSystemFunctions.EXP);
- supportedFunctions.add(SourceSystemFunctions.FLOOR);
- supportedFunctions.add(SourceSystemFunctions.LOG);
- supportedFunctions.add(SourceSystemFunctions.LOG10);
- supportedFunctions.add(SourceSystemFunctions.MOD);
- supportedFunctions.add(SourceSystemFunctions.PI);
- supportedFunctions.add(SourceSystemFunctions.POWER);
- supportedFunctions.add(SourceSystemFunctions.RADIANS);
- supportedFunctions.add(SourceSystemFunctions.ROUND);
- supportedFunctions.add(SourceSystemFunctions.SIGN);
- supportedFunctions.add(SourceSystemFunctions.SIN);
- supportedFunctions.add(SourceSystemFunctions.SQRT);
- supportedFunctions.add(SourceSystemFunctions.TAN);
-
- supportedFunctions.add(SourceSystemFunctions.ASCII);
- supportedFunctions.add(SourceSystemFunctions.CHAR);
- supportedFunctions.add(SourceSystemFunctions.CONCAT);
- supportedFunctions.add(SourceSystemFunctions.INSERT);
- supportedFunctions.add(SourceSystemFunctions.LCASE);
- supportedFunctions.add(SourceSystemFunctions.LEFT);
- supportedFunctions.add(SourceSystemFunctions.LENGTH);
- supportedFunctions.add(SourceSystemFunctions.LOCATE);
- supportedFunctions.add(SourceSystemFunctions.LPAD);
- supportedFunctions.add(SourceSystemFunctions.LTRIM);
- supportedFunctions.add(SourceSystemFunctions.REPEAT);
- supportedFunctions.add(SourceSystemFunctions.REPLACE);
- supportedFunctions.add(SourceSystemFunctions.RIGHT);
- supportedFunctions.add(SourceSystemFunctions.RPAD);
- supportedFunctions.add(SourceSystemFunctions.RTRIM);
- supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
- supportedFunctions.add(SourceSystemFunctions.UCASE);
-
- supportedFunctions.add(SourceSystemFunctions.DAYNAME);
- supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
- supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
- supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
-
- supportedFunctions.add(SourceSystemFunctions.FORMATTIMESTAMP);
- supportedFunctions.add(SourceSystemFunctions.HOUR);
- supportedFunctions.add(SourceSystemFunctions.MINUTE);
- supportedFunctions.add(SourceSystemFunctions.MONTH);
- supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
-
- supportedFunctions.add(SourceSystemFunctions.PARSETIMESTAMP);
- supportedFunctions.add(SourceSystemFunctions.QUARTER);
- supportedFunctions.add(SourceSystemFunctions.SECOND);
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
- //supportedFunctions.add(SourceSystemFunctions.TIMESTAMPCREATE);
- supportedFunctions.add(SourceSystemFunctions.WEEK);
- supportedFunctions.add(SourceSystemFunctions.YEAR);
-
- supportedFunctions.add(SourceSystemFunctions.CONVERT);
- supportedFunctions.add(SourceSystemFunctions.IFNULL);
- supportedFunctions.add(SourceSystemFunctions.COALESCE);
- return supportedFunctions;
- }
-
- @Override
- public boolean supportsInlineViews() {
- return true;
- }
-
- @Override
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsRowOffset() {
- return true;
- }
-
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Translator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.h2;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.ModFunctionModifier;
+import org.teiid.translator.jdbc.hsql.AddDiffModifier;
+import org.teiid.translator.jdbc.oracle.ConcatFunctionModifier;
+
+public class H2ExecutionFactory extends JDBCExecutionFactory {
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.PARSETIMESTAMP, new AliasModifier("parsedatetime")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.FORMATTIMESTAMP, new AliasModifier("formatdatetime")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day_of_month")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new AliasModifier("day_of_week")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new AliasModifier("day_of_year")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier(SourceSystemFunctions.MOD, getLanguageFactory()));
+ //TODO: this behavior is configurable in h2 starting with 1.1.119
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new ConcatFunctionModifier(getLanguageFactory()));
+
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true, getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new AddDiffModifier(false, getLanguageFactory()));
+
+ ConvertModifier convert = new ConvertModifier();
+ convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
+ convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
+ convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
+ convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
+ convert.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convert.addTypeMapping("double", FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convert.addTypeMapping("decimal(38,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
+ convert.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
+ convert.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convert.addTypeMapping("varchar", FunctionModifier.STRING); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
+ }
+
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ //supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ supportedFunctions.add(SourceSystemFunctions.CEILING);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LOG10);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.POWER);
+ supportedFunctions.add(SourceSystemFunctions.RADIANS);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.SIGN);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+
+ supportedFunctions.add(SourceSystemFunctions.ASCII);
+ supportedFunctions.add(SourceSystemFunctions.CHAR);
+ supportedFunctions.add(SourceSystemFunctions.CONCAT);
+ supportedFunctions.add(SourceSystemFunctions.INSERT);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LEFT);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.REPEAT);
+ supportedFunctions.add(SourceSystemFunctions.REPLACE);
+ supportedFunctions.add(SourceSystemFunctions.RIGHT);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+
+ supportedFunctions.add(SourceSystemFunctions.DAYNAME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
+
+ supportedFunctions.add(SourceSystemFunctions.FORMATTIMESTAMP);
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
+
+ supportedFunctions.add(SourceSystemFunctions.PARSETIMESTAMP);
+ supportedFunctions.add(SourceSystemFunctions.QUARTER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ //supportedFunctions.add(SourceSystemFunctions.TIMESTAMPCREATE);
+ supportedFunctions.add(SourceSystemFunctions.WEEK);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.IFNULL);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Translator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,96 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.h2;
-
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.hsql.AddDiffModifier;
-import org.teiid.translator.jdbc.oracle.ConcatFunctionModifier;
-
-public class H2Translator extends Translator {
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.PARSETIMESTAMP, new AliasModifier("parsedatetime")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.FORMATTIMESTAMP, new AliasModifier("formatdatetime")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day_of_month")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new AliasModifier("day_of_week")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new AliasModifier("day_of_year")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier(SourceSystemFunctions.MOD, getLanguageFactory()));
- //TODO: this behavior is configurable in h2 starting with 1.1.119
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new ConcatFunctionModifier(getLanguageFactory()));
-
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true, getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new AddDiffModifier(false, getLanguageFactory()));
-
- ConvertModifier convert = new ConvertModifier();
- convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
- convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
- convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
- convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
- convert.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
- convert.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
- convert.addTypeMapping("double", FunctionModifier.DOUBLE); //$NON-NLS-1$
- convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convert.addTypeMapping("decimal(38,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
- convert.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
- convert.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
- convert.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convert.addTypeMapping("varchar", FunctionModifier.STRING); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
- }
-
- @Override
- public String translateLiteralDate(Date dateValue) {
- return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTime(Time timeValue) {
- return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return H2Capabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.hsql;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-public class HsqlCapabilities extends JDBCCapabilities {
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add(SourceSystemFunctions.ABS);
- supportedFunctions.add(SourceSystemFunctions.ACOS);
- supportedFunctions.add(SourceSystemFunctions.ASIN);
- supportedFunctions.add(SourceSystemFunctions.ATAN);
- supportedFunctions.add(SourceSystemFunctions.ATAN2);
- supportedFunctions.add(SourceSystemFunctions.BITAND);
- //supportedFunctions.add(SourceSystemFunctions.BITNOT);
- supportedFunctions.add(SourceSystemFunctions.BITOR);
- //supportedFunctions.add(SourceSystemFunctions.BITXOR);
- supportedFunctions.add(SourceSystemFunctions.CEILING);
- supportedFunctions.add(SourceSystemFunctions.COS);
- supportedFunctions.add(SourceSystemFunctions.COT);
- supportedFunctions.add(SourceSystemFunctions.DEGREES);
- supportedFunctions.add(SourceSystemFunctions.EXP);
- supportedFunctions.add(SourceSystemFunctions.FLOOR);
- supportedFunctions.add(SourceSystemFunctions.LOG);
- supportedFunctions.add(SourceSystemFunctions.LOG10);
- supportedFunctions.add(SourceSystemFunctions.MOD);
- supportedFunctions.add(SourceSystemFunctions.PI);
- supportedFunctions.add(SourceSystemFunctions.POWER);
- supportedFunctions.add(SourceSystemFunctions.RADIANS);
- supportedFunctions.add(SourceSystemFunctions.ROUND);
- supportedFunctions.add(SourceSystemFunctions.SIGN);
- supportedFunctions.add(SourceSystemFunctions.SIN);
- supportedFunctions.add(SourceSystemFunctions.SQRT);
- supportedFunctions.add(SourceSystemFunctions.TAN);
-
- supportedFunctions.add(SourceSystemFunctions.ASCII);
- supportedFunctions.add(SourceSystemFunctions.CHAR);
- supportedFunctions.add(SourceSystemFunctions.CONCAT);
- supportedFunctions.add(SourceSystemFunctions.INSERT);
- supportedFunctions.add(SourceSystemFunctions.LCASE);
- supportedFunctions.add(SourceSystemFunctions.LEFT);
- supportedFunctions.add(SourceSystemFunctions.LENGTH);
- supportedFunctions.add(SourceSystemFunctions.LOCATE);
- supportedFunctions.add(SourceSystemFunctions.LPAD);
- supportedFunctions.add(SourceSystemFunctions.LTRIM);
- supportedFunctions.add(SourceSystemFunctions.REPEAT);
- supportedFunctions.add(SourceSystemFunctions.REPLACE);
- supportedFunctions.add(SourceSystemFunctions.RIGHT);
- supportedFunctions.add(SourceSystemFunctions.RPAD);
- supportedFunctions.add(SourceSystemFunctions.RTRIM);
- supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
- supportedFunctions.add(SourceSystemFunctions.UCASE);
-
- supportedFunctions.add(SourceSystemFunctions.DAYNAME);
- supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
- supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
- supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
-
- //supportedFunctions.add(SourceSystemFunctions.FORMATDATE);
- //supportedFunctions.add(SourceSystemFunctions.FORMATTIME);
- //supportedFunctions.add(SourceSystemFunctions.FORMATTIMESTAMP);
- supportedFunctions.add(SourceSystemFunctions.HOUR);
- supportedFunctions.add(SourceSystemFunctions.MINUTE);
- supportedFunctions.add(SourceSystemFunctions.MONTH);
- supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
-
- //supportedFunctions.add(SourceSystemFunctions.PARSEDATE);
- //supportedFunctions.add(SourceSystemFunctions.PARSETIME);
- //supportedFunctions.add(SourceSystemFunctions.PARSETIMESTAMP);
- supportedFunctions.add(SourceSystemFunctions.QUARTER);
- supportedFunctions.add(SourceSystemFunctions.SECOND);
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
- supportedFunctions.add(SourceSystemFunctions.WEEK);
- supportedFunctions.add(SourceSystemFunctions.YEAR);
-
- supportedFunctions.add(SourceSystemFunctions.CONVERT);
- supportedFunctions.add(SourceSystemFunctions.IFNULL);
- supportedFunctions.add(SourceSystemFunctions.COALESCE);
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- public boolean supportsRowOffset() {
- return true;
- }
-
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.hsql;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+
+public class HsqlExecutionFactory extends JDBCExecutionFactory {
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true, getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new AddDiffModifier(false, getLanguageFactory()));
+
+ ConvertModifier convert = new ConvertModifier();
+ convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
+ convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
+ convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
+ convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
+ convert.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convert.addTypeMapping("double", FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convert.addTypeMapping("decimal(38,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
+ convert.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
+ convert.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convert.addTypeMapping("varchar", FunctionModifier.STRING); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
+ }
+
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ //supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ //supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ supportedFunctions.add(SourceSystemFunctions.CEILING);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LOG10);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.POWER);
+ supportedFunctions.add(SourceSystemFunctions.RADIANS);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.SIGN);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+
+ supportedFunctions.add(SourceSystemFunctions.ASCII);
+ supportedFunctions.add(SourceSystemFunctions.CHAR);
+ supportedFunctions.add(SourceSystemFunctions.CONCAT);
+ supportedFunctions.add(SourceSystemFunctions.INSERT);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LEFT);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.REPEAT);
+ supportedFunctions.add(SourceSystemFunctions.REPLACE);
+ supportedFunctions.add(SourceSystemFunctions.RIGHT);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+
+ supportedFunctions.add(SourceSystemFunctions.DAYNAME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
+
+ //supportedFunctions.add(SourceSystemFunctions.FORMATDATE);
+ //supportedFunctions.add(SourceSystemFunctions.FORMATTIME);
+ //supportedFunctions.add(SourceSystemFunctions.FORMATTIMESTAMP);
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
+
+ //supportedFunctions.add(SourceSystemFunctions.PARSEDATE);
+ //supportedFunctions.add(SourceSystemFunctions.PARSETIME);
+ //supportedFunctions.add(SourceSystemFunctions.PARSETIMESTAMP);
+ supportedFunctions.add(SourceSystemFunctions.QUARTER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ supportedFunctions.add(SourceSystemFunctions.WEEK);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.IFNULL);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/hsql/HsqlTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.hsql;
-
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.Translator;
-
-public class HsqlTranslator extends Translator {
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new AddDiffModifier(true, getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new AddDiffModifier(false, getLanguageFactory()));
-
- ConvertModifier convert = new ConvertModifier();
- convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
- convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
- convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
- convert.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
- convert.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
- convert.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
- convert.addTypeMapping("double", FunctionModifier.DOUBLE); //$NON-NLS-1$
- convert.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convert.addTypeMapping("decimal(38,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
- convert.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
- convert.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
- convert.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convert.addTypeMapping("varchar", FunctionModifier.STRING); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
- }
-
- @Override
- public String translateLiteralDate(Date dateValue) {
- return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTime(Time timeValue) {
- return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return HsqlCapabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.informix;
-
-import java.util.*;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class InformixCapabilities extends JDBCCapabilities {
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List getSupportedFunctions() {
- List supportedFunctons = new ArrayList();
- supportedFunctons.addAll(super.getSupportedFunctions());
- supportedFunctons.add("CAST"); //$NON-NLS-1$
- supportedFunctons.add("CONVERT"); //$NON-NLS-1$
- return supportedFunctons;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.informix;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+
+
+/**
+ */
+public class InformixExecutionFactory extends JDBCExecutionFactory {
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, new ConvertModifier());
+ }
+
+ @Override
+ public List getSupportedFunctions() {
+ List supportedFunctons = new ArrayList();
+ supportedFunctons.addAll(super.getSupportedFunctions());
+ supportedFunctons.add("CAST"); //$NON-NLS-1$
+ supportedFunctons.add("CONVERT"); //$NON-NLS-1$
+ return supportedFunctons;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/informix/InformixSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.informix;
-
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.Translator;
-
-
-/**
- */
-public class InformixSQLTranslator extends Translator {
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, new ConvertModifier());
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return InformixCapabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MMCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MMCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MMCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,126 +0,0 @@
-/*
- * Copyright © 2000-2005 MetaMatrix, Inc. All rights reserved.
- */
-/*
- */
-package org.teiid.translator.jdbc.mm;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-/**
- * Capabilities compatible with MM 5.5.x
- */
-public class MMCapabilities extends JDBCCapabilities {
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
- supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
- supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
- supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PARSEBIGDECIMAL"); //$NON-NLS-1$
- supportedFunctions.add("PARSEBIGINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("PARSEDOUBLE"); //$NON-NLS-1$
- supportedFunctions.add("PARSEFLOAT"); //$NON-NLS-1$
- supportedFunctions.add("PARSEINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("PARSELONG"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("ROUND"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT2"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("INSERT"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("CURDATE"); //$NON-NLS-1$
- supportedFunctions.add("CURTIME"); //$NON-NLS-1$
- supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
- supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
- supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
- supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
- supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("MODIFYTIMEZONE"); //$NON-NLS-1$
- supportedFunctions.add("DECODESTRING"); //$NON-NLS-1$
- supportedFunctions.add("DECODEINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("USER"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- public boolean supportsRowOffset() {
- return true;
- }
-}
\ No newline at end of file
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MMCapabilities.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,130 @@
+/*
+ * Copyright © 2000-2005 MetaMatrix, Inc. All rights reserved.
+ */
+/*
+ */
+package org.teiid.translator.jdbc.mm;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+
+/**
+ * Capabilities compatible with MM 5.5.x
+ */
+public class MetaMatrixExecutionFactory extends JDBCExecutionFactory {
+
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEBIGDECIMAL"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEBIGINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEDOUBLE"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEFLOAT"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("PARSELONG"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("ROUND"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT2"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ supportedFunctions.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("INSERT"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+ supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+ supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+ supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+ supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("MODIFYTIMEZONE"); //$NON-NLS-1$
+ supportedFunctions.add("DECODESTRING"); //$NON-NLS-1$
+ supportedFunctions.add("DECODEINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("USER"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+}
\ No newline at end of file
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Capabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Capabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Capabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.mysql;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.SourceSystemFunctions;
-
-
-
-/**
- * @since 4.3
- */
-public class MySQL5Capabilities extends MySQLCapabilities {
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
- supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
- return supportedFunctions;
- }
-
- @Override
- public boolean supportsInlineViews() {
- return true;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Translator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5ExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.mysql;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.Function;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+public class MySQL5ExecutionFactory extends MySQLExecutionFactory {
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.CHAR, new FunctionModifier() {
+
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("char(", function.getParameters().get(0), " USING ASCII)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+ supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Translator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQL5Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.mysql;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.Function;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-
-public class MySQL5Translator extends MySQLTranslator {
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.CHAR, new FunctionModifier() {
-
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("char(", function.getParameters().get(0), " USING ASCII)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return MySQL5Capabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,282 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.mysql;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-
-/**
- * @since 4.3
- */
-public class MySQLCapabilities extends JDBCCapabilities {
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add(SourceSystemFunctions.ABS);
- supportedFunctions.add(SourceSystemFunctions.ACOS);
- supportedFunctions.add(SourceSystemFunctions.ASIN);
- supportedFunctions.add(SourceSystemFunctions.ATAN);
- supportedFunctions.add(SourceSystemFunctions.ATAN2);
- supportedFunctions.add(SourceSystemFunctions.BITAND);
- supportedFunctions.add(SourceSystemFunctions.BITNOT);
- supportedFunctions.add(SourceSystemFunctions.BITOR);
- supportedFunctions.add(SourceSystemFunctions.BITXOR);
- supportedFunctions.add(SourceSystemFunctions.CEILING);
- supportedFunctions.add(SourceSystemFunctions.COS);
- supportedFunctions.add(SourceSystemFunctions.COT);
- supportedFunctions.add(SourceSystemFunctions.DEGREES);
- supportedFunctions.add(SourceSystemFunctions.EXP);
- supportedFunctions.add(SourceSystemFunctions.FLOOR);
- supportedFunctions.add(SourceSystemFunctions.LOG);
- supportedFunctions.add(SourceSystemFunctions.LOG10);
- supportedFunctions.add(SourceSystemFunctions.MOD);
- supportedFunctions.add(SourceSystemFunctions.PI);
- supportedFunctions.add(SourceSystemFunctions.POWER);
- supportedFunctions.add(SourceSystemFunctions.RADIANS);
- supportedFunctions.add(SourceSystemFunctions.ROUND);
- supportedFunctions.add(SourceSystemFunctions.SIGN);
- supportedFunctions.add(SourceSystemFunctions.SIN);
- supportedFunctions.add(SourceSystemFunctions.SQRT);
- supportedFunctions.add(SourceSystemFunctions.TAN);
-
- supportedFunctions.add(SourceSystemFunctions.ASCII);
- supportedFunctions.add(SourceSystemFunctions.CHAR);
- supportedFunctions.add(SourceSystemFunctions.CONCAT);
- supportedFunctions.add(SourceSystemFunctions.INSERT);
- supportedFunctions.add(SourceSystemFunctions.LCASE);
- supportedFunctions.add(SourceSystemFunctions.LEFT);
- supportedFunctions.add(SourceSystemFunctions.LENGTH);
- supportedFunctions.add(SourceSystemFunctions.LOCATE);
- supportedFunctions.add(SourceSystemFunctions.LPAD);
- supportedFunctions.add(SourceSystemFunctions.LTRIM);
- supportedFunctions.add(SourceSystemFunctions.REPEAT);
- supportedFunctions.add(SourceSystemFunctions.REPLACE);
- supportedFunctions.add(SourceSystemFunctions.RIGHT);
- supportedFunctions.add(SourceSystemFunctions.RPAD);
- supportedFunctions.add(SourceSystemFunctions.RTRIM);
- supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
- supportedFunctions.add(SourceSystemFunctions.UCASE);
-
- // These are executed within the server and never pushed down
-// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
-// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
-// supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add(SourceSystemFunctions.DAYNAME);
- supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
- supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
- supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add(SourceSystemFunctions.HOUR);
- supportedFunctions.add(SourceSystemFunctions.MINUTE);
- supportedFunctions.add(SourceSystemFunctions.MONTH);
- supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
-
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add(SourceSystemFunctions.QUARTER);
- supportedFunctions.add(SourceSystemFunctions.SECOND);
-// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
-// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
- supportedFunctions.add(SourceSystemFunctions.WEEK);
- supportedFunctions.add(SourceSystemFunctions.YEAR);
-
- supportedFunctions.add(SourceSystemFunctions.CONVERT);
- supportedFunctions.add(SourceSystemFunctions.IFNULL);
- supportedFunctions.add(SourceSystemFunctions.COALESCE);
-
-// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
-// supportedFunctions.add("ISNULL"); //$NON-NLS-1$
-// supportedFunctions.add("LEAST"); //$NON-NLS-1$
-// supportedFunctions.add("STRCMP"); // String-specific //$NON-NLS-1$
-//
-// // String
-// supportedFunctions.add("BIN"); //$NON-NLS-1$
-// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("COMPRESS"); //$NON-NLS-1$
-// supportedFunctions.add("CONCAT_WS"); //$NON-NLS-1$
-// supportedFunctions.add("CONV"); //$NON-NLS-1$
-// supportedFunctions.add("ELT"); //$NON-NLS-1$
-// supportedFunctions.add("EXPORT_SET"); //$NON-NLS-1$
-// supportedFunctions.add("FIELD"); //$NON-NLS-1$
-// supportedFunctions.add("FIND_IN_SET"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("HEX"); //$NON-NLS-1$
-// supportedFunctions.add("INSTR"); //$NON-NLS-1$
-// supportedFunctions.add("LOAD_FILE"); //$NON-NLS-1$
-// supportedFunctions.add("MAKE_SET"); //$NON-NLS-1$
-// supportedFunctions.add("MID"); //$NON-NLS-1$
-// supportedFunctions.add("OCT"); //$NON-NLS-1$
-// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("ORD"); //$NON-NLS-1$
-// supportedFunctions.add("QUOTE"); //$NON-NLS-1$
-// supportedFunctions.add("REVERSE"); //$NON-NLS-1$
-// supportedFunctions.add("SOUNDEX"); //$NON-NLS-1$
-// supportedFunctions.add("SPACE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
-// supportedFunctions.add("SUBSTRING_INDEX"); //$NON-NLS-1$
-// supportedFunctions.add("TRIM"); //$NON-NLS-1$
-// supportedFunctions.add("UNCOMPRESS"); //$NON-NLS-1$
-// supportedFunctions.add("UNHEX"); //$NON-NLS-1$
-//
-// // Math
-// supportedFunctions.add("CEIL"); //$NON-NLS-1$
-// supportedFunctions.add("CRC32"); //$NON-NLS-1$
-// // DIV is an operator equivalent to '/'
-// supportedFunctions.add("DIV"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("LN"); //$NON-NLS-1$
-// supportedFunctions.add("LOG2"); //$NON-NLS-1$
-// supportedFunctions.add("POW"); //$NON-NLS-1$
-// supportedFunctions.add("RAND"); //$NON-NLS-1$
-// supportedFunctions.add("TRUNCATE"); //$NON-NLS-1$
-//
-// // Date / Time
-// supportedFunctions.add("ADDDATE"); //$NON-NLS-1$
-// supportedFunctions.add("ADDTIME"); //$NON-NLS-1$
-// supportedFunctions.add("CONVERT_TZ"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("DATE"); //$NON-NLS-1$
-// supportedFunctions.add("DATEDIFF"); //$NON-NLS-1$
-//// supportedFunctions.add("DATE_ADD");
-//// supportedFunctions.add("DATE_SUB");
-// supportedFunctions.add("DATE_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("DAY"); //$NON-NLS-1$
-//// supportedFunctions.add("EXTRACT");
-// supportedFunctions.add("FROM_DAYS"); //$NON-NLS-1$
-// supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
-// supportedFunctions.add("GET_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("LAST_DAY"); //$NON-NLS-1$
-// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$
-// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("MAKEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("MAKETIME"); //$NON-NLS-1$
-// supportedFunctions.add("MICROSECOND"); //$NON-NLS-1$
-// supportedFunctions.add("PERIOD_ADD"); //$NON-NLS-1$
-// supportedFunctions.add("PERIOD_DIFF"); //$NON-NLS-1$
-// supportedFunctions.add("SEC_TO_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("STR_TO_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBDATE"); //$NON-NLS-1$
-// supportedFunctions.add("SUBTIME"); //$NON-NLS-1$
-// supportedFunctions.add("SYSDATE"); //$NON-NLS-1$
-// supportedFunctions.add("TIME"); //$NON-NLS-1$
-// supportedFunctions.add("TIMEDIFF"); //$NON-NLS-1$
-// supportedFunctions.add("TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("TIME_FORMAT"); //$NON-NLS-1$
-// supportedFunctions.add("TIME_TO_SEC"); //$NON-NLS-1$
-// supportedFunctions.add("TO_DAYS"); //$NON-NLS-1$
-// supportedFunctions.add("UNIX_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_TIME"); //$NON-NLS-1$
-// supportedFunctions.add("UTC_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("WEEKDAY"); //$NON-NLS-1$
-// supportedFunctions.add("WEEKOFYEAR"); //$NON-NLS-1$
-// supportedFunctions.add("YEARWEEK"); //$NON-NLS-1$
-//
-// // Bit
-// supportedFunctions.add("|"); //$NON-NLS-1$
-// supportedFunctions.add("&"); //$NON-NLS-1$
-// supportedFunctions.add("^"); //$NON-NLS-1$
-// supportedFunctions.add("<<"); //$NON-NLS-1$
-// supportedFunctions.add(">>"); //$NON-NLS-1$
-// supportedFunctions.add("~"); //$NON-NLS-1$
-// supportedFunctions.add("BIT_COUNT"); //$NON-NLS-1$
-//
-// // Encryption
-// supportedFunctions.add("AES_ENCRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("AES_DECRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("DECODE"); //$NON-NLS-1$
-// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
-// supportedFunctions.add("DES_ENCRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("DES_DECRYPT"); //$NON-NLS-1$
-// supportedFunctions.add("MD5"); //$NON-NLS-1$
-// supportedFunctions.add("OLD_PASSWORD"); //$NON-NLS-1$
-// supportedFunctions.add("PASSWORD"); //$NON-NLS-1$
-// supportedFunctions.add("SHA"); //$NON-NLS-1$
-// supportedFunctions.add("SHA1"); //$NON-NLS-1$
-//
-// // Information
-// supportedFunctions.add("BENCHMARK"); //$NON-NLS-1$
-// supportedFunctions.add("CHARSET"); //$NON-NLS-1$
-// supportedFunctions.add("COERCIBILITY"); //$NON-NLS-1$
-// supportedFunctions.add("COLLATION"); //$NON-NLS-1$
-// supportedFunctions.add("CONNECTION_ID"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$
-// supportedFunctions.add("DATABASE"); //$NON-NLS-1$
-// supportedFunctions.add("FOUND_ROWS"); //$NON-NLS-1$
-// supportedFunctions.add("LAST_INSERT_ID"); //$NON-NLS-1$
-// supportedFunctions.add("ROW_COUNT"); //$NON-NLS-1$
-// supportedFunctions.add("SCHEMA"); //$NON-NLS-1$
-// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$
-// supportedFunctions.add("SYSTEM_USER"); //$NON-NLS-1$
-// supportedFunctions.add("USER"); //$NON-NLS-1$
-// supportedFunctions.add("VERSION"); //$NON-NLS-1$
-//
-// // Misc.
-// supportedFunctions.add("DEFAULT"); //$NON-NLS-1$
-// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
-//// supportedFunctions.add("GET_LOCK"); //$NON-NLS-1$
-// supportedFunctions.add("INET_ATON"); //$NON-NLS-1$
-// supportedFunctions.add("INET_NTOA"); //$NON-NLS-1$
-//// supportedFunctions.add("IS_FREE_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("IS_USED_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("MASTER_POS_WAIT"); //$NON-NLS-1$
-//// supportedFunctions.add("NAME_CONST"); //$NON-NLS-1$
-//// supportedFunctions.add("RELEASE_LOCK"); //$NON-NLS-1$
-//// supportedFunctions.add("SLEEP"); //$NON-NLS-1$
-// supportedFunctions.add("UUID"); //$NON-NLS-1$
-// supportedFunctions.add("VALUES"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- public boolean supportsAggregatesDistinct() {
- return false;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
- public boolean supportsRowOffset() {
- return true;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,398 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.mysql;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.Function;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.LocateFunctionModifier;
+
+
+/**
+ * @since 4.3
+ */
+public class MySQLExecutionFactory extends JDBCExecutionFactory {
+
+ /**
+ * Adds support for the 2 argument form of padding
+ */
+ private final class PadFunctionModifier extends FunctionModifier {
+ @Override
+ public List<?> translate(Function function) {
+ if (function.getParameters().size() == 2) {
+ function.getParameters().add(getLanguageFactory().createLiteral(" ", TypeFacility.RUNTIME_TYPES.STRING)); //$NON-NLS-1$
+ }
+ return null;
+ }
+ }
+
+ @Override
+ public void start() throws ConnectorException {
+ super.start();
+ registerFunctionModifier(SourceSystemFunctions.BITAND, new BitFunctionModifier("&", getLanguageFactory())); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITNOT, new BitFunctionModifier("~", getLanguageFactory())); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITOR, new BitFunctionModifier("|", getLanguageFactory())); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITXOR, new BitFunctionModifier("^", getLanguageFactory())); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.LPAD, new PadFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.RPAD, new PadFunctionModifier());
+ //add in type conversion
+ ConvertModifier convertModifier = new ConvertModifier();
+ convertModifier.addTypeMapping("signed", FunctionModifier.BOOLEAN, FunctionModifier.BYTE, FunctionModifier.SHORT, FunctionModifier.INTEGER, FunctionModifier.LONG); //$NON-NLS-1$
+ //char(n) assume 4.1 or later
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convertModifier.addTypeMapping("char", FunctionModifier.STRING); //$NON-NLS-1$
+ convertModifier.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
+ convertModifier.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
+ convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("DATE")); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("TIME")); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("TIMESTAMP")); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%Y-%m-%d")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%H:%i:%S")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%Y-%m-%d %H:%i:%S.%f")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addTypeConversion(new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList(function.getParameters().get(0), " + 0.0"); //$NON-NLS-1$
+ }
+ }, FunctionModifier.BIGDECIMAL, FunctionModifier.BIGINTEGER, FunctionModifier.FLOAT, FunctionModifier.DOUBLE);
+ convertModifier.addNumericBooleanConversions();
+ convertModifier.setWideningNumericImplicit(true);
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "DATE('" + formatDateValue(dateValue) + "')"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ return "TIME('" + formatDateValue(timeValue) + "')"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "{ts '" + formatDateValue(timestampValue) + "'}"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public boolean useParensForSetQueries() {
+ return true;
+ }
+
+ @Override
+ public int getTimestampNanoPrecision() {
+ return 0;
+ }
+
+ @Override
+ public void afterConnectionCreation(Connection connection) {
+ super.afterConnectionCreation(connection);
+
+ Statement stmt = null;
+ try {
+ stmt = connection.createStatement();
+ stmt.execute("set SESSION sql_mode = 'ANSI'"); //$NON-NLS-1$
+ } catch (SQLException e) {
+ LogManager.logError(LogConstants.CTX_CONNECTOR, e, "Error setting ANSI mode"); //$NON-NLS-1$
+ } finally {
+ if (stmt != null) {
+ try {
+ stmt.close();
+ } catch (SQLException e) {
+ LogManager.logDetail("Error closing statement", e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+ @Override
+ public boolean useParensForJoins() {
+ return true;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ supportedFunctions.add(SourceSystemFunctions.CEILING);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LOG10);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.POWER);
+ supportedFunctions.add(SourceSystemFunctions.RADIANS);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.SIGN);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+
+ supportedFunctions.add(SourceSystemFunctions.ASCII);
+ supportedFunctions.add(SourceSystemFunctions.CHAR);
+ supportedFunctions.add(SourceSystemFunctions.CONCAT);
+ supportedFunctions.add(SourceSystemFunctions.INSERT);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LEFT);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.REPEAT);
+ supportedFunctions.add(SourceSystemFunctions.REPLACE);
+ supportedFunctions.add(SourceSystemFunctions.RIGHT);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+
+ // These are executed within the server and never pushed down
+// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+// supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.DAYNAME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.MONTHNAME);
+
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.QUARTER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPADD);
+// supportedFunctions.add(SourceSystemFunctions.TIMESTAMPDIFF);
+ supportedFunctions.add(SourceSystemFunctions.WEEK);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.IFNULL);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+
+// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
+// supportedFunctions.add("ISNULL"); //$NON-NLS-1$
+// supportedFunctions.add("LEAST"); //$NON-NLS-1$
+// supportedFunctions.add("STRCMP"); // String-specific //$NON-NLS-1$
+//
+// // String
+// supportedFunctions.add("BIN"); //$NON-NLS-1$
+// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("COMPRESS"); //$NON-NLS-1$
+// supportedFunctions.add("CONCAT_WS"); //$NON-NLS-1$
+// supportedFunctions.add("CONV"); //$NON-NLS-1$
+// supportedFunctions.add("ELT"); //$NON-NLS-1$
+// supportedFunctions.add("EXPORT_SET"); //$NON-NLS-1$
+// supportedFunctions.add("FIELD"); //$NON-NLS-1$
+// supportedFunctions.add("FIND_IN_SET"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("HEX"); //$NON-NLS-1$
+// supportedFunctions.add("INSTR"); //$NON-NLS-1$
+// supportedFunctions.add("LOAD_FILE"); //$NON-NLS-1$
+// supportedFunctions.add("MAKE_SET"); //$NON-NLS-1$
+// supportedFunctions.add("MID"); //$NON-NLS-1$
+// supportedFunctions.add("OCT"); //$NON-NLS-1$
+// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("ORD"); //$NON-NLS-1$
+// supportedFunctions.add("QUOTE"); //$NON-NLS-1$
+// supportedFunctions.add("REVERSE"); //$NON-NLS-1$
+// supportedFunctions.add("SOUNDEX"); //$NON-NLS-1$
+// supportedFunctions.add("SPACE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
+// supportedFunctions.add("SUBSTRING_INDEX"); //$NON-NLS-1$
+// supportedFunctions.add("TRIM"); //$NON-NLS-1$
+// supportedFunctions.add("UNCOMPRESS"); //$NON-NLS-1$
+// supportedFunctions.add("UNHEX"); //$NON-NLS-1$
+//
+// // Math
+// supportedFunctions.add("CEIL"); //$NON-NLS-1$
+// supportedFunctions.add("CRC32"); //$NON-NLS-1$
+// // DIV is an operator equivalent to '/'
+// supportedFunctions.add("DIV"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("LN"); //$NON-NLS-1$
+// supportedFunctions.add("LOG2"); //$NON-NLS-1$
+// supportedFunctions.add("POW"); //$NON-NLS-1$
+// supportedFunctions.add("RAND"); //$NON-NLS-1$
+// supportedFunctions.add("TRUNCATE"); //$NON-NLS-1$
+//
+// // Date / Time
+// supportedFunctions.add("ADDDATE"); //$NON-NLS-1$
+// supportedFunctions.add("ADDTIME"); //$NON-NLS-1$
+// supportedFunctions.add("CONVERT_TZ"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("DATE"); //$NON-NLS-1$
+// supportedFunctions.add("DATEDIFF"); //$NON-NLS-1$
+//// supportedFunctions.add("DATE_ADD");
+//// supportedFunctions.add("DATE_SUB");
+// supportedFunctions.add("DATE_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("DAY"); //$NON-NLS-1$
+//// supportedFunctions.add("EXTRACT");
+// supportedFunctions.add("FROM_DAYS"); //$NON-NLS-1$
+// supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
+// supportedFunctions.add("GET_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("LAST_DAY"); //$NON-NLS-1$
+// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$
+// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("MAKEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("MAKETIME"); //$NON-NLS-1$
+// supportedFunctions.add("MICROSECOND"); //$NON-NLS-1$
+// supportedFunctions.add("PERIOD_ADD"); //$NON-NLS-1$
+// supportedFunctions.add("PERIOD_DIFF"); //$NON-NLS-1$
+// supportedFunctions.add("SEC_TO_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("STR_TO_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBDATE"); //$NON-NLS-1$
+// supportedFunctions.add("SUBTIME"); //$NON-NLS-1$
+// supportedFunctions.add("SYSDATE"); //$NON-NLS-1$
+// supportedFunctions.add("TIME"); //$NON-NLS-1$
+// supportedFunctions.add("TIMEDIFF"); //$NON-NLS-1$
+// supportedFunctions.add("TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("TIME_FORMAT"); //$NON-NLS-1$
+// supportedFunctions.add("TIME_TO_SEC"); //$NON-NLS-1$
+// supportedFunctions.add("TO_DAYS"); //$NON-NLS-1$
+// supportedFunctions.add("UNIX_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_TIME"); //$NON-NLS-1$
+// supportedFunctions.add("UTC_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("WEEKDAY"); //$NON-NLS-1$
+// supportedFunctions.add("WEEKOFYEAR"); //$NON-NLS-1$
+// supportedFunctions.add("YEARWEEK"); //$NON-NLS-1$
+//
+// // Bit
+// supportedFunctions.add("|"); //$NON-NLS-1$
+// supportedFunctions.add("&"); //$NON-NLS-1$
+// supportedFunctions.add("^"); //$NON-NLS-1$
+// supportedFunctions.add("<<"); //$NON-NLS-1$
+// supportedFunctions.add(">>"); //$NON-NLS-1$
+// supportedFunctions.add("~"); //$NON-NLS-1$
+// supportedFunctions.add("BIT_COUNT"); //$NON-NLS-1$
+//
+// // Encryption
+// supportedFunctions.add("AES_ENCRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("AES_DECRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("DECODE"); //$NON-NLS-1$
+// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
+// supportedFunctions.add("DES_ENCRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("DES_DECRYPT"); //$NON-NLS-1$
+// supportedFunctions.add("MD5"); //$NON-NLS-1$
+// supportedFunctions.add("OLD_PASSWORD"); //$NON-NLS-1$
+// supportedFunctions.add("PASSWORD"); //$NON-NLS-1$
+// supportedFunctions.add("SHA"); //$NON-NLS-1$
+// supportedFunctions.add("SHA1"); //$NON-NLS-1$
+//
+// // Information
+// supportedFunctions.add("BENCHMARK"); //$NON-NLS-1$
+// supportedFunctions.add("CHARSET"); //$NON-NLS-1$
+// supportedFunctions.add("COERCIBILITY"); //$NON-NLS-1$
+// supportedFunctions.add("COLLATION"); //$NON-NLS-1$
+// supportedFunctions.add("CONNECTION_ID"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$
+// supportedFunctions.add("DATABASE"); //$NON-NLS-1$
+// supportedFunctions.add("FOUND_ROWS"); //$NON-NLS-1$
+// supportedFunctions.add("LAST_INSERT_ID"); //$NON-NLS-1$
+// supportedFunctions.add("ROW_COUNT"); //$NON-NLS-1$
+// supportedFunctions.add("SCHEMA"); //$NON-NLS-1$
+// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$
+// supportedFunctions.add("SYSTEM_USER"); //$NON-NLS-1$
+// supportedFunctions.add("USER"); //$NON-NLS-1$
+// supportedFunctions.add("VERSION"); //$NON-NLS-1$
+//
+// // Misc.
+// supportedFunctions.add("DEFAULT"); //$NON-NLS-1$
+// supportedFunctions.add("FORMAT"); //$NON-NLS-1$
+//// supportedFunctions.add("GET_LOCK"); //$NON-NLS-1$
+// supportedFunctions.add("INET_ATON"); //$NON-NLS-1$
+// supportedFunctions.add("INET_NTOA"); //$NON-NLS-1$
+//// supportedFunctions.add("IS_FREE_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("IS_USED_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("MASTER_POS_WAIT"); //$NON-NLS-1$
+//// supportedFunctions.add("NAME_CONST"); //$NON-NLS-1$
+//// supportedFunctions.add("RELEASE_LOCK"); //$NON-NLS-1$
+//// supportedFunctions.add("SLEEP"); //$NON-NLS-1$
+// supportedFunctions.add("UUID"); //$NON-NLS-1$
+// supportedFunctions.add("VALUES"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mysql/MySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.mysql;
-
-import java.sql.Connection;
-import java.sql.Date;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.Function;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.LocateFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-
-
-/**
- * @since 4.3
- */
-public class MySQLTranslator extends Translator {
-
- /**
- * Adds support for the 2 argument form of padding
- */
- private final class PadFunctionModifier extends FunctionModifier {
- @Override
- public List<?> translate(Function function) {
- if (function.getParameters().size() == 2) {
- function.getParameters().add(getLanguageFactory().createLiteral(" ", TypeFacility.RUNTIME_TYPES.STRING)); //$NON-NLS-1$
- }
- return null;
- }
- }
-
- @Override
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.BITAND, new BitFunctionModifier("&", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITNOT, new BitFunctionModifier("~", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITOR, new BitFunctionModifier("|", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITXOR, new BitFunctionModifier("^", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.LPAD, new PadFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.RPAD, new PadFunctionModifier());
- //add in type conversion
- ConvertModifier convertModifier = new ConvertModifier();
- convertModifier.addTypeMapping("signed", FunctionModifier.BOOLEAN, FunctionModifier.BYTE, FunctionModifier.SHORT, FunctionModifier.INTEGER, FunctionModifier.LONG); //$NON-NLS-1$
- //char(n) assume 4.1 or later
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convertModifier.addTypeMapping("char", FunctionModifier.STRING); //$NON-NLS-1$
- convertModifier.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
- convertModifier.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
- convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("DATE")); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("TIME")); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("TIMESTAMP")); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%Y-%m-%d")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%H:%i:%S")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("date_format", "%Y-%m-%d %H:%i:%S.%f")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addTypeConversion(new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList(function.getParameters().get(0), " + 0.0"); //$NON-NLS-1$
- }
- }, FunctionModifier.BIGDECIMAL, FunctionModifier.BIGINTEGER, FunctionModifier.FLOAT, FunctionModifier.DOUBLE);
- convertModifier.addNumericBooleanConversions();
- convertModifier.setWideningNumericImplicit(true);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- @Override
- public String translateLiteralDate(Date dateValue) {
- return "DATE('" + formatDateValue(dateValue) + "')"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTime(Time timeValue) {
- return "TIME('" + formatDateValue(timeValue) + "')"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return "{ts '" + formatDateValue(timestampValue) + "'}"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public boolean useParensForSetQueries() {
- return true;
- }
-
- @Override
- public int getTimestampNanoPrecision() {
- return 0;
- }
-
- @Override
- public void afterConnectionCreation(Connection connection) {
- super.afterConnectionCreation(connection);
-
- Statement stmt = null;
- try {
- stmt = connection.createStatement();
- stmt.execute("set SESSION sql_mode = 'ANSI'"); //$NON-NLS-1$
- } catch (SQLException e) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, e, "Error setting ANSI mode"); //$NON-NLS-1$
- } finally {
- if (stmt != null) {
- try {
- stmt.close();
- } catch (SQLException e) {
- LogManager.logDetail("Error closing statement", e); //$NON-NLS-1$
- }
- }
- }
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return MySQLCapabilities.class;
- }
-
- public boolean useParensForJoins() {
- return true;
- }
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.oracle;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class OracleCapabilities extends JDBCCapabilities {
-
- public OracleCapabilities() {
- }
-
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add(SourceSystemFunctions.COT);
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("DAY"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- //supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
- //supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
- //supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- //supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
- //supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
- //supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
-
- supportedFunctions.add(OracleSQLTranslator.RELATE);
- supportedFunctions.add(OracleSQLTranslator.NEAREST_NEIGHBOR);
- supportedFunctions.add(OracleSQLTranslator.FILTER);
- supportedFunctions.add(OracleSQLTranslator.NEAREST_NEIGHBOR_DISTANCE);
- supportedFunctions.add(OracleSQLTranslator.WITHIN_DISTANCE);
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
- public boolean supportsRowOffset() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,549 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.oracle;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.teiid.language.ColumnReference;
+import org.teiid.language.Command;
+import org.teiid.language.DerivedColumn;
+import org.teiid.language.Expression;
+import org.teiid.language.ExpressionValueSource;
+import org.teiid.language.Function;
+import org.teiid.language.Insert;
+import org.teiid.language.Limit;
+import org.teiid.language.Literal;
+import org.teiid.language.NamedTable;
+import org.teiid.language.QueryExpression;
+import org.teiid.language.Select;
+import org.teiid.language.SQLReservedWords.Tokens;
+import org.teiid.language.SetQuery.Operation;
+import org.teiid.language.visitor.CollectorVisitor;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.metadata.Column;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.ExtractFunctionModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.JDBCPlugin;
+import org.teiid.translator.jdbc.LocateFunctionModifier;
+
+
+
+public class OracleExecutionFactory extends JDBCExecutionFactory {
+
+ /*
+ * Spatial Functions
+ */
+ public static final String RELATE = "sdo_relate"; //$NON-NLS-1$
+ public static final String NEAREST_NEIGHBOR = "sdo_nn"; //$NON-NLS-1$
+ public static final String FILTER = "sdo_filter"; //$NON-NLS-1$
+ public static final String WITHIN_DISTANCE = "sdo_within_distance"; //$NON-NLS-1$
+ public static final String NEAREST_NEIGHBOR_DISTANCE = "sdo_nn_distance"; //$NON-NLS-1$
+
+ public final static String HINT_PREFIX = "/*+"; //$NON-NLS-1$
+ public final static String DUAL = "DUAL"; //$NON-NLS-1$
+ public final static String ROWNUM = "ROWNUM"; //$NON-NLS-1$
+ public final static String SEQUENCE = ":SEQUENCE="; //$NON-NLS-1$
+
+ public void start() throws ConnectorException {
+ super.start();
+
+ registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("nvl")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("ln")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CEILING, new AliasModifier("ceil")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOG10, new Log10FunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Month"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Day"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.WEEK, new DayWeekQuarterFunctionModifier("WW"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.QUARTER, new DayWeekQuarterFunctionModifier("Q"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new DayWeekQuarterFunctionModifier("D"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new DayWeekQuarterFunctionModifier("DDD"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), "INSTR", true)); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.RIGHT, new LeftOrRightFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new ConcatFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.COT, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ function.setName(SourceSystemFunctions.TAN);
+ return Arrays.asList(getLanguageFactory().createFunction(SourceSystemFunctions.DIVIDE_OP, new Expression[] {new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER), function}, TypeFacility.RUNTIME_TYPES.DOUBLE));
+ }
+ });
+
+ //spatial functions
+ registerFunctionModifier(RELATE, new OracleSpatialFunctionModifier());
+ registerFunctionModifier(NEAREST_NEIGHBOR, new OracleSpatialFunctionModifier());
+ registerFunctionModifier(FILTER, new OracleSpatialFunctionModifier());
+ registerFunctionModifier(WITHIN_DISTANCE, new OracleSpatialFunctionModifier());
+
+ //add in type conversion
+ ConvertModifier convertModifier = new ConvertModifier();
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convertModifier.addTypeMapping("date", FunctionModifier.DATE, FunctionModifier.TIME); //$NON-NLS-1$
+ convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("case when ", function.getParameters().get(0), " is null then null else to_date('1970-01-01 ' || to_char(",function.getParameters().get(0),", 'HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') end"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("trunc(cast(",function.getParameters().get(0)," AS date))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ //if column and type is date, just use date format
+ Expression ex = function.getParameters().get(0);
+ String format = "YYYY-MM-DD HH24:MI:SS.FF"; //$NON-NLS-1$
+ if (ex instanceof ColumnReference) {
+ if ("date".equals(((ColumnReference)ex).getMetadataObject().getNativeType())) { //$NON-NLS-1$
+ format = "YYYY-MM-DD HH24:MI:SS"; //$NON-NLS-1$
+ }
+ } else if (!(ex instanceof Function) && !(ex instanceof Literal)) {
+ //this isn't needed in every case, but it's simpler than inspecting the expression more
+ ex = ConvertModifier.createConvertFunction(getLanguageFactory(), function.getParameters().get(0), TypeFacility.RUNTIME_NAMES.TIMESTAMP);
+ }
+ return Arrays.asList("to_char(", ex, ", '", format, "')"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("to_date", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("to_date", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("to_timestamp", "YYYY-MM-DD HH24:MI:SS.FF")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addTypeConversion(new ConvertModifier.FormatModifier("to_char"), FunctionModifier.STRING); //$NON-NLS-1$
+ //NOTE: numeric handling in Oracle is split only between integral vs. floating/decimal types
+ convertModifier.addTypeConversion(new ConvertModifier.FormatModifier("to_number"), //$NON-NLS-1$
+ FunctionModifier.FLOAT, FunctionModifier.DOUBLE, FunctionModifier.BIGDECIMAL);
+ convertModifier.addTypeConversion(new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ if (Number.class.isAssignableFrom(function.getParameters().get(0).getType())) {
+ return Arrays.asList("trunc(", function.getParameters().get(0), ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return Arrays.asList("trunc(to_number(", function.getParameters().get(0), "))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ },
+ FunctionModifier.BYTE, FunctionModifier.SHORT, FunctionModifier.INTEGER, FunctionModifier.LONG, FunctionModifier.BIGINTEGER);
+ convertModifier.addNumericBooleanConversions();
+ convertModifier.setWideningNumericImplicit(true);
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ public void handleInsertSequences(Insert insert) throws ConnectorException {
+ /*
+ * If a missing auto_increment column is modeled with name in source indicating that an Oracle Sequence
+ * then pull the Sequence name out of the name in source of the column.
+ */
+ if (!(insert.getValueSource() instanceof ExpressionValueSource)) {
+ return;
+ }
+ ExpressionValueSource values = (ExpressionValueSource)insert.getValueSource();
+ List<Column> allElements = insert.getTable().getMetadataObject().getColumns();
+ if (allElements.size() == values.getValues().size()) {
+ return;
+ }
+
+ int index = 0;
+ List<ColumnReference> elements = insert.getColumns();
+
+ for (Column element : allElements) {
+ if (!element.isAutoIncremented()) {
+ continue;
+ }
+ String name = element.getNameInSource();
+ int seqIndex = name.indexOf(SEQUENCE);
+ if (seqIndex == -1) {
+ continue;
+ }
+ boolean found = false;
+ while (index < elements.size()) {
+ if (element.equals(elements.get(index).getMetadataObject())) {
+ found = true;
+ break;
+ }
+ index++;
+ }
+ if (found) {
+ continue;
+ }
+
+ String sequence = name.substring(seqIndex + SEQUENCE.length());
+
+ int delimiterIndex = sequence.indexOf(Tokens.DOT);
+ if (delimiterIndex == -1) {
+ throw new ConnectorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String sequenceGroupName = sequence.substring(0, delimiterIndex);
+ String sequenceElementName = sequence.substring(delimiterIndex + 1);
+
+ NamedTable sequenceGroup = this.getLanguageFactory().createNamedTable(sequenceGroupName, null, null);
+ ColumnReference sequenceElement = this.getLanguageFactory().createColumnReference(sequenceElementName, sequenceGroup, null, element.getJavaType());
+ insert.getColumns().add(index, this.getLanguageFactory().createColumnReference(element.getName(), insert.getTable(), element, element.getJavaType()));
+ values.getValues().add(index, sequenceElement);
+ }
+ }
+
+ @Override
+ public List<?> translateCommand(Command command, ExecutionContext context) {
+ if (command instanceof Insert) {
+ try {
+ handleInsertSequences((Insert)command);
+ } catch (ConnectorException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ if (!(command instanceof QueryExpression)) {
+ return null;
+ }
+ QueryExpression queryCommand = (QueryExpression)command;
+ if (queryCommand.getLimit() == null) {
+ return null;
+ }
+ Limit limit = queryCommand.getLimit();
+ queryCommand.setLimit(null);
+ List<Object> parts = new ArrayList<Object>();
+ parts.add("SELECT "); //$NON-NLS-1$
+ /*
+ * if all of the columns are aliased, assume that names matter - it actually only seems to matter for
+ * the first query of a set op when there is a order by. Rather than adding logic to traverse up,
+ * we just use the projected names
+ */
+ boolean allAliased = true;
+ for (DerivedColumn selectSymbol : queryCommand.getProjectedQuery().getDerivedColumns()) {
+ if (selectSymbol.getAlias() == null) {
+ allAliased = false;
+ break;
+ }
+ }
+ if (allAliased) {
+ String[] columnNames = queryCommand.getColumnNames();
+ for (int i = 0; i < columnNames.length; i++) {
+ if (i > 0) {
+ parts.add(", "); //$NON-NLS-1$
+ }
+ parts.add(columnNames[i]);
+ }
+ } else {
+ parts.add("*"); //$NON-NLS-1$
+ }
+ if (limit.getRowOffset() > 0) {
+ parts.add(" FROM (SELECT VIEW_FOR_LIMIT.*, ROWNUM ROWNUM_ FROM ("); //$NON-NLS-1$
+ } else {
+ parts.add(" FROM ("); //$NON-NLS-1$
+ }
+ parts.add(queryCommand);
+ if (limit.getRowOffset() > 0) {
+ parts.add(") VIEW_FOR_LIMIT WHERE ROWNUM <= "); //$NON-NLS-1$
+ parts.add(limit.getRowLimit() + limit.getRowOffset());
+ parts.add(") WHERE ROWNUM_ > "); //$NON-NLS-1$
+ parts.add(limit.getRowOffset());
+ } else {
+ parts.add(") WHERE ROWNUM <= "); //$NON-NLS-1$
+ parts.add(limit.getRowLimit());
+ }
+ return parts;
+ }
+
+ @Override
+ public boolean useAsInGroupAlias(){
+ return false;
+ }
+
+ @Override
+ public String getSetOperationString(Operation operation) {
+ if (operation == Operation.EXCEPT) {
+ return "MINUS"; //$NON-NLS-1$
+ }
+ return super.getSetOperationString(operation);
+ }
+
+ @Override
+ public String getSourceComment(ExecutionContext context, Command command) {
+ String comment = super.getSourceComment(context, command);
+
+ if (context != null) {
+ // Check for db hints
+ Object payload = context.getExecutionPayload();
+ if (payload instanceof String) {
+ String payloadString = (String)payload;
+ if (payloadString.startsWith(HINT_PREFIX)) {
+ comment += payloadString + " "; //$NON-NLS-1$
+ }
+ }
+ }
+
+ if (command instanceof Select) {
+ //
+ // This simple algorithm determines the hint which will be added to the
+ // query.
+ // Right now, we look through all functions passed in the query
+ // (returned as a collection)
+ // Then we check if any of those functions are sdo_relate
+ // If so, the ORDERED hint is added, if not, it isn't
+ Collection<Function> col = CollectorVisitor.collectObjects(Function.class, command);
+ for (Function func : col) {
+ if (func.getName().equalsIgnoreCase(RELATE)) {
+ return comment + "/*+ ORDERED */ "; //$NON-NLS-1$
+ }
+ }
+ }
+ return comment;
+ }
+
+ /**
+ * Don't fully qualify elements if table = DUAL or element = ROWNUM or special stuff is packed into name in source value.
+ *
+ * @see org.teiid.language.visitor.SQLStringVisitor#skipGroupInElement(java.lang.String, java.lang.String)
+ * @since 5.0
+ */
+ @Override
+ public String replaceElementName(String group, String element) {
+
+ // Check if the element was modeled as using a Sequence
+ int useIndex = element.indexOf(SEQUENCE);
+ if (useIndex >= 0) {
+ String name = element.substring(0, useIndex);
+ if (group != null) {
+ return group + Tokens.DOT + name;
+ }
+ return name;
+ }
+
+ // Check if the group name should be discarded
+ if((group != null && DUAL.equalsIgnoreCase(group)) || element.equalsIgnoreCase(ROWNUM)) {
+ // Strip group if group or element are pseudo-columns
+ return element;
+ }
+
+ return null;
+ }
+
+ @Override
+ public boolean hasTimeType() {
+ return false;
+ }
+
+ @Override
+ public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i) throws SQLException {
+ if(param == null && Object.class.equals(paramType)){
+ //Oracle drive does not support JAVA_OBJECT type
+ stmt.setNull(i, Types.LONGVARBINARY);
+ return;
+ }
+ super.bindValue(stmt, param, paramType, i);
+ }
+
+ @Override
+ public void afterInitialConnectionCreation(Connection connection) {
+ String errorStr = JDBCPlugin.Util.getString("ConnectionListener.failed_to_report_oracle_connection_details"); //$NON-NLS-1$
+ ResultSet rs = null;
+ Statement stmt = null;
+ try {
+ stmt = connection.createStatement();
+ rs = stmt.executeQuery("select * from v$instance"); //$NON-NLS-1$
+
+ int columnCount = rs.getMetaData().getColumnCount();
+ while (rs.next()) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 1; i <= columnCount; i++) {
+ sb.append(rs.getMetaData().getColumnName(i)).append("=").append(rs.getString(i)).append(";"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ // log the queried information
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR, sb.toString());
+ }
+
+ } catch (SQLException e) {
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
+ }finally {
+ try {
+ if (rs != null) {
+ rs.close();
+ }
+ if (stmt != null) {
+ stmt.close();
+ }
+ } catch (SQLException e1) {
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
+ }
+ }
+ }
+
+ @Override
+ public NullOrder getDefaultNullOrder() {
+ return NullOrder.HIGH;
+ }
+
+ @Override
+ public boolean supportsExplicitNullOrdering() {
+ return true;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ supportedFunctions.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("DAY"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ //supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+ //supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+ //supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ //supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+ //supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+ //supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+ supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+
+ supportedFunctions.add(OracleExecutionFactory.RELATE);
+ supportedFunctions.add(OracleExecutionFactory.NEAREST_NEIGHBOR);
+ supportedFunctions.add(OracleExecutionFactory.FILTER);
+ supportedFunctions.add(OracleExecutionFactory.NEAREST_NEIGHBOR_DISTANCE);
+ supportedFunctions.add(OracleExecutionFactory.WITHIN_DISTANCE);
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
+ * @since 5.0
+ */
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
+ */
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
+ */
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,439 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.oracle;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Types;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Command;
-import org.teiid.language.DerivedColumn;
-import org.teiid.language.Expression;
-import org.teiid.language.ExpressionValueSource;
-import org.teiid.language.Function;
-import org.teiid.language.Insert;
-import org.teiid.language.Limit;
-import org.teiid.language.Literal;
-import org.teiid.language.NamedTable;
-import org.teiid.language.QueryExpression;
-import org.teiid.language.Select;
-import org.teiid.language.SQLReservedWords.Tokens;
-import org.teiid.language.SetQuery.Operation;
-import org.teiid.language.visitor.CollectorVisitor;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.Column;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.ExtractFunctionModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.JDBCPlugin;
-import org.teiid.translator.jdbc.LocateFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-
-
-
-public class OracleSQLTranslator extends Translator {
-
- /*
- * Spatial Functions
- */
- public static final String RELATE = "sdo_relate"; //$NON-NLS-1$
- public static final String NEAREST_NEIGHBOR = "sdo_nn"; //$NON-NLS-1$
- public static final String FILTER = "sdo_filter"; //$NON-NLS-1$
- public static final String WITHIN_DISTANCE = "sdo_within_distance"; //$NON-NLS-1$
- public static final String NEAREST_NEIGHBOR_DISTANCE = "sdo_nn_distance"; //$NON-NLS-1$
-
- public final static String HINT_PREFIX = "/*+"; //$NON-NLS-1$
- public final static String DUAL = "DUAL"; //$NON-NLS-1$
- public final static String ROWNUM = "ROWNUM"; //$NON-NLS-1$
- public final static String SEQUENCE = ":SEQUENCE="; //$NON-NLS-1$
-
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("nvl")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("ln")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CEILING, new AliasModifier("ceil")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOG10, new Log10FunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Month"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Day"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.WEEK, new DayWeekQuarterFunctionModifier("WW"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.QUARTER, new DayWeekQuarterFunctionModifier("Q"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new DayWeekQuarterFunctionModifier("D"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new DayWeekQuarterFunctionModifier("DDD"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), "INSTR", true)); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.RIGHT, new LeftOrRightFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new ConcatFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.COT, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- function.setName(SourceSystemFunctions.TAN);
- return Arrays.asList(getLanguageFactory().createFunction(SourceSystemFunctions.DIVIDE_OP, new Expression[] {new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER), function}, TypeFacility.RUNTIME_TYPES.DOUBLE));
- }
- });
-
- //spatial functions
- registerFunctionModifier(RELATE, new OracleSpatialFunctionModifier());
- registerFunctionModifier(NEAREST_NEIGHBOR, new OracleSpatialFunctionModifier());
- registerFunctionModifier(FILTER, new OracleSpatialFunctionModifier());
- registerFunctionModifier(WITHIN_DISTANCE, new OracleSpatialFunctionModifier());
-
- //add in type conversion
- ConvertModifier convertModifier = new ConvertModifier();
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convertModifier.addTypeMapping("date", FunctionModifier.DATE, FunctionModifier.TIME); //$NON-NLS-1$
- convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("case when ", function.getParameters().get(0), " is null then null else to_date('1970-01-01 ' || to_char(",function.getParameters().get(0),", 'HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') end"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- });
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("trunc(cast(",function.getParameters().get(0)," AS date))"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- //if column and type is date, just use date format
- Expression ex = function.getParameters().get(0);
- String format = "YYYY-MM-DD HH24:MI:SS.FF"; //$NON-NLS-1$
- if (ex instanceof ColumnReference) {
- if ("date".equals(((ColumnReference)ex).getMetadataObject().getNativeType())) { //$NON-NLS-1$
- format = "YYYY-MM-DD HH24:MI:SS"; //$NON-NLS-1$
- }
- } else if (!(ex instanceof Function) && !(ex instanceof Literal)) {
- //this isn't needed in every case, but it's simpler than inspecting the expression more
- ex = ConvertModifier.createConvertFunction(getLanguageFactory(), function.getParameters().get(0), TypeFacility.RUNTIME_NAMES.TIMESTAMP);
- }
- return Arrays.asList("to_char(", ex, ", '", format, "')"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- });
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("to_date", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("to_date", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("to_timestamp", "YYYY-MM-DD HH24:MI:SS.FF")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addTypeConversion(new ConvertModifier.FormatModifier("to_char"), FunctionModifier.STRING); //$NON-NLS-1$
- //NOTE: numeric handling in Oracle is split only between integral vs. floating/decimal types
- convertModifier.addTypeConversion(new ConvertModifier.FormatModifier("to_number"), //$NON-NLS-1$
- FunctionModifier.FLOAT, FunctionModifier.DOUBLE, FunctionModifier.BIGDECIMAL);
- convertModifier.addTypeConversion(new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- if (Number.class.isAssignableFrom(function.getParameters().get(0).getType())) {
- return Arrays.asList("trunc(", function.getParameters().get(0), ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return Arrays.asList("trunc(to_number(", function.getParameters().get(0), "))"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- },
- FunctionModifier.BYTE, FunctionModifier.SHORT, FunctionModifier.INTEGER, FunctionModifier.LONG, FunctionModifier.BIGINTEGER);
- convertModifier.addNumericBooleanConversions();
- convertModifier.setWideningNumericImplicit(true);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- public void handleInsertSequences(Insert insert) throws ConnectorException {
- /*
- * If a missing auto_increment column is modeled with name in source indicating that an Oracle Sequence
- * then pull the Sequence name out of the name in source of the column.
- */
- if (!(insert.getValueSource() instanceof ExpressionValueSource)) {
- return;
- }
- ExpressionValueSource values = (ExpressionValueSource)insert.getValueSource();
- List<Column> allElements = insert.getTable().getMetadataObject().getColumns();
- if (allElements.size() == values.getValues().size()) {
- return;
- }
-
- int index = 0;
- List<ColumnReference> elements = insert.getColumns();
-
- for (Column element : allElements) {
- if (!element.isAutoIncremented()) {
- continue;
- }
- String name = element.getNameInSource();
- int seqIndex = name.indexOf(SEQUENCE);
- if (seqIndex == -1) {
- continue;
- }
- boolean found = false;
- while (index < elements.size()) {
- if (element.equals(elements.get(index).getMetadataObject())) {
- found = true;
- break;
- }
- index++;
- }
- if (found) {
- continue;
- }
-
- String sequence = name.substring(seqIndex + SEQUENCE.length());
-
- int delimiterIndex = sequence.indexOf(Tokens.DOT);
- if (delimiterIndex == -1) {
- throw new ConnectorException("Invalid name in source sequence format. Expected <element name>" + SEQUENCE + "<sequence name>.<sequence value>, but was " + name); //$NON-NLS-1$ //$NON-NLS-2$
- }
- String sequenceGroupName = sequence.substring(0, delimiterIndex);
- String sequenceElementName = sequence.substring(delimiterIndex + 1);
-
- NamedTable sequenceGroup = this.getLanguageFactory().createNamedTable(sequenceGroupName, null, null);
- ColumnReference sequenceElement = this.getLanguageFactory().createColumnReference(sequenceElementName, sequenceGroup, null, element.getJavaType());
- insert.getColumns().add(index, this.getLanguageFactory().createColumnReference(element.getName(), insert.getTable(), element, element.getJavaType()));
- values.getValues().add(index, sequenceElement);
- }
- }
-
- @Override
- public List<?> translateCommand(Command command, ExecutionContext context) {
- if (command instanceof Insert) {
- try {
- handleInsertSequences((Insert)command);
- } catch (ConnectorException e) {
- throw new RuntimeException(e);
- }
- }
-
- if (!(command instanceof QueryExpression)) {
- return null;
- }
- QueryExpression queryCommand = (QueryExpression)command;
- if (queryCommand.getLimit() == null) {
- return null;
- }
- Limit limit = queryCommand.getLimit();
- queryCommand.setLimit(null);
- List<Object> parts = new ArrayList<Object>();
- parts.add("SELECT "); //$NON-NLS-1$
- /*
- * if all of the columns are aliased, assume that names matter - it actually only seems to matter for
- * the first query of a set op when there is a order by. Rather than adding logic to traverse up,
- * we just use the projected names
- */
- boolean allAliased = true;
- for (DerivedColumn selectSymbol : queryCommand.getProjectedQuery().getDerivedColumns()) {
- if (selectSymbol.getAlias() == null) {
- allAliased = false;
- break;
- }
- }
- if (allAliased) {
- String[] columnNames = queryCommand.getColumnNames();
- for (int i = 0; i < columnNames.length; i++) {
- if (i > 0) {
- parts.add(", "); //$NON-NLS-1$
- }
- parts.add(columnNames[i]);
- }
- } else {
- parts.add("*"); //$NON-NLS-1$
- }
- if (limit.getRowOffset() > 0) {
- parts.add(" FROM (SELECT VIEW_FOR_LIMIT.*, ROWNUM ROWNUM_ FROM ("); //$NON-NLS-1$
- } else {
- parts.add(" FROM ("); //$NON-NLS-1$
- }
- parts.add(queryCommand);
- if (limit.getRowOffset() > 0) {
- parts.add(") VIEW_FOR_LIMIT WHERE ROWNUM <= "); //$NON-NLS-1$
- parts.add(limit.getRowLimit() + limit.getRowOffset());
- parts.add(") WHERE ROWNUM_ > "); //$NON-NLS-1$
- parts.add(limit.getRowOffset());
- } else {
- parts.add(") WHERE ROWNUM <= "); //$NON-NLS-1$
- parts.add(limit.getRowLimit());
- }
- return parts;
- }
-
- @Override
- public boolean useAsInGroupAlias(){
- return false;
- }
-
- @Override
- public String getSetOperationString(Operation operation) {
- if (operation == Operation.EXCEPT) {
- return "MINUS"; //$NON-NLS-1$
- }
- return super.getSetOperationString(operation);
- }
-
- @Override
- public String getSourceComment(ExecutionContext context, Command command) {
- String comment = super.getSourceComment(context, command);
-
- if (context != null) {
- // Check for db hints
- Object payload = context.getExecutionPayload();
- if (payload instanceof String) {
- String payloadString = (String)payload;
- if (payloadString.startsWith(HINT_PREFIX)) {
- comment += payloadString + " "; //$NON-NLS-1$
- }
- }
- }
-
- if (command instanceof Select) {
- //
- // This simple algorithm determines the hint which will be added to the
- // query.
- // Right now, we look through all functions passed in the query
- // (returned as a collection)
- // Then we check if any of those functions are sdo_relate
- // If so, the ORDERED hint is added, if not, it isn't
- Collection<Function> col = CollectorVisitor.collectObjects(Function.class, command);
- for (Function func : col) {
- if (func.getName().equalsIgnoreCase(RELATE)) {
- return comment + "/*+ ORDERED */ "; //$NON-NLS-1$
- }
- }
- }
- return comment;
- }
-
- /**
- * Don't fully qualify elements if table = DUAL or element = ROWNUM or special stuff is packed into name in source value.
- *
- * @see org.teiid.language.visitor.SQLStringVisitor#skipGroupInElement(java.lang.String, java.lang.String)
- * @since 5.0
- */
- @Override
- public String replaceElementName(String group, String element) {
-
- // Check if the element was modeled as using a Sequence
- int useIndex = element.indexOf(SEQUENCE);
- if (useIndex >= 0) {
- String name = element.substring(0, useIndex);
- if (group != null) {
- return group + Tokens.DOT + name;
- }
- return name;
- }
-
- // Check if the group name should be discarded
- if((group != null && DUAL.equalsIgnoreCase(group)) || element.equalsIgnoreCase(ROWNUM)) {
- // Strip group if group or element are pseudo-columns
- return element;
- }
-
- return null;
- }
-
- @Override
- public boolean hasTimeType() {
- return false;
- }
-
- @Override
- public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType, int i) throws SQLException {
- if(param == null && Object.class.equals(paramType)){
- //Oracle drive does not support JAVA_OBJECT type
- stmt.setNull(i, Types.LONGVARBINARY);
- return;
- }
- super.bindValue(stmt, param, paramType, i);
- }
-
- @Override
- public void afterInitialConnectionCreation(Connection connection) {
- String errorStr = JDBCPlugin.Util.getString("ConnectionListener.failed_to_report_oracle_connection_details"); //$NON-NLS-1$
- ResultSet rs = null;
- Statement stmt = null;
- try {
- stmt = connection.createStatement();
- rs = stmt.executeQuery("select * from v$instance"); //$NON-NLS-1$
-
- int columnCount = rs.getMetaData().getColumnCount();
- while (rs.next()) {
- StringBuffer sb = new StringBuffer();
- for (int i = 1; i <= columnCount; i++) {
- sb.append(rs.getMetaData().getColumnName(i)).append("=").append(rs.getString(i)).append(";"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // log the queried information
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, sb.toString());
- }
-
- } catch (SQLException e) {
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
- }finally {
- try {
- if (rs != null) {
- rs.close();
- }
- if (stmt != null) {
- stmt.close();
- }
- } catch (SQLException e1) {
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
- }
- }
- }
-
- @Override
- public NullOrder getDefaultNullOrder() {
- return NullOrder.HIGH;
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return OracleCapabilities.class;
- }
-
- public boolean supportsExplicitNullOrdering() {
- return true;
- }
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/SequeLinkOracleCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/SequeLinkOracleCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/SequeLinkOracleCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.oracle;
-
-
-
-/**
- * @since 5.0
- */
-public class SequeLinkOracleCapabilities extends OracleCapabilities {
-
- @Override
- public boolean supportsBulkUpdate() {
- return false;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,284 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.postgresql;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-
-/**
- * @since 4.3
- */
-public class PostgreSQLCapabilities extends JDBCCapabilities {
-
- public static final String EIGHT_0 = "8.0"; //$NON-NLS-1$
- public static final String EIGHT_1 = "8.1"; //$NON-NLS-1$
- public static final String EIGHT_2 = "8.2"; //$NON-NLS-1$
- public static final String EIGHT_3 = "8.3"; //$NON-NLS-1$
- public static final String EIGHT_4 = "8.4"; //$NON-NLS-1$
-
- private String version = EIGHT_0;
-
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("BITAND"); //$NON-NLS-1$
- supportedFunctions.add("BITNOT"); //$NON-NLS-1$
- supportedFunctions.add("BITOR"); //$NON-NLS-1$
- supportedFunctions.add("BITXOR"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("ROUND"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
-
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
-
- // These are executed within the server and never pushed down
-// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
-// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
-// supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
-// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- // These should not be pushed down since the grammar for string conversion is different
-// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
-// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- if (this.version.compareTo(EIGHT_2) >= 0) {
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- }
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
-
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
-
- // Additional functions
-// // Math
-// supportedFunctions.add("%"); //$NON-NLS-1$
-// supportedFunctions.add("^"); //$NON-NLS-1$
-// supportedFunctions.add("|/"); //$NON-NLS-1$
-// supportedFunctions.add("||/"); //$NON-NLS-1$
-// supportedFunctions.add("!"); //$NON-NLS-1$
-// supportedFunctions.add("!!"); //$NON-NLS-1$
-// supportedFunctions.add("@"); //$NON-NLS-1$
-// // Bit manipulation
-// supportedFunctions.add("&"); //$NON-NLS-1$
-// supportedFunctions.add("|"); //$NON-NLS-1$
-// supportedFunctions.add("#"); //$NON-NLS-1$
-// supportedFunctions.add("~"); //$NON-NLS-1$
-// supportedFunctions.add("<<"); //$NON-NLS-1$
-// supportedFunctions.add(">>"); //$NON-NLS-1$
-//
-// supportedFunctions.add("CBRT"); //$NON-NLS-1$
-// supportedFunctions.add("CEIL"); //$NON-NLS-1$
-// supportedFunctions.add("LN"); //$NON-NLS-1$
-// supportedFunctions.add("MOD"); //$NON-NLS-1$
-// supportedFunctions.add("RANDOM"); //$NON-NLS-1$
-// supportedFunctions.add("SETSEED"); //$NON-NLS-1$
-// supportedFunctions.add("TRUNC"); //$NON-NLS-1$
-// supportedFunctions.add("WIDTH_BUCKET"); //$NON-NLS-1$
-//
-// // String
-// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("BTRIM"); //$NON-NLS-1$
-// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("DECODE"); //$NON-NLS-1$
-// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
-// supportedFunctions.add("MD5"); //$NON-NLS-1$
-// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
-// supportedFunctions.add("PG_CLIENT_ENCODING"); //$NON-NLS-1$
-// supportedFunctions.add("QUOTE_IDENT"); //$NON-NLS-1$
-// supportedFunctions.add("QUOTE_LITERAL"); //$NON-NLS-1$
-// supportedFunctions.add("SPLIT_PART"); //$NON-NLS-1$
-// supportedFunctions.add("STRPOS"); //$NON-NLS-1$
-// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
-// supportedFunctions.add("TO_ASCII"); //$NON-NLS-1$
-// supportedFunctions.add("TO_HEX"); //$NON-NLS-1$
-// supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
-//
-// // Bit operations
-// supportedFunctions.add("GET_BIT"); //$NON-NLS-1$
-// supportedFunctions.add("GET_BYTE"); //$NON-NLS-1$
-// supportedFunctions.add("SET_BIT"); //$NON-NLS-1$
-// supportedFunctions.add("SET_BYTE"); //$NON-NLS-1$
-//
-// // Formatting
-// supportedFunctions.add("TO_CHAR"); //$NON-NLS-1$
-// supportedFunctions.add("TO_DATE"); //$NON-NLS-1$
-// supportedFunctions.add("TO_TIMESTAMP"); //$NON-NLS-1$
-// supportedFunctions.add("TO_NUMBER"); //$NON-NLS-1$
-//
-// // Date / Time
-// supportedFunctions.add("AGE"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("DATE_PART"); //$NON-NLS-1$
-// supportedFunctions.add("DATE_TRUNC"); //$NON-NLS-1$
-// supportedFunctions.add("ISFINITE"); //$NON-NLS-1$
-// supportedFunctions.add("JUSTIFY_HOURS"); //$NON-NLS-1$
-// supportedFunctions.add("JUSTIFY_DAYS"); //$NON-NLS-1$
-// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("TIMEOFDAY"); //$NON-NLS-1$
-//
-// // Conditional
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
-// supportedFunctions.add("NULLIF"); //$NON-NLS-1$
-// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
-// supportedFunctions.add("LEAST"); //$NON-NLS-1$
-//
-// // Network Addresses
-//// supportedFunctions.add("BROADCAST"); //$NON-NLS-1$
-//// supportedFunctions.add("HOST"); //$NON-NLS-1$
-//// supportedFunctions.add("MASKLEN"); //$NON-NLS-1$
-//// supportedFunctions.add("SET_MASKLEN"); //$NON-NLS-1$
-//// supportedFunctions.add("NETMASK"); //$NON-NLS-1$
-//// supportedFunctions.add("HOSTMASK"); //$NON-NLS-1$
-//// supportedFunctions.add("NETWORK"); //$NON-NLS-1$
-//// supportedFunctions.add("TEXT"); //$NON-NLS-1$
-//// supportedFunctions.add("ABBREV"); //$NON-NLS-1$
-//// supportedFunctions.add("FAMILY"); //$NON-NLS-1$
-//// supportedFunctions.add("TRUNC"); //$NON-NLS-1$
-//
-// // Set generator
-// supportedFunctions.add("GENERATE_SERIES"); //$NON-NLS-1$
-//
-// // Information
-// supportedFunctions.add("CURRENT_DATABASE"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_SCHEMA"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_SCHEMAS"); //$NON-NLS-1$
-// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("INET_CLIENT_ADDR"); //$NON-NLS-1$
-// supportedFunctions.add("INET_CLIENT_PORT"); //$NON-NLS-1$
-// supportedFunctions.add("INET_SERVER_ADDR"); //$NON-NLS-1$
-// supportedFunctions.add("INET_SERVER_PORT"); //$NON-NLS-1$
-// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("USER"); //$NON-NLS-1$ // no ()
-// supportedFunctions.add("VERSION"); //$NON-NLS-1$
-//
- return supportedFunctions;
- }
-
- /**
- * This is true only after Postgre version 7.1
- * However, since version 7 was released in 2000 we'll assume a post 7 instance.
- *
- * @see org.teiid.translator.jdbc.JDBCCapabilities#supportsInlineViews()
- */
- public boolean supportsInlineViews() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
- public boolean supportsRowOffset() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
- */
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
- */
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
- public void setDatabaseVersion(String version) {
- this.version = version;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,473 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.postgresql;
+
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.AggregateFunction;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageObject;
+import org.teiid.language.Limit;
+import org.teiid.language.Literal;
+import org.teiid.language.SQLReservedWords;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.TranslatorProperty;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.EscapeSyntaxModifier;
+import org.teiid.translator.jdbc.ExtractFunctionModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.ModFunctionModifier;
+import org.teiid.translator.jdbc.oracle.LeftOrRightFunctionModifier;
+import org.teiid.translator.jdbc.oracle.MonthOrDayNameFunctionModifier;
+
+
+
+/**
+ * Translator class for PostgreSQL. Updated to expect a 8.0+ jdbc client
+ * @since 4.3
+ */
+public class PostgreSQLExecutionFactory extends JDBCExecutionFactory {
+
+ public static final String EIGHT_0 = "8.0"; //$NON-NLS-1$
+ public static final String EIGHT_1 = "8.1"; //$NON-NLS-1$
+ public static final String EIGHT_2 = "8.2"; //$NON-NLS-1$
+ public static final String EIGHT_3 = "8.3"; //$NON-NLS-1$
+ public static final String EIGHT_4 = "8.4"; //$NON-NLS-1$
+
+ private String version = EIGHT_0;
+
+ public void start() throws ConnectorException {
+ //TODO: all of the functions (except for convert) can be handled through just the escape syntax
+ super.start();
+
+ registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("ln")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOG10, new AliasModifier("log")); //$NON-NLS-1$
+
+ registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("&")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("~")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("|")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("#")); //$NON-NLS-1$
+
+ registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("||")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.RIGHT, new LeftOrRightFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
+
+ registerFunctionModifier(SourceSystemFunctions.DAYNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Day"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Month"));//$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.QUARTER, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.WEEK, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
+
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory(), Arrays.asList(TypeFacility.RUNTIME_TYPES.BIG_INTEGER, TypeFacility.RUNTIME_TYPES.BIG_DECIMAL))); //$NON-NLS-1$
+
+ //specific to 8.2 client or later
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
+
+ //add in type conversion
+ ConvertModifier convertModifier = new ConvertModifier();
+ convertModifier.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
+ convertModifier.addTypeMapping("smallint", FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("integer", FunctionModifier.INTEGER); //$NON-NLS-1$
+ convertModifier.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
+ convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("float8", FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(38)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convertModifier.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convertModifier.addTypeMapping("varchar(4000)", FunctionModifier.STRING); //$NON-NLS-1$
+ convertModifier.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
+ convertModifier.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
+ convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList(function.getParameters().get(0), " + TIMESTAMP '1970-01-01'"); //$NON-NLS-1$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(date_trunc('second', ", function.getParameters().get(0), ") AS time)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD HH24:MI:SS.UF")); //$NON-NLS-1$ //$NON-NLS-2$
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ Expression stringValue = function.getParameters().get(0);
+ return Arrays.asList("CASE WHEN ", stringValue, " THEN 'true' WHEN not(", stringValue, ") THEN 'false' END"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ });
+ convertModifier.addSourceConversion(new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ ((Literal)function.getParameters().get(1)).setValue("integer"); //$NON-NLS-1$
+ return null;
+ }
+ }, FunctionModifier.BOOLEAN);
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ @Override
+ public String translateLiteralBoolean(Boolean booleanValue) {
+ if(booleanValue.booleanValue()) {
+ return "TRUE"; //$NON-NLS-1$
+ }
+ return "FALSE"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public int getTimestampNanoPrecision() {
+ return 6;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ if (limit.getRowOffset() > 0) {
+ return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return null;
+ }
+
+ /**
+ * Postgres doesn't provide min/max(boolean), so this conversion writes a min(BooleanValue) as
+ * bool_and(BooleanValue)
+ * @see org.teiid.language.visitor.LanguageObjectVisitor#visit(org.teiid.language.AggregateFunction)
+ * @since 4.3
+ */
+ @Override
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ if (obj instanceof AggregateFunction) {
+ AggregateFunction agg = (AggregateFunction)obj;
+ if (agg.getExpression() != null && TypeFacility.RUNTIME_TYPES.BOOLEAN.equals(agg.getExpression().getType())) {
+ if (agg.getName().equalsIgnoreCase(SQLReservedWords.MIN)) {
+ agg.setName("bool_and"); //$NON-NLS-1$
+ } else if (agg.getName().equalsIgnoreCase(SQLReservedWords.MAX)) {
+ agg.setName("bool_or"); //$NON-NLS-1$
+ }
+ }
+ }
+ return super.translate(obj, context);
+ }
+
+ @Override
+ public NullOrder getDefaultNullOrder() {
+ return NullOrder.HIGH;
+ }
+
+ @Override
+ public boolean supportsExplicitNullOrdering() {
+ return version.compareTo(EIGHT_4) >= 0;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("BITAND"); //$NON-NLS-1$
+ supportedFunctions.add("BITNOT"); //$NON-NLS-1$
+ supportedFunctions.add("BITOR"); //$NON-NLS-1$
+ supportedFunctions.add("BITXOR"); //$NON-NLS-1$
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("ROUND"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+
+ // These are executed within the server and never pushed down
+// supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+// supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+// supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+// supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ // These should not be pushed down since the grammar for string conversion is different
+// supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+// supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ if (this.version.compareTo(EIGHT_2) >= 0) {
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ }
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+
+ // Additional functions
+// // Math
+// supportedFunctions.add("%"); //$NON-NLS-1$
+// supportedFunctions.add("^"); //$NON-NLS-1$
+// supportedFunctions.add("|/"); //$NON-NLS-1$
+// supportedFunctions.add("||/"); //$NON-NLS-1$
+// supportedFunctions.add("!"); //$NON-NLS-1$
+// supportedFunctions.add("!!"); //$NON-NLS-1$
+// supportedFunctions.add("@"); //$NON-NLS-1$
+// // Bit manipulation
+// supportedFunctions.add("&"); //$NON-NLS-1$
+// supportedFunctions.add("|"); //$NON-NLS-1$
+// supportedFunctions.add("#"); //$NON-NLS-1$
+// supportedFunctions.add("~"); //$NON-NLS-1$
+// supportedFunctions.add("<<"); //$NON-NLS-1$
+// supportedFunctions.add(">>"); //$NON-NLS-1$
+//
+// supportedFunctions.add("CBRT"); //$NON-NLS-1$
+// supportedFunctions.add("CEIL"); //$NON-NLS-1$
+// supportedFunctions.add("LN"); //$NON-NLS-1$
+// supportedFunctions.add("MOD"); //$NON-NLS-1$
+// supportedFunctions.add("RANDOM"); //$NON-NLS-1$
+// supportedFunctions.add("SETSEED"); //$NON-NLS-1$
+// supportedFunctions.add("TRUNC"); //$NON-NLS-1$
+// supportedFunctions.add("WIDTH_BUCKET"); //$NON-NLS-1$
+//
+// // String
+// supportedFunctions.add("BIT_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("BTRIM"); //$NON-NLS-1$
+// supportedFunctions.add("CHAR_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("CHARACTER_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("DECODE"); //$NON-NLS-1$
+// supportedFunctions.add("ENCODE"); //$NON-NLS-1$
+// supportedFunctions.add("MD5"); //$NON-NLS-1$
+// supportedFunctions.add("OCTET_LENGTH"); //$NON-NLS-1$
+// supportedFunctions.add("PG_CLIENT_ENCODING"); //$NON-NLS-1$
+// supportedFunctions.add("QUOTE_IDENT"); //$NON-NLS-1$
+// supportedFunctions.add("QUOTE_LITERAL"); //$NON-NLS-1$
+// supportedFunctions.add("SPLIT_PART"); //$NON-NLS-1$
+// supportedFunctions.add("STRPOS"); //$NON-NLS-1$
+// supportedFunctions.add("SUBSTR"); //$NON-NLS-1$
+// supportedFunctions.add("TO_ASCII"); //$NON-NLS-1$
+// supportedFunctions.add("TO_HEX"); //$NON-NLS-1$
+// supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
+//
+// // Bit operations
+// supportedFunctions.add("GET_BIT"); //$NON-NLS-1$
+// supportedFunctions.add("GET_BYTE"); //$NON-NLS-1$
+// supportedFunctions.add("SET_BIT"); //$NON-NLS-1$
+// supportedFunctions.add("SET_BYTE"); //$NON-NLS-1$
+//
+// // Formatting
+// supportedFunctions.add("TO_CHAR"); //$NON-NLS-1$
+// supportedFunctions.add("TO_DATE"); //$NON-NLS-1$
+// supportedFunctions.add("TO_TIMESTAMP"); //$NON-NLS-1$
+// supportedFunctions.add("TO_NUMBER"); //$NON-NLS-1$
+//
+// // Date / Time
+// supportedFunctions.add("AGE"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_DATE"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("CURRENT_TIME"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("CURRENT_TIMESTAMP"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("DATE_PART"); //$NON-NLS-1$
+// supportedFunctions.add("DATE_TRUNC"); //$NON-NLS-1$
+// supportedFunctions.add("ISFINITE"); //$NON-NLS-1$
+// supportedFunctions.add("JUSTIFY_HOURS"); //$NON-NLS-1$
+// supportedFunctions.add("JUSTIFY_DAYS"); //$NON-NLS-1$
+// supportedFunctions.add("LOCALTIME"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("LOCALTIMESTAMP"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("TIMEOFDAY"); //$NON-NLS-1$
+//
+// // Conditional
+ supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+// supportedFunctions.add("NULLIF"); //$NON-NLS-1$
+// supportedFunctions.add("GREATEST"); //$NON-NLS-1$
+// supportedFunctions.add("LEAST"); //$NON-NLS-1$
+//
+// // Network Addresses
+//// supportedFunctions.add("BROADCAST"); //$NON-NLS-1$
+//// supportedFunctions.add("HOST"); //$NON-NLS-1$
+//// supportedFunctions.add("MASKLEN"); //$NON-NLS-1$
+//// supportedFunctions.add("SET_MASKLEN"); //$NON-NLS-1$
+//// supportedFunctions.add("NETMASK"); //$NON-NLS-1$
+//// supportedFunctions.add("HOSTMASK"); //$NON-NLS-1$
+//// supportedFunctions.add("NETWORK"); //$NON-NLS-1$
+//// supportedFunctions.add("TEXT"); //$NON-NLS-1$
+//// supportedFunctions.add("ABBREV"); //$NON-NLS-1$
+//// supportedFunctions.add("FAMILY"); //$NON-NLS-1$
+//// supportedFunctions.add("TRUNC"); //$NON-NLS-1$
+//
+// // Set generator
+// supportedFunctions.add("GENERATE_SERIES"); //$NON-NLS-1$
+//
+// // Information
+// supportedFunctions.add("CURRENT_DATABASE"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_SCHEMA"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_SCHEMAS"); //$NON-NLS-1$
+// supportedFunctions.add("CURRENT_USER"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("INET_CLIENT_ADDR"); //$NON-NLS-1$
+// supportedFunctions.add("INET_CLIENT_PORT"); //$NON-NLS-1$
+// supportedFunctions.add("INET_SERVER_ADDR"); //$NON-NLS-1$
+// supportedFunctions.add("INET_SERVER_PORT"); //$NON-NLS-1$
+// supportedFunctions.add("SESSION_USER"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("USER"); //$NON-NLS-1$ // no ()
+// supportedFunctions.add("VERSION"); //$NON-NLS-1$
+//
+ return supportedFunctions;
+ }
+
+ /**
+ * This is true only after Postgre version 7.1
+ * However, since version 7 was released in 2000 we'll assume a post 7 instance.
+ *
+ * @see org.teiid.translator.jdbc.JDBCCapabilities#supportsInlineViews()
+ */
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.translator.BasicConnectorCapabilities#supportsExcept()
+ */
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ /**
+ * @see org.teiid.translator.BasicConnectorCapabilities#supportsIntersect()
+ */
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+
+ @TranslatorProperty(name="DatabaseVersion", description= "Version of the postgres", defaultValue=EIGHT_0)
+ public String getDatabaseVersion() {
+ return this.version;
+ }
+
+ public void setDatabaseVersion(String version) {
+ this.version = version;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,224 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.postgresql;
-
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.AggregateFunction;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageObject;
-import org.teiid.language.Limit;
-import org.teiid.language.Literal;
-import org.teiid.language.SQLReservedWords;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.EscapeSyntaxModifier;
-import org.teiid.translator.jdbc.ExtractFunctionModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.oracle.LeftOrRightFunctionModifier;
-import org.teiid.translator.jdbc.oracle.MonthOrDayNameFunctionModifier;
-
-
-
-/**
- * Translator class for PostgreSQL. Updated to expect a 8.0+ jdbc client
- * @since 4.3
- */
-public class PostgreSQLTranslator extends Translator {
-
- private String version = PostgreSQLCapabilities.EIGHT_0;
-
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- //TODO: all of the functions (except for convert) can be handled through just the escape syntax
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("ln")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LOG10, new AliasModifier("log")); //$NON-NLS-1$
-
- registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("&")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("~")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("|")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("#")); //$NON-NLS-1$
-
- registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("||")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.RIGHT, new LeftOrRightFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new AliasModifier("substr")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
-
- registerFunctionModifier(SourceSystemFunctions.DAYNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Day"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new MonthOrDayNameFunctionModifier(getLanguageFactory(), "Month"));//$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.QUARTER, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.WEEK, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("coalesce")); //$NON-NLS-1$
-
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory(), Arrays.asList(TypeFacility.RUNTIME_TYPES.BIG_INTEGER, TypeFacility.RUNTIME_TYPES.BIG_DECIMAL))); //$NON-NLS-1$
-
- //specific to 8.2 client or later
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
-
- //add in type conversion
- ConvertModifier convertModifier = new ConvertModifier();
- convertModifier.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
- convertModifier.addTypeMapping("smallint", FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
- convertModifier.addTypeMapping("integer", FunctionModifier.INTEGER); //$NON-NLS-1$
- convertModifier.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
- convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
- convertModifier.addTypeMapping("float8", FunctionModifier.DOUBLE); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(38)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
- convertModifier.addTypeMapping("decimal", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convertModifier.addTypeMapping("varchar(4000)", FunctionModifier.STRING); //$NON-NLS-1$
- convertModifier.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
- convertModifier.addTypeMapping("time", FunctionModifier.TIME); //$NON-NLS-1$
- convertModifier.addTypeMapping("timestamp", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList(function.getParameters().get(0), " + TIMESTAMP '1970-01-01'"); //$NON-NLS-1$
- }
- });
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("cast(date_trunc('second', ", function.getParameters().get(0), ") AS time)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "HH24:MI:SS")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", "YYYY-MM-DD HH24:MI:SS.UF")); //$NON-NLS-1$ //$NON-NLS-2$
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.STRING, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- Expression stringValue = function.getParameters().get(0);
- return Arrays.asList("CASE WHEN ", stringValue, " THEN 'true' WHEN not(", stringValue, ") THEN 'false' END"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- });
- convertModifier.addSourceConversion(new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- ((Literal)function.getParameters().get(1)).setValue("integer"); //$NON-NLS-1$
- return null;
- }
- }, FunctionModifier.BOOLEAN);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- @Override
- public String translateLiteralBoolean(Boolean booleanValue) {
- if(booleanValue.booleanValue()) {
- return "TRUE"; //$NON-NLS-1$
- }
- return "FALSE"; //$NON-NLS-1$
- }
-
- @Override
- public String translateLiteralDate(Date dateValue) {
- return "DATE '" + formatDateValue(dateValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTime(Time timeValue) {
- return "TIME '" + formatDateValue(timeValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public String translateLiteralTimestamp(Timestamp timestampValue) {
- return "TIMESTAMP '" + formatDateValue(timestampValue) + "'"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- @Override
- public int getTimestampNanoPrecision() {
- return 6;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- if (limit.getRowOffset() > 0) {
- return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return null;
- }
-
- /**
- * Postgres doesn't provide min/max(boolean), so this conversion writes a min(BooleanValue) as
- * bool_and(BooleanValue)
- * @see org.teiid.language.visitor.LanguageObjectVisitor#visit(org.teiid.language.AggregateFunction)
- * @since 4.3
- */
- @Override
- public List<?> translate(LanguageObject obj, ExecutionContext context) {
- if (obj instanceof AggregateFunction) {
- AggregateFunction agg = (AggregateFunction)obj;
- if (agg.getExpression() != null && TypeFacility.RUNTIME_TYPES.BOOLEAN.equals(agg.getExpression().getType())) {
- if (agg.getName().equalsIgnoreCase(SQLReservedWords.MIN)) {
- agg.setName("bool_and"); //$NON-NLS-1$
- } else if (agg.getName().equalsIgnoreCase(SQLReservedWords.MAX)) {
- agg.setName("bool_or"); //$NON-NLS-1$
- }
- }
- }
- return super.translate(obj, context);
- }
-
- @Override
- public NullOrder getDefaultNullOrder() {
- return NullOrder.HIGH;
- }
-
- @Override
- public boolean supportsExplicitNullOrdering() {
- return version.compareTo(PostgreSQLCapabilities.EIGHT_4) >= 0;
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return PostgreSQLCapabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.sqlserver;
-
-import java.util.*;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class SQLServerCapabilities extends JDBCCapabilities {
-
- public SQLServerCapabilities() {
- }
-
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- //supportedFunctons.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- //supportedFunctons.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- //supportedFunctons.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- //supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- //supportedFunctons.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SPACE"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- //supportedFunctons.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
- //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- //supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
-
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
- public boolean supportsExcept() {
- return true;
- };
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java (from rev 2119, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.sqlserver;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.ColumnReference;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageObject;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.sybase.SybaseExecutionFactory;
+
+/**
+ * Updated to assume the use of the DataDirect, 2005 driver, or later.
+ */
+public class SQLServerExecutionFactory extends SybaseExecutionFactory {
+
+ //TEIID-31 remove mod modifier for SQL Server 2008
+
+ @Override
+ protected List<Object> convertDateToString(Function function) {
+ return Arrays.asList("replace(convert(varchar, ", function.getParameters().get(0), ", 102), '.', '-')"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ protected List<?> convertTimestampToString(Function function) {
+ return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 21)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public List<?> translate(LanguageObject obj, ExecutionContext context) {
+ if (obj instanceof ColumnReference) {
+ ColumnReference elem = (ColumnReference)obj;
+ if (TypeFacility.RUNTIME_TYPES.STRING.equals(elem.getType()) && elem.getMetadataObject() != null && "uniqueidentifier".equalsIgnoreCase(elem.getMetadataObject().getNativeType())) { //$NON-NLS-1$
+ return Arrays.asList("cast(", elem, " as char(36))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return super.translate(obj, context);
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getDefaultSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ //supportedFunctons.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ //supportedFunctons.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ //supportedFunctons.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ //supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ //supportedFunctons.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SPACE"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ //supportedFunctons.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
+ //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ //supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ };
+
+ @Override
+ public int getMaxFromGroups() {
+ return DEFAULT_MAX_FROM_GROUPS;
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return JDBCExecutionFactory.DEFAULT_MAX_IN_CRITERIA;
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.sqlserver;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageObject;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.sybase.SybaseSQLTranslator;
-
-/**
- * Updated to assume the use of the DataDirect, 2005 driver, or later.
- */
-public class SQLServerSQLTranslator extends SybaseSQLTranslator {
-
- //TEIID-31 remove mod modifier for SQL Server 2008
-
- @Override
- protected List<Object> convertDateToString(Function function) {
- return Arrays.asList("replace(convert(varchar, ", function.getParameters().get(0), ", 102), '.', '-')"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- protected List<?> convertTimestampToString(Function function) {
- return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 21)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return SQLServerCapabilities.class;
- }
-
- @Override
- public List<?> translate(LanguageObject obj, ExecutionContext context) {
- if (obj instanceof ColumnReference) {
- ColumnReference elem = (ColumnReference)obj;
- if (TypeFacility.RUNTIME_TYPES.STRING.equals(elem.getType()) && elem.getMetadataObject() != null && "uniqueidentifier".equalsIgnoreCase(elem.getMetadataObject().getNativeType())) { //$NON-NLS-1$
- return Arrays.asList("cast(", elem, " as char(36))"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return super.translate(obj, context);
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,134 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.sybase;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- */
-public class SybaseCapabilities extends JDBCCapabilities {
-
- public SybaseCapabilities() {
- }
-
- @Override
- public int getMaxInCriteriaSize() {
- return 250;
- }
-
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- //supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SPACE"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
- //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- //supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("QUARTER"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
- //supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
-
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.BasicConnectorCapabilities#getMaxFromGroups()
- */
- public int getMaxFromGroups() {
- return 50;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseSQLTranslator.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,292 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.sybase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.Command;
+import org.teiid.language.Function;
+import org.teiid.language.Limit;
+import org.teiid.language.OrderBy;
+import org.teiid.language.SetQuery;
+import org.teiid.translator.ConnectorException;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.EscapeSyntaxModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.ModFunctionModifier;
+
+
+/**
+ */
+public class SybaseExecutionFactory extends JDBCExecutionFactory {
+
+ public void start() throws ConnectorException {
+ super.start();
+
+ registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("+")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("isnull")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.REPEAT, new AliasModifier("replicate")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new SubstringFunctionModifier(getLanguageFactory()));
+ registerFunctionModifier(SourceSystemFunctions.DAYNAME, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.HOUR, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.MINUTE, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.QUARTER, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.SECOND, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.WEEK, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.LENGTH, new EscapeSyntaxModifier());
+ registerFunctionModifier(SourceSystemFunctions.ATAN2, new EscapeSyntaxModifier());
+
+ //add in type conversion
+ ConvertModifier convertModifier = new ConvertModifier();
+ //boolean isn't treated as bit, since it doesn't support null
+ //byte is treated as smallint, since tinyint is unsigned
+ convertModifier.addTypeMapping("smallint", FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(19,0)", FunctionModifier.LONG); //$NON-NLS-1$
+ convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
+ convertModifier.addTypeMapping("double precision", FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(38, 0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convertModifier.addTypeMapping("numeric(38, 19)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+ convertModifier.addTypeMapping("varchar(40)", FunctionModifier.STRING); //$NON-NLS-1$
+ convertModifier.addTypeMapping("datetime", FunctionModifier.DATE, FunctionModifier.TIME, FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ List<Object> result = new ArrayList<Object>();
+ result.add("cast("); //$NON-NLS-1$
+ result.add("'1970-01-01 ' + "); //$NON-NLS-1$
+ result.addAll(convertTimeToString(function));
+ result.add(" AS datetime)"); //$NON-NLS-1$
+ return result;
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ List<Object> result = new ArrayList<Object>();
+ result.add("cast("); //$NON-NLS-1$
+ result.addAll(convertDateToString(function));
+ result.add(" AS datetime)"); //$NON-NLS-1$
+ return result;
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return convertTimeToString(function);
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return convertDateToString(function);
+ }
+ });
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return convertTimestampToString(function);
+ }
+ });
+ convertModifier.addNumericBooleanConversions();
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ private List<Object> convertTimeToString(Function function) {
+ return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 8)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected List<Object> convertDateToString(Function function) {
+ return Arrays.asList("stuff(stuff(convert(varchar, ", function.getParameters().get(0), ", 102), 5, 1, '-'), 8, 1, '-')"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Written to only support version 15
+ * @param function
+ * @return
+ */
+ protected List<?> convertTimestampToString(Function function) {
+ return Arrays.asList("stuff(convert(varchar, ", function.getParameters().get(0), ", 123), 11, 1, ' ')"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public boolean useAsInGroupAlias() {
+ return false;
+ }
+
+ @Override
+ public boolean hasTimeType() {
+ return false;
+ }
+
+ @Override
+ public int getTimestampNanoPrecision() {
+ return 3;
+ }
+
+ /**
+ * SetQueries don't have a concept of TOP, an inline view is needed.
+ */
+ @Override
+ public List<?> translateCommand(Command command, ExecutionContext context) {
+ if (!(command instanceof SetQuery)) {
+ return null;
+ }
+ SetQuery queryCommand = (SetQuery)command;
+ if (queryCommand.getLimit() == null) {
+ return null;
+ }
+ Limit limit = queryCommand.getLimit();
+ OrderBy orderBy = queryCommand.getOrderBy();
+ queryCommand.setLimit(null);
+ queryCommand.setOrderBy(null);
+ List<Object> parts = new ArrayList<Object>(6);
+ parts.add("SELECT "); //$NON-NLS-1$
+ parts.addAll(translateLimit(limit, context));
+ parts.add(" * FROM ("); //$NON-NLS-1$
+ parts.add(queryCommand);
+ parts.add(") AS X"); //$NON-NLS-1$
+ if (orderBy != null) {
+ parts.add(" "); //$NON-NLS-1$
+ parts.add(orderBy);
+ }
+ return parts;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ return Arrays.asList("TOP ", limit.getRowLimit()); //$NON-NLS-1$
+ }
+
+ @Override
+ public boolean useSelectLimit() {
+ return true;
+ }
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 250;
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ //supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SPACE"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ //supportedFunctons.add("CURDATE"); //$NON-NLS-1$
+ //supportedFunctons.add("CURTIME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ //supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("QUARTER"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+ //supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+
+ @Override
+ public int getMaxFromGroups() {
+ return 50;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,214 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.sybase;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.Command;
-import org.teiid.language.Function;
-import org.teiid.language.Limit;
-import org.teiid.language.OrderBy;
-import org.teiid.language.SetQuery;
-import org.teiid.translator.ConnectorCapabilities;
-import org.teiid.translator.ConnectorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.EscapeSyntaxModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.Translator;
-
-
-/**
- */
-public class SybaseSQLTranslator extends Translator {
-
- /*
- * @see com.metamatrix.connector.jdbc.extension.SQLTranslator#initialize(com.metamatrix.data.api.ConnectorEnvironment, com.metamatrix.data.metadata.runtime.RuntimeMetadata)
- */
- public void initialize(JDBCExecutionFactory env) throws ConnectorException {
- super.initialize(env);
- registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier("%", getLanguageFactory())); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("+")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.LCASE, new AliasModifier("lower")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.IFNULL, new AliasModifier("isnull")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("upper")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.REPEAT, new AliasModifier("replicate")); //$NON-NLS-1$
- registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new SubstringFunctionModifier(getLanguageFactory()));
- registerFunctionModifier(SourceSystemFunctions.DAYNAME, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTHNAME, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.HOUR, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.MINUTE, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.QUARTER, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.SECOND, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.WEEK, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.LENGTH, new EscapeSyntaxModifier());
- registerFunctionModifier(SourceSystemFunctions.ATAN2, new EscapeSyntaxModifier());
-
- //add in type conversion
- ConvertModifier convertModifier = new ConvertModifier();
- //boolean isn't treated as bit, since it doesn't support null
- //byte is treated as smallint, since tinyint is unsigned
- convertModifier.addTypeMapping("smallint", FunctionModifier.BYTE, FunctionModifier.SHORT); //$NON-NLS-1$
- convertModifier.addTypeMapping("int", FunctionModifier.INTEGER); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(19,0)", FunctionModifier.LONG); //$NON-NLS-1$
- convertModifier.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
- convertModifier.addTypeMapping("double precision", FunctionModifier.DOUBLE); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(38, 0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
- convertModifier.addTypeMapping("numeric(38, 19)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convertModifier.addTypeMapping("varchar(40)", FunctionModifier.STRING); //$NON-NLS-1$
- convertModifier.addTypeMapping("datetime", FunctionModifier.DATE, FunctionModifier.TIME, FunctionModifier.TIMESTAMP); //$NON-NLS-1$
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- List<Object> result = new ArrayList<Object>();
- result.add("cast("); //$NON-NLS-1$
- result.add("'1970-01-01 ' + "); //$NON-NLS-1$
- result.addAll(convertTimeToString(function));
- result.add(" AS datetime)"); //$NON-NLS-1$
- return result;
- }
- });
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- List<Object> result = new ArrayList<Object>();
- result.add("cast("); //$NON-NLS-1$
- result.addAll(convertDateToString(function));
- result.add(" AS datetime)"); //$NON-NLS-1$
- return result;
- }
- });
- convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return convertTimeToString(function);
- }
- });
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return convertDateToString(function);
- }
- });
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- return convertTimestampToString(function);
- }
- });
- convertModifier.addNumericBooleanConversions();
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- private List<Object> convertTimeToString(Function function) {
- return Arrays.asList("convert(varchar, ", function.getParameters().get(0), ", 8)"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected List<Object> convertDateToString(Function function) {
- return Arrays.asList("stuff(stuff(convert(varchar, ", function.getParameters().get(0), ", 102), 5, 1, '-'), 8, 1, '-')"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Written to only support version 15
- * @param function
- * @return
- */
- protected List<?> convertTimestampToString(Function function) {
- return Arrays.asList("stuff(convert(varchar, ", function.getParameters().get(0), ", 123), 11, 1, ' ')"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- public boolean useAsInGroupAlias() {
- return false;
- }
-
- @Override
- public boolean hasTimeType() {
- return false;
- }
-
- @Override
- public int getTimestampNanoPrecision() {
- return 3;
- }
-
- /**
- * SetQueries don't have a concept of TOP, an inline view is needed.
- */
- @Override
- public List<?> translateCommand(Command command, ExecutionContext context) {
- if (!(command instanceof SetQuery)) {
- return null;
- }
- SetQuery queryCommand = (SetQuery)command;
- if (queryCommand.getLimit() == null) {
- return null;
- }
- Limit limit = queryCommand.getLimit();
- OrderBy orderBy = queryCommand.getOrderBy();
- queryCommand.setLimit(null);
- queryCommand.setOrderBy(null);
- List<Object> parts = new ArrayList<Object>(6);
- parts.add("SELECT "); //$NON-NLS-1$
- parts.addAll(translateLimit(limit, context));
- parts.add(" * FROM ("); //$NON-NLS-1$
- parts.add(queryCommand);
- parts.add(") AS X"); //$NON-NLS-1$
- if (orderBy != null) {
- parts.add(" "); //$NON-NLS-1$
- parts.add(orderBy);
- }
- return parts;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- return Arrays.asList("TOP ", limit.getRowLimit()); //$NON-NLS-1$
- }
-
- @Override
- public boolean useSelectLimit() {
- return true;
- }
-
- @Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return SybaseCapabilities.class;
- }
-
-}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-/*
- */
-package org.teiid.translator.jdbc.teiid;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-/**
- * @since 4.3
- */
-public class TeiidCapabilities extends JDBCCapabilities {
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
- * @since 4.3
- */
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("CEILING"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("COT"); //$NON-NLS-1$
- supportedFunctions.add("DEGREES"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
- supportedFunctions.add("FLOOR"); //$NON-NLS-1$
- supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
- supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
- supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
- supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
- supportedFunctions.add("LOG"); //$NON-NLS-1$
- supportedFunctions.add("LOG10"); //$NON-NLS-1$
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("PARSEBIGDECIMAL"); //$NON-NLS-1$
- supportedFunctions.add("PARSEBIGINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("PARSEDOUBLE"); //$NON-NLS-1$
- supportedFunctions.add("PARSEFLOAT"); //$NON-NLS-1$
- supportedFunctions.add("PARSEINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("PARSELONG"); //$NON-NLS-1$
- supportedFunctions.add("PI"); //$NON-NLS-1$
- supportedFunctions.add("POWER"); //$NON-NLS-1$
- supportedFunctions.add("RADIANS"); //$NON-NLS-1$
- supportedFunctions.add("RAND"); //$NON-NLS-1$
- supportedFunctions.add("ROUND"); //$NON-NLS-1$
- supportedFunctions.add("SIGN"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("ASCII"); //$NON-NLS-1$
- supportedFunctions.add("CHAR"); //$NON-NLS-1$
- supportedFunctions.add("CHR"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT"); //$NON-NLS-1$
- supportedFunctions.add("CONCAT2"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
- supportedFunctions.add("INITCAP"); //$NON-NLS-1$
- supportedFunctions.add("INSERT"); //$NON-NLS-1$
- supportedFunctions.add("LCASE"); //$NON-NLS-1$
- supportedFunctions.add("LENGTH"); //$NON-NLS-1$
- supportedFunctions.add("LEFT"); //$NON-NLS-1$
- supportedFunctions.add("LOCATE"); //$NON-NLS-1$
- supportedFunctions.add("LPAD"); //$NON-NLS-1$
- supportedFunctions.add("LTRIM"); //$NON-NLS-1$
- supportedFunctions.add("REPEAT"); //$NON-NLS-1$
- supportedFunctions.add("REPLACE"); //$NON-NLS-1$
- supportedFunctions.add("RPAD"); //$NON-NLS-1$
- supportedFunctions.add("RIGHT"); //$NON-NLS-1$
- supportedFunctions.add("RTRIM"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
- supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
- supportedFunctions.add("UCASE"); //$NON-NLS-1$
- supportedFunctions.add("CURDATE"); //$NON-NLS-1$
- supportedFunctions.add("CURTIME"); //$NON-NLS-1$
- supportedFunctions.add("NOW"); //$NON-NLS-1$
- supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
- supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
- supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
- supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
- supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
- supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
- supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
- supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
- supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
- supportedFunctions.add("WEEK"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("MODIFYTIMEZONE"); //$NON-NLS-1$
- supportedFunctions.add("DECODESTRING"); //$NON-NLS-1$
- supportedFunctions.add("DECODEINTEGER"); //$NON-NLS-1$
- supportedFunctions.add("IFNULL"); //$NON-NLS-1$
- supportedFunctions.add("NVL"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- supportedFunctions.add("CONVERT"); //$NON-NLS-1$
- supportedFunctions.add("USER"); //$NON-NLS-1$
- supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
- supportedFunctions.add("NULLIF"); //$NON-NLS-1$
- supportedFunctions.add("COALESCE"); //$NON-NLS-1$
- return supportedFunctions;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- /**
- * @see org.teiid.translator.ConnectorCapabilities#supportsFunctionsInGroupBy()
- * @since 5.0
- */
- public boolean supportsFunctionsInGroupBy() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- public boolean supportsRowOffset() {
- return true;
- }
-
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidCapabilities.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,164 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+/*
+ */
+package org.teiid.translator.jdbc.teiid;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+
+
+/**
+ * @since 4.3
+ */
+public class TeiidExecutionFactory extends JDBCExecutionFactory {
+
+ /**
+ * @see org.teiid.translator.ConnectorCapabilities#getSupportedFunctions()
+ * @since 4.3
+ */
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("CEILING"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("COT"); //$NON-NLS-1$
+ supportedFunctions.add("DEGREES"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+ supportedFunctions.add("FLOOR"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATBIGDECIMAL"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATBIGINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATDOUBLE"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATFLOAT"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATLONG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG"); //$NON-NLS-1$
+ supportedFunctions.add("LOG10"); //$NON-NLS-1$
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEBIGDECIMAL"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEBIGINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEDOUBLE"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEFLOAT"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("PARSELONG"); //$NON-NLS-1$
+ supportedFunctions.add("PI"); //$NON-NLS-1$
+ supportedFunctions.add("POWER"); //$NON-NLS-1$
+ supportedFunctions.add("RADIANS"); //$NON-NLS-1$
+ supportedFunctions.add("RAND"); //$NON-NLS-1$
+ supportedFunctions.add("ROUND"); //$NON-NLS-1$
+ supportedFunctions.add("SIGN"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("ASCII"); //$NON-NLS-1$
+ supportedFunctions.add("CHAR"); //$NON-NLS-1$
+ supportedFunctions.add("CHR"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT"); //$NON-NLS-1$
+ supportedFunctions.add("CONCAT2"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+ supportedFunctions.add("INITCAP"); //$NON-NLS-1$
+ supportedFunctions.add("INSERT"); //$NON-NLS-1$
+ supportedFunctions.add("LCASE"); //$NON-NLS-1$
+ supportedFunctions.add("LENGTH"); //$NON-NLS-1$
+ supportedFunctions.add("LEFT"); //$NON-NLS-1$
+ supportedFunctions.add("LOCATE"); //$NON-NLS-1$
+ supportedFunctions.add("LPAD"); //$NON-NLS-1$
+ supportedFunctions.add("LTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("REPEAT"); //$NON-NLS-1$
+ supportedFunctions.add("REPLACE"); //$NON-NLS-1$
+ supportedFunctions.add("RPAD"); //$NON-NLS-1$
+ supportedFunctions.add("RIGHT"); //$NON-NLS-1$
+ supportedFunctions.add("RTRIM"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+ supportedFunctions.add("TRANSLATE"); //$NON-NLS-1$
+ supportedFunctions.add("UCASE"); //$NON-NLS-1$
+ supportedFunctions.add("CURDATE"); //$NON-NLS-1$
+ supportedFunctions.add("CURTIME"); //$NON-NLS-1$
+ supportedFunctions.add("NOW"); //$NON-NLS-1$
+ supportedFunctions.add("DAYNAME"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFMONTH"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFWEEK"); //$NON-NLS-1$
+ supportedFunctions.add("DAYOFYEAR"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATDATE"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATTIME"); //$NON-NLS-1$
+ supportedFunctions.add("FORMATTIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("MONTHNAME"); //$NON-NLS-1$
+ supportedFunctions.add("PARSEDATE"); //$NON-NLS-1$
+ supportedFunctions.add("PARSETIME"); //$NON-NLS-1$
+ supportedFunctions.add("PARSETIMESTAMP"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPADD"); //$NON-NLS-1$
+ supportedFunctions.add("TIMESTAMPDIFF"); //$NON-NLS-1$
+ supportedFunctions.add("WEEK"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("MODIFYTIMEZONE"); //$NON-NLS-1$
+ supportedFunctions.add("DECODESTRING"); //$NON-NLS-1$
+ supportedFunctions.add("DECODEINTEGER"); //$NON-NLS-1$
+ supportedFunctions.add("IFNULL"); //$NON-NLS-1$
+ supportedFunctions.add("NVL"); //$NON-NLS-1$
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ supportedFunctions.add("CONVERT"); //$NON-NLS-1$
+ supportedFunctions.add("USER"); //$NON-NLS-1$
+ supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
+ supportedFunctions.add("NULLIF"); //$NON-NLS-1$
+ supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFunctionsInGroupBy() {
+ return true;
+ }
+
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+}
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc.teradata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.jdbc.JDBCCapabilities;
-
-
-
-/**
- * for Teradata database Release V2R5.1
- */
-public class TeradataCapabilities extends JDBCCapabilities {
-
- public TeradataCapabilities() {
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return false;
- }
-
- /**
- * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List getSupportedFunctions() {
- List supportedFunctions = new ArrayList();
- supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
-// supportedFunctions.add("LOG"); //$NON-NLS-1$ // "LN"
-// supportedFunctions.add("LOG10"); //$NON-NLS-1$ // "LOG"
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
-// supportedFunctions.add("CONCAT"); //$NON-NLS-1$ // "||"
-// supportedFunctions.add("LCASE"); //$NON-NLS-1$ // "LOWER"
-// supportedFunctions.add("LOCATE"); //$NON-NLS-1$ //"POSITION", "INDEX" ?
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
-// supportedFunctions.add("UCASE"); //$NON-NLS-1$ // "UPPER"
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("DAY"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
-
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- //supportedFunctions.add("CONVERT"); //$NON-NLS-1$ "CAST"
-
- return supportedFunctions;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java (from rev 2121, trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataCapabilities.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.teradata;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+
+
+
+/**
+ * for Teradata database Release V2R5.1
+ */
+public class TeradataExecutionFactory extends JDBCExecutionFactory {
+
+ public TeradataExecutionFactory() {
+ }
+
+ /*
+ * @see com.metamatrix.data.ConnectorCapabilities#supportsFullOuterJoins()
+ */
+ public boolean supportsFullOuterJoins() {
+ return false;
+ }
+
+ /**
+ * @see org.teiid.resource.cci.data.ConnectorCapabilities#getSupportedFunctions()
+ */
+ public List getSupportedFunctions() {
+ List supportedFunctions = new ArrayList();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+ supportedFunctions.add("ABS"); //$NON-NLS-1$
+ supportedFunctions.add("ACOS"); //$NON-NLS-1$
+ supportedFunctions.add("ASIN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN"); //$NON-NLS-1$
+ supportedFunctions.add("ATAN2"); //$NON-NLS-1$
+ supportedFunctions.add("COS"); //$NON-NLS-1$
+ supportedFunctions.add("EXP"); //$NON-NLS-1$
+// supportedFunctions.add("LOG"); //$NON-NLS-1$ // "LN"
+// supportedFunctions.add("LOG10"); //$NON-NLS-1$ // "LOG"
+ supportedFunctions.add("MOD"); //$NON-NLS-1$
+ supportedFunctions.add("SIN"); //$NON-NLS-1$
+ supportedFunctions.add("SQRT"); //$NON-NLS-1$
+ supportedFunctions.add("TAN"); //$NON-NLS-1$
+ supportedFunctions.add("||"); //$NON-NLS-1$
+// supportedFunctions.add("CONCAT"); //$NON-NLS-1$ // "||"
+// supportedFunctions.add("LCASE"); //$NON-NLS-1$ // "LOWER"
+// supportedFunctions.add("LOCATE"); //$NON-NLS-1$ //"POSITION", "INDEX" ?
+ supportedFunctions.add("LOWER"); //$NON-NLS-1$
+ supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
+// supportedFunctions.add("UCASE"); //$NON-NLS-1$ // "UPPER"
+ supportedFunctions.add("UPPER"); //$NON-NLS-1$
+ supportedFunctions.add("HOUR"); //$NON-NLS-1$
+ supportedFunctions.add("MONTH"); //$NON-NLS-1$
+ supportedFunctions.add("YEAR"); //$NON-NLS-1$
+ supportedFunctions.add("DAY"); //$NON-NLS-1$
+ supportedFunctions.add("MINUTE"); //$NON-NLS-1$
+ supportedFunctions.add("SECOND"); //$NON-NLS-1$
+
+ supportedFunctions.add("CAST"); //$NON-NLS-1$
+ //supportedFunctions.add("CONVERT"); //$NON-NLS-1$ "CAST"
+
+ return supportedFunctions;
+ }
+
+}
Modified: trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.jdbc.JDBCExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.jdbc.JDBCExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/FakeMetadataFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -29,8 +29,6 @@
import org.teiid.language.Command;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.TranslatedCommand;
-import org.teiid.translator.jdbc.Translator;
import com.metamatrix.cdk.api.TranslationUtility;
import com.metamatrix.cdk.unittest.FakeTranslationFactory;
@@ -52,7 +50,7 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, input);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestExtractFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestExtractFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestExtractFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -36,9 +36,6 @@
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.ExtractFunctionModifier;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.Translator;
/**
@@ -61,9 +58,9 @@
Integer.class);
ExtractFunctionModifier mod = new ExtractFunctionModifier ();
- Translator trans = new Translator();
+ JDBCExecutionFactory trans = new JDBCExecutionFactory();
trans.registerFunctionModifier(target, mod);
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.jdbc;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.sqlserver.SQLServerSQLTranslator;
-public class TestJDBCExecutionFactory {
-
- @Test public void testGetExtensionTranslationClassDefault() throws Exception {
- JDBCExecutionFactory mcf = new JDBCExecutionFactory();
- assertSame(Translator.class, mcf.getTranslator().getClass());
- }
-
- @Test public void testGetExtensionTranslationClass() throws Exception {
- JDBCExecutionFactory mcf = new JDBCExecutionFactory();
- mcf.setExtensionTranslationClassName(SQLServerSQLTranslator.class.getName());
- assertSame(SQLServerSQLTranslator.class, mcf.getTranslator().getClass());
- }
-
-}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -33,9 +33,6 @@
import org.mockito.Mockito;
import org.teiid.language.Command;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.JDBCProcedureExecution;
-import org.teiid.translator.jdbc.Translator;
public class TestJDBCProcedureExecution {
@@ -46,12 +43,9 @@
Mockito.stub(cs.getUpdateCount()).toReturn(-1);
Mockito.stub(cs.getInt(1)).toReturn(5);
Mockito.stub(connection.prepareCall("{ call spTest8a(?)}")).toReturn(cs); //$NON-NLS-1$
- Translator sqlTranslator = new Translator();
+ JDBCExecutionFactory ef = new JDBCExecutionFactory();
- JDBCExecutionFactory config = Mockito.mock(JDBCExecutionFactory.class);
- Mockito.stub(config.getTranslator()).toReturn(sqlTranslator);
-
- JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config, sqlTranslator);
+ JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), ef);
procedureExecution.execute();
assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
Mockito.verify(cs, Mockito.times(1)).registerOutParameter(1, Types.INTEGER);
@@ -63,12 +57,9 @@
Mockito.stub(cs.getUpdateCount()).toReturn(-1);
Mockito.stub(cs.getInt(2)).toReturn(5);
Mockito.stub(connection.prepareCall("{ call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
- Translator sqlTranslator = new Translator();
+ JDBCExecutionFactory config = new JDBCExecutionFactory();
- JDBCExecutionFactory config = Mockito.mock(JDBCExecutionFactory.class);
- Mockito.stub(config.getTranslator()).toReturn(sqlTranslator);
-
- JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config, sqlTranslator);
+ JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
procedureExecution.execute();
assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
Mockito.verify(cs, Mockito.times(1)).registerOutParameter(2, Types.INTEGER);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCUpdateExecution.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCUpdateExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -33,9 +33,6 @@
import org.teiid.language.Insert;
import org.teiid.language.Literal;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.JDBCUpdateExecution;
-import org.teiid.translator.jdbc.Translator;
public class TestJDBCUpdateExecution {
@@ -54,10 +51,9 @@
Mockito.stub(p.executeBatch()).toReturn(new int [] {1, 1});
Mockito.stub(connection.prepareStatement("INSERT INTO SmallA (IntKey, IntNum) VALUES (?, ?)")).toReturn(p); //$NON-NLS-1$
- JDBCExecutionFactory config = Mockito.mock(JDBCExecutionFactory.class);
- Mockito.stub(config.getTranslator()).toReturn(new Translator());
+ JDBCExecutionFactory config = new JDBCExecutionFactory();
- JDBCUpdateExecution updateExecution = new JDBCUpdateExecution(command, connection, Mockito.mock(ExecutionContext.class), config, config.getTranslator());
+ JDBCUpdateExecution updateExecution = new JDBCUpdateExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
updateExecution.execute();
Mockito.verify(p, Mockito.times(2)).addBatch();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestLocateFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -32,9 +32,6 @@
import org.teiid.language.LanguageFactory;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.LocateFunctionModifier;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.Translator;
/**
* Test <code>LOCATEFunctionModifier</code> by invoking its methods with varying
@@ -97,16 +94,15 @@
Arrays.asList(param1, param2), Integer.class);
}
- Translator trans = new Translator() {
+ JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void initialize(JDBCExecutionFactory env)
- throws ConnectorException {
- super.initialize(env);
+ public void start() throws ConnectorException {
+ super.start();
registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), locateFunctionName, parameterOrder));
}
};
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestModFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -33,9 +33,6 @@
import org.teiid.language.LanguageFactory;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.ModFunctionModifier;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.Translator;
/**
* Test <code>ModFunctionModifier</code> by invoking its methods with varying
@@ -90,16 +87,15 @@
Function func = LANG_FACTORY.createFunction(modFunctionName,
Arrays.asList(param1, param2), param1.getType());
- Translator trans = new Translator() {
+ JDBCExecutionFactory trans = new JDBCExecutionFactory() {
@Override
- public void initialize(JDBCExecutionFactory env)
- throws ConnectorException {
- super.initialize(env);
+ public void start() throws ConnectorException {
+ super.start();
registerFunctionModifier(SourceSystemFunctions.MOD, new ModFunctionModifier(modFunctionName, getLanguageFactory()));
}
};
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -37,8 +37,6 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.Translator;
/**
*/
@@ -53,13 +51,12 @@
"PartID", //$NON-NLS-1$
"ExecCount"); //$NON-NLS-1$
- private static Translator TRANSLATOR;
+ private static JDBCExecutionFactory TRANSLATOR;
@BeforeClass public static void oneTimeSetup() throws ConnectorException {
- TRANSLATOR = new Translator();
- JDBCExecutionFactory env = new JDBCExecutionFactory();
- env.setTrimStrings(true);
- TRANSLATOR.initialize(env);
+ TRANSLATOR = new JDBCExecutionFactory();
+ TRANSLATOR.setTrimStrings(true);
+ TRANSLATOR.start();
}
public String getTestVDB() {
@@ -71,13 +68,12 @@
}
public void helpTestVisitor(String vdb, String input, String expectedOutput, boolean usePreparedStatement) {
- Translator trans = new Translator();
- JDBCExecutionFactory env = new JDBCExecutionFactory();
+ JDBCExecutionFactory trans = new JDBCExecutionFactory();
if (usePreparedStatement) {
- env.setUseBindVariables(true);
+ trans.setUseBindVariables(true);
}
try {
- trans.initialize(env);
+ trans.start();
TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
} catch (ConnectorException e) {
throw new RuntimeException(e);
@@ -89,9 +85,9 @@
private String getStringWithContext(LanguageObject obj) throws ConnectorException {
JDBCExecutionFactory env = new JDBCExecutionFactory();
env.setUseCommentsInSourceQuery(true);
- Translator trans = new Translator();
- trans.initialize(env);
- SQLConversionVisitor visitor = trans.getSQLConversionVisitor();
+ env.start();
+
+ SQLConversionVisitor visitor = env.getSQLConversionVisitor();
visitor.setExecutionContext(context);
visitor.append(obj);
return visitor.toString();
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TranslationHelper.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -36,8 +36,6 @@
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.TranslatedCommand;
-import org.teiid.translator.jdbc.Translator;
import com.metamatrix.cdk.api.TranslationUtility;
import com.metamatrix.cdk.unittest.FakeTranslationFactory;
@@ -72,19 +70,18 @@
return util.parseCommand(sql);
}
- public static void helpTestVisitor(String vdb, String input, String expectedOutput, Translator translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
helpTestVisitor(vdb,null,input, expectedOutput, translator);
}
- public static void helpTestVisitor(String vdb, String udf, String input, String expectedOutput, Translator translator) throws ConnectorException {
+ public static void helpTestVisitor(String vdb, String udf, String input, String expectedOutput, JDBCExecutionFactory translator) throws ConnectorException {
// Convert from sql to objects
Command obj = helpTranslate(vdb, udf, input);
helpTestVisitor(expectedOutput, translator, obj);
}
- public static void helpTestVisitor(String expectedOutput,
- Translator translator, Command obj) throws ConnectorException {
+ public static void helpTestVisitor(String expectedOutput, JDBCExecutionFactory translator, Command obj) throws ConnectorException {
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), translator);
tc.translateCommand(obj);
assertEquals("Did not get correct sql", expectedOutput, tc.getSql()); //$NON-NLS-1$
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/access/TestAccessSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -30,8 +30,6 @@
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.access.AccessSQLTranslator;
import com.metamatrix.cdk.unittest.FakeTranslationFactory;
@@ -41,12 +39,12 @@
*/
public class TestAccessSQLTranslator extends TestCase {
- private static Translator TRANSLATOR;
+ private static JDBCExecutionFactory TRANSLATOR;
static {
try {
- TRANSLATOR = new AccessSQLTranslator();
- TRANSLATOR.initialize(Mockito.mock(JDBCExecutionFactory.class));
+ TRANSLATOR = new AccessExecutionFactory();
+ TRANSLATOR.start();
} catch(ConnectorException e) {
e.printStackTrace();
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2ConvertModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2ConvertModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2ConvertModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -34,9 +34,7 @@
import org.teiid.language.LanguageFactory;
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.db2.DB2SQLTranslator;
/**
@@ -54,8 +52,8 @@
}
public String helpGetString(Expression expr) throws Exception {
- DB2SQLTranslator trans = new DB2SQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ DB2ExecutionFactory trans = new DB2ExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(expr);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/db2/TestDB2SqlTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -31,10 +31,8 @@
import org.teiid.language.Command;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.db2.DB2SQLTranslator;
import com.metamatrix.cdk.api.TranslationUtility;
import com.metamatrix.cdk.unittest.FakeTranslationFactory;
@@ -43,12 +41,12 @@
*/
public class TestDB2SqlTranslator {
- private static DB2SQLTranslator TRANSLATOR;
+ private static DB2ExecutionFactory TRANSLATOR;
@BeforeClass
public static void setUp() throws ConnectorException {
- TRANSLATOR = new DB2SQLTranslator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new DB2ExecutionFactory();
+ TRANSLATOR.start();
}
public String getTestVDB() {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbyCapabilities.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbyCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbyCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,24 +22,25 @@
package org.teiid.translator.jdbc.derby;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.teiid.translator.jdbc.derby.DerbyCapabilities;
public class TestDerbyCapabilities {
@Test public void testLimitSupport() {
- DerbyCapabilities derbyCapabilities = new DerbyCapabilities();
+ DerbyExecutionFactory derbyCapabilities = new DerbyExecutionFactory();
assertFalse(derbyCapabilities.supportsRowLimit());
- derbyCapabilities.setDatabaseVersion(DerbyCapabilities.TEN_5);
+ derbyCapabilities.setDatabaseVersion(DerbyExecutionFactory.TEN_5);
assertTrue(derbyCapabilities.supportsRowLimit());
}
@Test public void testFunctionSupport() {
- DerbyCapabilities derbyCapabilities = new DerbyCapabilities();
+ DerbyExecutionFactory derbyCapabilities = new DerbyExecutionFactory();
assertEquals(27, derbyCapabilities.getSupportedFunctions().size());
- derbyCapabilities.setDatabaseVersion(DerbyCapabilities.TEN_4);
+ derbyCapabilities.setDatabaseVersion(DerbyExecutionFactory.TEN_4);
assertEquals(43, derbyCapabilities.getSupportedFunctions().size());
}
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/derby/TestDerbySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -24,23 +24,20 @@
import org.junit.BeforeClass;
import org.junit.Test;
-import org.mockito.Mockito;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.derby.DerbySQLTranslator;
/**
*/
public class TestDerbySQLTranslator {
- private static DerbySQLTranslator TRANSLATOR;
+ private static DerbyExecutionFactory TRANSLATOR;
@BeforeClass
public static void setUp() throws ConnectorException {
- TRANSLATOR = new DerbySQLTranslator();
- TRANSLATOR.initialize(Mockito.mock(JDBCExecutionFactory.class));
+ TRANSLATOR = new DerbyExecutionFactory();
+ TRANSLATOR.start();
}
@Test
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/h2/TestH2Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -25,18 +25,16 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.h2.H2Translator;
public class TestH2Translator {
- private static H2Translator TRANSLATOR;
+ private static H2ExecutionFactory TRANSLATOR;
@BeforeClass
public static void setUp() throws ConnectorException {
- TRANSLATOR = new H2Translator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new H2ExecutionFactory();
+ TRANSLATOR.start();
}
@Test public void testTimestampDiff() throws Exception {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQL5Translator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -25,19 +25,17 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.mysql.MySQL5Translator;
/**
*/
public class TestMySQL5Translator {
- private static MySQL5Translator TRANSLATOR;
+ private static MySQL5ExecutionFactory TRANSLATOR;
@BeforeClass public static void oneTimeSetup() throws ConnectorException {
- TRANSLATOR = new MySQL5Translator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new MySQL5ExecutionFactory();
+ TRANSLATOR.start();
}
@Test public void testChar() throws Exception {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/mysql/TestMySQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -26,19 +26,17 @@
import org.junit.Ignore;
import org.junit.Test;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.mysql.MySQLTranslator;
/**
*/
public class TestMySQLTranslator {
- private static MySQLTranslator TRANSLATOR;
+ private static MySQLExecutionFactory TRANSLATOR;
@BeforeClass public static void oneTimeSetup() throws ConnectorException {
- TRANSLATOR = new MySQLTranslator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new MySQLExecutionFactory();
+ TRANSLATOR.start();
}
private String getTestVDB() {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestDayWeekQuarterFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestDayWeekQuarterFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestDayWeekQuarterFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -32,9 +32,7 @@
import org.teiid.language.Literal;
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
/**
@@ -56,8 +54,8 @@
Arrays.asList(c),
String.class);
- OracleSQLTranslator trans = new OracleSQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ OracleExecutionFactory trans = new OracleExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestLeftOrRightFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestLeftOrRightFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestLeftOrRightFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -29,9 +29,7 @@
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
import org.teiid.language.Literal;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
/**
*/
@@ -52,8 +50,8 @@
Arrays.asList( c, d ),
String.class);
- OracleSQLTranslator trans = new OracleSQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ OracleExecutionFactory trans = new OracleExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestMonthOrDayNameFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestMonthOrDayNameFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestMonthOrDayNameFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -31,9 +31,7 @@
import org.teiid.language.LanguageFactory;
import org.teiid.language.Literal;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
/**
@@ -55,8 +53,8 @@
Arrays.asList( c ),
String.class);
- OracleSQLTranslator trans = new OracleSQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ OracleExecutionFactory trans = new OracleExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -36,10 +36,7 @@
import org.teiid.language.LanguageFactory;
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
/**
@@ -48,15 +45,15 @@
private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
- private static Translator TRANSLATOR = new OracleSQLTranslator();
+ private static OracleExecutionFactory TRANSLATOR = new OracleExecutionFactory();
@BeforeClass public static void oneTimeSetup() throws Exception {
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR.start();
}
public String helpGetString(Expression expr) throws Exception {
- OracleSQLTranslator trans = new OracleSQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ OracleExecutionFactory trans = new OracleExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
sqlVisitor.append(expr);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -45,27 +45,21 @@
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.Translator;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
import com.metamatrix.cdk.api.TranslationUtility;
public class TestOracleTranslator {
- /**
- * An instance of {@link Translator} which has already been initialized.
- */
- private Translator TRANSLATOR;
+ private OracleExecutionFactory TRANSLATOR;
private String UDF = "/OracleSpatialFunctions.xmi"; //$NON-NLS-1$;
private static ExecutionContext EMPTY_CONTEXT = new FakeExecutionContextImpl();
@Before
public void setup() throws Exception {
- TRANSLATOR = new OracleSQLTranslator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new OracleExecutionFactory();
+ TRANSLATOR.start();
}
private void helpTestVisitor(String input, String expectedOutput) throws ConnectorException {
@@ -522,13 +516,12 @@
}
private void helpTestVisitor(Command obj, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws ConnectorException {
- OracleSQLTranslator translator = new OracleSQLTranslator();
- JDBCExecutionFactory f = new JDBCExecutionFactory();
+ OracleExecutionFactory translator = new OracleExecutionFactory();
if (dbmsTimeZone != null) {
- f.setDatabaseTimeZone(dbmsTimeZone);
+ translator.setDatabaseTimeZone(dbmsTimeZone);
}
- translator.initialize(f);
+ translator.start();
// Convert back to SQL
TranslatedCommand tc = new TranslatedCommand(context, translator);
tc.translateCommand(obj);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestSubstringFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestSubstringFunctionModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestSubstringFunctionModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -30,9 +30,7 @@
import org.teiid.language.Function;
import org.teiid.language.LanguageFactory;
import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.oracle.OracleSQLTranslator;
/**
*/
@@ -53,8 +51,8 @@
Function func = LANG_FACTORY.createFunction("substring", //$NON-NLS-1$
Arrays.asList(args), TypeFacility.RUNTIME_TYPES.STRING);
- OracleSQLTranslator trans = new OracleSQLTranslator();
- trans.initialize(new JDBCExecutionFactory());
+ OracleExecutionFactory trans = new OracleExecutionFactory();
+ trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -25,17 +25,15 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.postgresql.PostgreSQLTranslator;
public class TestPostgreSQLTranslator {
- private static PostgreSQLTranslator TRANSLATOR;
+ private static PostgreSQLExecutionFactory TRANSLATOR;
@BeforeClass public static void setupOnce() throws Exception {
- TRANSLATOR = new PostgreSQLTranslator();
- TRANSLATOR.initialize(new JDBCExecutionFactory());
+ TRANSLATOR = new PostgreSQLExecutionFactory();
+ TRANSLATOR.start();
}
public String getTestVDB() {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -37,9 +37,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.sqlserver.SQLServerSQLTranslator;
import com.metamatrix.cdk.api.TranslationUtility;
@@ -47,11 +45,11 @@
*/
public class TestSqlServerConversionVisitor {
- private static SQLServerSQLTranslator trans = new SQLServerSQLTranslator();
+ private static SQLServerExecutionFactory trans = new SQLServerExecutionFactory();
@BeforeClass
public static void setup() throws ConnectorException {
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
}
public String getTestVDB() {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -37,9 +37,7 @@
import org.teiid.language.Literal;
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.translator.ConnectorException;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.sybase.SybaseSQLTranslator;
/**
@@ -47,11 +45,11 @@
public class TestSybaseConvertModifier {
private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
- private static SybaseSQLTranslator trans = new SybaseSQLTranslator();
+ private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
public static void setup() throws ConnectorException {
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
}
public String helpGetString(Expression expr) throws Exception {
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -33,17 +33,17 @@
import org.teiid.translator.jdbc.JDBCExecutionFactory;
import org.teiid.translator.jdbc.TranslatedCommand;
import org.teiid.translator.jdbc.TranslationHelper;
-import org.teiid.translator.jdbc.sybase.SybaseSQLTranslator;
+import org.teiid.translator.jdbc.sybase.SybaseExecutionFactory;
/**
*/
public class TestSybaseSQLConversionVisitor {
- private static SybaseSQLTranslator trans = new SybaseSQLTranslator();
+ private static SybaseExecutionFactory trans = new SybaseExecutionFactory();
@BeforeClass
public static void setup() throws ConnectorException {
- trans.initialize(new JDBCExecutionFactory());
+ trans.start();
}
public String getTestVDB() {
Deleted: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPConnectorCapabilities.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPConnectorCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPConnectorCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.ldap;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-/**
- * This class extends the BasicConnectorCapabilities class, and establishes
- * the capabilities that are supported by the LDAPConnector.
- */
-public class LDAPConnectorCapabilities extends BasicConnectorCapabilities {
-
- @Override
- public int getMaxInCriteriaSize() {
- return 1000;
- }
-
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- public boolean supportsInCriteria() {
- return true;
- }
-
- public boolean supportsLikeCriteria() {
- return true;
- }
-
- public boolean supportsOrCriteria() {
- return true;
- }
-
- public boolean supportsOrderBy() {
- // Removed this support -- see LDAPSyncQueryExecution comments for details.
- return false;
- }
-
- public boolean supportsRowLimit() {
- // GHH 20080408 - turned this on, because I fixed issue
- // in nextBatch that was causing this to fail
- return true;
- }
-
- public boolean supportsRowOffset() {
- // TODO This might actually be possible in future releases,
- // when using virtual list views/Sun. note that this requires the ability
- // to set the count limit, as well as an offset, so setCountLimit::searchControls
- // won't do it alone.
- return false;
- }
-
- @Override
- public boolean supportsCompareCriteriaOrdered() {
- return true;
- }
-
- @Override
- public boolean supportsNotCriteria() {
- return true;
- }
-
-}
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 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -29,28 +29,24 @@
import org.teiid.language.QueryExpression;
import org.teiid.language.Select;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TranslatorProperty;
import org.teiid.translator.UpdateExecution;
/**
- * LDAPConnector. This is responsible for initializing
+ * LDAP translator. This is responsible for initializing
* a connection factory, and obtaining connections to LDAP.
*/
-public class LDAPExecutionFactory extends BasicExecutionFactory {
+public class LDAPExecutionFactory extends ExecutionFactory {
private String searchDefaultBaseDN;
private boolean restrictToObjectClass = false;
private String searchDefaultScope = "SUBTREE_SCOPE"; //$NON-NLS-1$
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return LDAPConnectorCapabilities.class;
- }
@TranslatorProperty(name="SearchDefaultBaseDN", display="Default Search Base DN", description="Default Base DN for LDAP Searches",advanced=true, defaultValue="")
public String getSearchDefaultBaseDN() {
@@ -100,4 +96,61 @@
throw new ConnectorException(e);
}
}
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 1000;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ // Removed this support -- see LDAPSyncQueryExecution comments for details.
+ return false;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ // GHH 20080408 - turned this on, because I fixed issue
+ // in nextBatch that was causing this to fail
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ // TODO This might actually be possible in future releases,
+ // when using virtual list views/Sun. note that this requires the ability
+ // to set the count limit, as well as an offset, so setCountLimit::searchControls
+ // won't do it alone.
+ return false;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -97,7 +97,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ResultSetExecution;
@@ -107,7 +106,7 @@
* LDAPSyncQueryExecution is responsible for executing an LDAP search
* corresponding to a read-only "select" query from MetaMatrix.
*/
-public class LDAPSyncQueryExecution extends BasicExecution implements ResultSetExecution {
+public class LDAPSyncQueryExecution implements ResultSetExecution {
private LDAPSearchDetails searchDetails;
private LdapContext ldapConnection;
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -47,7 +47,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.AbstractMetadataRecord;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.UpdateExecution;
@@ -69,7 +68,7 @@
* item in the WHERE clause for UPDATE and DELETE operations, and in the list
* of attributes to assign values in an INSERT operation * Responsible for update/insert/delete operations against LDAP
*/
-public class LDAPUpdateExecution extends BasicExecution implements UpdateExecution {
+public class LDAPUpdateExecution implements UpdateExecution {
private LdapContext ldapConnection;
private LdapContext ldapCtx;
private Command command;
Modified: trunk/connectors/translator-ldap/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-ldap/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-ldap/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.ldap.LDAPExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.ldap.LDAPExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
Deleted: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackCapabilities.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,317 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.loopback;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-
-/**
- * Specifies the capabilities of this connector. Since we want this
- * connector to be able to emulate most other connectors, these
- * capabilities support everything.
- */
-public class LoopbackCapabilities extends BasicConnectorCapabilities {
-
- /**
- * Construct the capabilities class
- */
- public LoopbackCapabilities() {
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#getSupportedFunctions()
- */
- public List getSupportedFunctions() {
- List functions = Arrays.asList(new String[] {
- "+", "-", "*", "/", "abs", "acos", "asin", "atan", "atan2", "ceiling", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
- "bitand", "bitnot", "bitor", "bitxor", "cos", "cot", "degrees", "cos", "cot", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- "degrees", "exp", "floor", "log", "log10", "mod", "pi", "power", "radians", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- "round", "sign", "sin", "sqrt", "tan", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- "ascii", "chr", "char", "concat", "initcap", "insert", "lcase", "left", "length", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- "locate", "lower", "lpad", "ltrim", "repeat", "replace", "right", "rpad", "rtrim", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
- "substring", "translate", "ucase", "upper", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "curdate", "curtime", "now", "dayname", "dayofmonth", "dayofweek", "dayofyear", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- "hour", "minute", "month", "monthname", "quarter", "second", "timestampadd", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
- "timestampdiff", "week", "year", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "cast", "convert", "ifnull", "nvl" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- });
- return functions;
- }
-
- @Override
- public boolean supportsGroupBy() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesAvg()
- */
- public boolean supportsAggregatesAvg() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesCount()
- */
- public boolean supportsAggregatesCount() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesCountStar()
- */
- public boolean supportsAggregatesCountStar() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesDistinct()
- */
- public boolean supportsAggregatesDistinct() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesMax()
- */
- public boolean supportsAggregatesMax() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesMin()
- */
- public boolean supportsAggregatesMin() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAggregatesSum()
- */
- public boolean supportsAggregatesSum() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsAliasedGroup()
- */
- public boolean supportsAliasedGroup() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsBetweenCriteria()
- */
- public boolean supportsBetweenCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCaseExpressions()
- */
- public boolean supportsCaseExpressions() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCompareCriteriaEquals()
- */
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsCorrelatedSubqueries()
- */
- public boolean supportsCorrelatedSubqueries() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsExistsCriteria()
- */
- public boolean supportsExistsCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsFullOuterJoins()
- */
- public boolean supportsFullOuterJoins() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteria()
- */
- public boolean supportsInCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsInCriteriaSubquery()
- */
- public boolean supportsInCriteriaSubquery() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsIsNullCriteria()
- */
- public boolean supportsIsNullCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteria()
- */
- public boolean supportsLikeCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsLikeCriteriaEscapeCharacter()
- */
- public boolean supportsLikeCriteriaEscapeCharacter() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsNotCriteria()
- */
- public boolean supportsNotCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOrCriteria()
- */
- public boolean supportsOrCriteria() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOrderBy()
- */
- public boolean supportsOrderBy() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsOuterJoins()
- */
- public boolean supportsOuterJoins() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsQuantifiedCompareCriteriaAll()
- */
- public boolean supportsQuantifiedCompareCriteriaAll() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsScalarSubqueries()
- */
- public boolean supportsScalarSubqueries() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSearchedCaseExpressions()
- */
- public boolean supportsSearchedCaseExpressions() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSelectDistinct()
- */
- public boolean supportsSelectDistinct() {
- return true;
- }
-
- /*
- * @see com.metamatrix.data.ConnectorCapabilities#supportsSelfJoins()
- */
- public boolean supportsSelfJoins() {
- return true;
- }
-
- public boolean supportsInlineViews() {
- return true;
- }
-
- public boolean supportsQuantifiedCompareCriteriaSome() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsSelectExpression() {
- return true;
- }
-
- @Override
- public boolean supportsSetQueryOrderBy() {
- return true;
- }
-
- @Override
- 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/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -40,8 +40,6 @@
import org.teiid.language.Argument.Direction;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
@@ -52,7 +50,7 @@
/**
* Represents the execution of a command.
*/
-public class LoopbackExecution extends BasicExecution implements UpdateExecution, ProcedureExecution {
+public class LoopbackExecution implements UpdateExecution, ProcedureExecution {
private static final String ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$
Modified: trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java
===================================================================
--- trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-loopback/src/main/java/org/teiid/translator/loopback/LoopbackExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,19 +22,21 @@
package org.teiid.translator.loopback;
+import java.util.Arrays;
+import java.util.List;
+
import org.teiid.language.Command;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorProperty;
/**
- * Loopback connector.
+ * Loopback translator.
*/
-public class LoopbackExecutionFactory extends BasicExecutionFactory {
+public class LoopbackExecutionFactory extends ExecutionFactory {
private int waitTime = 0;
private int rowCount = 1;
@@ -83,11 +85,6 @@
}
@Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return LoopbackCapabilities.class;
- }
-
- @Override
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionfactory)
throws ConnectorException {
return new LoopbackExecution(command, this);
@@ -97,4 +94,220 @@
public boolean isSourceRequired() {
return false;
}
+
+ @Override
+ public List getSupportedFunctions() {
+ List functions = Arrays.asList(new String[] {
+ "+", "-", "*", "/", "abs", "acos", "asin", "atan", "atan2", "ceiling", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$
+ "bitand", "bitnot", "bitor", "bitxor", "cos", "cot", "degrees", "cos", "cot", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ "degrees", "exp", "floor", "log", "log10", "mod", "pi", "power", "radians", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ "round", "sign", "sin", "sqrt", "tan", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ "ascii", "chr", "char", "concat", "initcap", "insert", "lcase", "left", "length", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ "locate", "lower", "lpad", "ltrim", "repeat", "replace", "right", "rpad", "rtrim", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$
+ "substring", "translate", "ucase", "upper", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "curdate", "curtime", "now", "dayname", "dayofmonth", "dayofweek", "dayofyear", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "hour", "minute", "month", "monthname", "quarter", "second", "timestampadd", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ "timestampdiff", "week", "year", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "cast", "convert", "ifnull", "nvl" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ });
+ return functions;
+ }
+
+ @Override
+ public boolean supportsGroupBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesAvg() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesCount() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesDistinct() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesMax() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesMin() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesSum() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAliasedGroup() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsBetweenCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCaseExpressions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExistsCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteriaSubquery() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIsNullCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteriaEscapeCharacter() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrderBy() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaAll() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSearchedCaseExpressions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelectDistinct() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelfJoins() {
+ return true;
+ }
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsQuantifiedCompareCriteriaSome() {
+ return true;
+ }
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSelectExpression() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsSetQueryOrderBy() {
+ return true;
+ }
+
+ @Override
+ 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/translator-loopback/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-loopback/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-loopback/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.loopback.LoopbackExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.loopback.LoopbackExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
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 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -22,6 +22,9 @@
package org.teiid.translator.salesforce;
+import java.util.ArrayList;
+import java.util.List;
+
import org.teiid.language.Call;
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
@@ -29,9 +32,9 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
@@ -44,7 +47,7 @@
import org.teiid.translator.salesforce.execution.UpdateExecutionImpl;
-public class SalesForceExecutionFactory extends org.teiid.translator.BasicExecutionFactory implements MetadataProvider {
+public class SalesForceExecutionFactory extends ExecutionFactory implements MetadataProvider {
private String connectorStateClass;
private boolean auditModelFields = false;
@@ -74,11 +77,6 @@
@Override
- public Class<? extends ConnectorCapabilities> getDefaultCapabilities() {
- return SalesforceCapabilities.class;
- }
-
- @Override
public ResultSetExecution createResultSetExecution(QueryExpression command, ExecutionContext executionContext, RuntimeMetadata metadata, Object connectionFactory)
throws ConnectorException {
return new QueryExecutionImpl(command, (SalesforceConnection)connectionFactory, metadata, executionContext);
@@ -108,4 +106,74 @@
MetadataProcessor processor = new MetadataProcessor((SalesforceConnection)connectionFactory,metadataFactory, this);
processor.processMetadata();
}
+
+ @Override
+ public int getMaxInCriteriaSize() {
+ return 700;
+ }
+
+ @Override
+ public List getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.add("includes"); //$NON-NLS-1$
+ supportedFunctions.add("excludes"); //$NON-NLS-1$
+ return supportedFunctions;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaEquals() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsLikeCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ // http://jira.jboss.org/jira/browse/JBEDSP-306
+ // Salesforce supports ORDER BY, but not on all column types
+ @Override
+ public boolean supportsOrderBy() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsAggregatesCountStar() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsNotCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsOrCriteria() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCompareCriteriaOrdered() {
+ return true;
+ }
+
+ @Override
+ public SupportedJoinCriteria getSupportedJoinCriteria() {
+ return SupportedJoinCriteria.KEY;
+ }
+
+ @Override
+ public boolean supportsOuterJoins() {
+ return true;
+ }
}
Deleted: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceCapabilities.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesforceCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,96 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.salesforce;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-public class SalesforceCapabilities extends BasicConnectorCapabilities {
-
- public int getMaxInCriteriaSize() {
- return 700;
- }
-
- public List getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.add("includes");
- supportedFunctions.add("excludes");
- return supportedFunctions;
- }
-
- public boolean supportsCompareCriteriaEquals() {
- return true;
- }
-
- public boolean supportsInCriteria() {
- return true;
- }
-
- public boolean supportsLikeCriteria() {
- return true;
- }
-
- public boolean supportsRowLimit() {
- return true;
- }
-
- // http://jira.jboss.org/jira/browse/JBEDSP-306
- // Salesforce supports ORDER BY, but not on all column types
- public boolean supportsOrderBy() {
- return false;
- }
-
- @Override
- public boolean supportsAggregatesCountStar() {
- return true;
- }
-
- @Override
- public boolean supportsNotCriteria() {
- return true;
- }
-
- @Override
- public boolean supportsOrCriteria() {
- return true;
- }
-
- @Override
- public boolean supportsCompareCriteriaOrdered() {
- return true;
- }
-
- @Override
- public SupportedJoinCriteria getSupportedJoinCriteria() {
- return SupportedJoinCriteria.KEY;
- }
-
- @Override
- public boolean supportsOuterJoins() {
- return true;
- }
-
-
-
-}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/AbstractUpdateExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -27,7 +27,6 @@
import org.teiid.language.Comparison;
import org.teiid.language.Condition;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
@@ -46,7 +45,7 @@
* get IDs of Salesforce objects.
*
*/
-public abstract class AbstractUpdateExecution extends BasicExecution implements UpdateExecution {
+public abstract class AbstractUpdateExecution implements UpdateExecution {
protected SalesforceConnection connection;
protected RuntimeMetadata metadata;
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -44,7 +44,6 @@
import org.teiid.metadata.Column;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
@@ -59,7 +58,7 @@
import com.sforce.soap.partner.QueryResult;
import com.sforce.soap.partner.sobject.SObject;
-public class QueryExecutionImpl extends BasicExecution implements ResultSetExecution {
+public class QueryExecutionImpl implements ResultSetExecution {
private SalesforceConnection connection;
Modified: trunk/connectors/translator-salesforce/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-salesforce/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-salesforce/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.salesforce.SalesForceExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.salesforce.SalesForceExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
Deleted: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextCapabilities.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextCapabilities.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextCapabilities.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.text;
-
-import org.teiid.translator.BasicConnectorCapabilities;
-
-public class TextCapabilities extends BasicConnectorCapabilities {
-
- static TextCapabilities INSTANCE = new TextCapabilities();
-
-}
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextExecutionFactory.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -45,9 +45,9 @@
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
-import org.teiid.translator.BasicExecutionFactory;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.FileConnection;
import org.teiid.translator.MetadataProvider;
import org.teiid.translator.ResultSetExecution;
@@ -58,7 +58,7 @@
/**
* Implementation of text connector.
*/
-public class TextExecutionFactory extends BasicExecutionFactory implements MetadataProvider{
+public class TextExecutionFactory extends ExecutionFactory implements MetadataProvider{
private boolean enforceColumnCount = false;
private String dateResultFormatsDelimiter;
Modified: trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java
===================================================================
--- trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-text/src/main/java/org/teiid/translator/text/TextSynchExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -39,7 +39,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ResultSetExecution;
@@ -49,7 +48,7 @@
* The essential part that executes the query. It keeps all the execution
* states.
*/
-public class TextSynchExecution extends BasicExecution implements ResultSetExecution {
+public class TextSynchExecution implements ResultSetExecution {
// Command to be executed
private Select cmd;
Modified: trunk/connectors/translator-text/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-text/src/main/resources/META-INF/jboss-beans.xml 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/connectors/translator-text/src/main/resources/META-INF/jboss-beans.xml 2010-05-13 13:40:34 UTC (rev 2122)
@@ -10,7 +10,7 @@
<constructor factoryMethod="createTemplateInfo">
<factory bean="TranslatorDeploymentTemplateInfoFactory"/>
<parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
- <parameter class="java.lang.Class">org.teiid.resource.adapter.text.TextExecutionFactory</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.text.TextExecutionFactory</parameter>
<parameter class="java.lang.String">${project.artifactId}-${project.version}</parameter>
<parameter class="java.lang.String">${project.description}</parameter>
</constructor>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -144,9 +144,8 @@
}
checkStatus();
- ExecutionFactory connector = getExecutionFactory();
- ConnectorCapabilities caps = connector.getCapabilities();
- BasicSourceCapabilities resultCaps = CapabilitiesConverter.convertCapabilities(caps, this.connectorId, connector.isXaCapable());
+ ExecutionFactory translator = getExecutionFactory();
+ BasicSourceCapabilities resultCaps = CapabilitiesConverter.convertCapabilities(translator, this.connectorId, translator.isXaCapable());
resultCaps.setScope(Scope.SCOPE_GLOBAL);
cachedCapabilities = resultCaps;
return resultCaps;
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeConnector.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -30,18 +30,15 @@
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.BasicConnectorCapabilities;
-import org.teiid.translator.BasicExecution;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.Execution;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.UpdateExecution;
-public class FakeConnector extends BasicExecutionFactory {
+public class FakeConnector extends ExecutionFactory {
private static final int RESULT_SIZE = 5;
private boolean executeBlocks;
@@ -67,9 +64,6 @@
executionCount++;
return new FakeBlockingExecution(executionContext);
}
- public ConnectorCapabilities getCapabilities() {
- return new BasicConnectorCapabilities();
- }
public Object getConnection() {
return new FakeConnection();
@@ -87,7 +81,7 @@
}
}
- private final class FakeBlockingExecution extends BasicExecution implements ResultSetExecution, UpdateExecution {
+ private final class FakeBlockingExecution implements ResultSetExecution, UpdateExecution {
private boolean closed = false;
private boolean cancelled = false;
private int rowCount;
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/FakeProcedureExecution.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -26,13 +26,12 @@
import java.util.Arrays;
import java.util.List;
-import org.teiid.translator.BasicExecution;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ProcedureExecution;
-final class FakeProcedureExecution extends BasicExecution implements ProcedureExecution {
+final class FakeProcedureExecution implements ProcedureExecution {
int resultSetSize;
int rowNum;
Modified: trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorDeployer.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorDeployer.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/runtime/src/test/java/org/teiid/deployers/TestTranslatorDeployer.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -21,11 +21,11 @@
*/
package org.teiid.deployers;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
import org.junit.Test;
import org.teiid.adminapi.impl.TranslatorMetaData;
-import org.teiid.translator.BasicExecutionFactory;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorProperty;
@SuppressWarnings("nls")
@@ -35,18 +35,17 @@
public void testBuildExecutionFactory() throws Exception {
TranslatorMetaData tm = new TranslatorMetaData();
- tm.setCapabilitiesClass("capabilities");
tm.setXaCapable(true);
tm.addProperty("my-property", "correctly-assigned");
TranslatorDeployer td = new TranslatorDeployer();
MyTranslator my = (MyTranslator)td.buildTranslator(MyTranslator.class.getName(), tm);
- assertEquals("capabilities", my.getCapabilitiesClass());
+ assertTrue(my.isXaCapable());
assertEquals("correctly-assigned", my.getMyProperty());
}
- public static class MyTranslator extends BasicExecutionFactory {
+ public static class MyTranslator extends ExecutionFactory {
String mine;
@TranslatorProperty(name="my-property")
Modified: trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/test-integration/common/src/test/java/org/teiid/connector/metadata/runtime/MockConnector.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -15,23 +15,16 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.BaseColumn.NullType;
import org.teiid.metadata.Column.SearchType;
-import org.teiid.translator.BasicConnectorCapabilities;
-import org.teiid.translator.BasicExecutionFactory;
-import org.teiid.translator.ConnectorCapabilities;
import org.teiid.translator.ConnectorException;
import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.ProcedureExecution;
import org.teiid.translator.ResultSetExecution;
-public class MockConnector extends BasicExecutionFactory {
+public class MockConnector extends ExecutionFactory {
- @Override
- public ConnectorCapabilities getCapabilities() {
- return new BasicConnectorCapabilities();
- }
-
@Override
public ProcedureExecution createProcedureExecution(
Call procedure, ExecutionContext executionContext,
Modified: trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java 2010-05-12 22:19:30 UTC (rev 2121)
+++ trunk/test-integration/common/src/test/java/org/teiid/dqp/internal/process/TestTPCR.java 2010-05-13 13:40:34 UTC (rev 2122)
@@ -34,8 +34,8 @@
import org.teiid.query.processor.HardcodedDataManager;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.translator.jdbc.oracle.OracleCapabilities;
-import org.teiid.translator.jdbc.sqlserver.SQLServerCapabilities;
+import org.teiid.translator.jdbc.oracle.OracleExecutionFactory;
+import org.teiid.translator.jdbc.sqlserver.SQLServerExecutionFactory;
@@ -54,7 +54,7 @@
*/
public void testQuery3() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new OracleExecutionFactory())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
@@ -80,7 +80,7 @@
public void testQueryCase3042() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleExecutionFactory())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
List[] expected =
@@ -112,8 +112,8 @@
*/
public void testQueryCase3047() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
- finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleExecutionFactory())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerExecutionFactory())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
@@ -152,8 +152,8 @@
*/
public void testQueryCase3047workaround() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
- finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Ora", CapabilitiesConverter.convertCapabilities(new OracleExecutionFactory())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_SQLS", CapabilitiesConverter.convertCapabilities(new SQLServerExecutionFactory())); //$NON-NLS-1$
HardcodedDataManager dataMgr = new HardcodedDataManager();
@@ -187,7 +187,7 @@
public void testQuery22() throws Exception{
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new OracleCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new OracleExecutionFactory())); //$NON-NLS-1$
ProcessorPlan plan = TestOptimizer.helpPlan("SELECT custsale.cntrycode, COUNT(*) AS numcust, SUM(c_acctbal) AS totacctbal FROM (SELECT left(C_PHONE, 2) AS cntrycode, CUSTOMER.C_ACCTBAL FROM CUSTOMER WHERE (left(C_PHONE, 2) IN ('13','31','23','29','30','18','17')) AND (CUSTOMER.C_ACCTBAL > (SELECT AVG(CUSTOMER.C_ACCTBAL) FROM CUSTOMER WHERE (CUSTOMER.C_ACCTBAL > 0.0) AND (left(C_PHONE, 2) IN ('13','31','23','29','30','18','17')))) AND (NOT (EXISTS (SELECT * FROM ORDERS WHERE O_CUSTKEY = C_CUSTKEY)))) AS custsale GROUP BY custsale.cntrycode ORDER BY custsale.cntrycode", //$NON-NLS-1$
METADATA, null, finder,
@@ -197,7 +197,7 @@
public void testDefect22475() throws Exception {
FakeCapabilitiesFinder finder = new FakeCapabilitiesFinder();
- finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new SQLServerCapabilities())); //$NON-NLS-1$
+ finder.addCapabilities("TPCR_Oracle_9i", CapabilitiesConverter.convertCapabilities(new SQLServerExecutionFactory())); //$NON-NLS-1$
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,
13 years, 11 months