teiid SVN: r2546 - in branches/7.1.x: common-core/src/main/java/org/teiid/core/crypto and 25 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-09-08 13:16:13 -0400 (Wed, 08 Sep 2010)
New Revision: 2546
Removed:
branches/7.1.x/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java
branches/7.1.x/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java
Modified:
branches/7.1.x/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java
branches/7.1.x/engine/src/main/java/org/teiid/query/eval/Evaluator.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java
branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java
branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java
branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java
branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
branches/7.1.x/engine/src/main/java/org/teiid/query/report/ActivityReport.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/util/CommandContext.java
branches/7.1.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java
branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
Log:
TEIID-1027: Deleting the ErrorMessageKey classes and inline all the constants.
Deleted: branches/7.1.x/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/ErrorMessageKeys.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -1,70 +0,0 @@
-package org.teiid.core;
-
-public interface ErrorMessageKeys {
-
- /** types (029) */
- public static final String TYPES_ERR_0001 = "ERR.003.029.0001"; //$NON-NLS-1$
- public static final String TYPES_ERR_0002 = "ERR.003.029.0002"; //$NON-NLS-1$
- public static final String TYPES_ERR_0003 = "ERR.003.029.0003"; //$NON-NLS-1$
- public static final String TYPES_ERR_0004 = "ERR.003.029.0004"; //$NON-NLS-1$
- public static final String TYPES_ERR_0005 = "ERR.003.029.0005"; //$NON-NLS-1$
- public static final String TYPES_ERR_0006 = "ERR.003.029.0006"; //$NON-NLS-1$
- public static final String TYPES_ERR_0007 = "ERR.003.029.0007"; //$NON-NLS-1$
- public static final String TYPES_ERR_0008 = "ERR.003.029.0008"; //$NON-NLS-1$
- public static final String TYPES_ERR_0009 = "ERR.003.029.0009"; //$NON-NLS-1$
- public static final String TYPES_ERR_0010 = "ERR.003.029.0010"; //$NON-NLS-1$
- public static final String TYPES_ERR_0011 = "ERR.003.029.0011"; //$NON-NLS-1$
- public static final String TYPES_ERR_0012 = "ERR.003.029.0012"; //$NON-NLS-1$
- public static final String TYPES_ERR_0013 = "ERR.003.029.0013"; //$NON-NLS-1$
- public static final String TYPES_ERR_0014 = "ERR.003.029.0014"; //$NON-NLS-1$
- public static final String TYPES_ERR_0015 = "ERR.003.029.0015"; //$NON-NLS-1$
- public static final String TYPES_ERR_0016 = "ERR.003.029.0016"; //$NON-NLS-1$
- public static final String TYPES_ERR_0017 = "ERR.003.029.0017"; //$NON-NLS-1$
- public static final String TYPES_ERR_0018 = "ERR.003.029.0018"; //$NON-NLS-1$
- public static final String TYPES_ERR_0019 = "ERR.003.029.0019"; //$NON-NLS-1$
- public static final String TYPES_ERR_0020 = "ERR.003.029.0020"; //$NON-NLS-1$
- public static final String TYPES_ERR_0021 = "ERR.003.029.0021"; //$NON-NLS-1$
- public static final String TYPES_ERR_0022 = "ERR.003.029.0022"; //$NON-NLS-1$
- public static final String TYPES_ERR_0023 = "ERR.003.029.0023"; //$NON-NLS-1$
- public static final String TYPES_ERR_0024 = "ERR.003.029.0024"; //$NON-NLS-1$
- public static final String TYPES_ERR_0025 = "ERR.003.029.0025"; //$NON-NLS-1$
- public static final String TYPES_ERR_0026 = "ERR.003.029.0026"; //$NON-NLS-1$
-
- public static final String CM_UTIL_ERR_0068 = "ERR.003.030.0068"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0062 = "ERR.003.030.0062"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0064 = "ERR.003.030.0064"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0066 = "ERR.003.030.0066"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0067 = "ERR.003.030.0067"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0071 = "ERR.003.030.0071"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0072 = "ERR.003.030.0072"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0073 = "ERR.003.030.0073"; //$NON-NLS-1$
-
- public static final String CM_UTIL_ERR_0074 = "ERR.003.030.0074"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0075 = "ERR.003.030.0075"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0076 = "ERR.003.030.0076"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0077 = "ERR.003.030.0077"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0078 = "ERR.003.030.0078"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0079 = "ERR.003.030.0079"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0081 = "ERR.003.030.0081"; //$NON-NLS-1$
-
-
- public static final String PROPERTIES_ERR_0010 = "ERR.003.021.0010"; //$NON-NLS-1$
- public static final String PROPERTIES_ERR_0011 = "ERR.003.021.0011"; //$NON-NLS-1$
-
- public static final String SEC_MEMBERSHIP_0013 = "ERR.014.407.0013"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0014 = "ERR.014.407.0014"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0015 = "ERR.014.407.0015"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0016 = "ERR.014.407.0016"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0017 = "ERR.014.407.0017"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0018 = "ERR.014.407.0018"; //$NON-NLS-1$
- public static final String SEC_MEMBERSHIP_0019 = "ERR.014.407.0019"; //$NON-NLS-1$
-
-
- public static final String CM_UTIL_ERR_0176 = "ERR.003.030.0176"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0177 = "ERR.003.030.0177"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0178 = "ERR.003.030.0178"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0179 = "ERR.003.030.0179"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0180 = "ERR.003.030.0180"; //$NON-NLS-1$
- public static final String CM_UTIL_ERR_0181 = "ERR.003.030.0181"; //$NON-NLS-1$
-
-}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/crypto/BasicCryptor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -32,7 +32,6 @@
import javax.crypto.SealedObject;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.util.Base64;
@@ -76,13 +75,13 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0071, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0071, e.getClass().getName(), e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0071", CorePlugin.Util.getString("ERR.003.030.0071", e.getClass().getName(), e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public String decrypt( String ciphertext ) throws CryptoException {
if ( ciphertext == null ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0074, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0074));
+ throw new CryptoException( "ERR.003.030.0074", CorePlugin.Util.getString("ERR.003.030.0074")); //$NON-NLS-1$ //$NON-NLS-2$
}
ciphertext = stripEncryptionPrefix(ciphertext);
@@ -92,7 +91,7 @@
try {
cipherBytes = Base64.decode(ciphertext);
} catch ( IllegalArgumentException e ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0075, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0075, e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0075", CorePlugin.Util.getString("ERR.003.030.0075", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
// Perform standard decryption
byte[] cleartext = decrypt( cipherBytes );
@@ -121,11 +120,11 @@
decryptCipher = Cipher.getInstance( cipherAlgorithm);
decryptCipher.init( Cipher.DECRYPT_MODE, decryptKey );
} catch ( NoSuchAlgorithmException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0076, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0076, cipherAlgorithm ));
+ throw new CryptoException( e, "ERR.003.030.0076", CorePlugin.Util.getString("ERR.003.030.0076", cipherAlgorithm )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( NoSuchPaddingException e ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0077, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0077, cipherAlgorithm, e.getClass().getName(), e.getMessage() ));
+ throw new CryptoException( "ERR.003.030.0077", CorePlugin.Util.getString("ERR.003.030.0077", cipherAlgorithm, e.getClass().getName(), e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( InvalidKeyException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0079, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0079, e.getClass().getName(), e.getMessage()) );
+ throw new CryptoException( e, "ERR.003.030.0079", CorePlugin.Util.getString("ERR.003.030.0079", e.getClass().getName(), e.getMessage()) ); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -145,7 +144,7 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0071, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0071, e.getClass().getName(), e.getMessage()));
+ throw new CryptoException( "ERR.003.030.0071", CorePlugin.Util.getString("ERR.003.030.0071", e.getClass().getName(), e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -163,17 +162,17 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, e.getMessage()));
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public String encrypt( String cleartext ) throws CryptoException {
if ( cleartext == null ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0072, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0072));
+ throw new CryptoException( "ERR.003.030.0072", CorePlugin.Util.getString("ERR.003.030.0072")); //$NON-NLS-1$ //$NON-NLS-2$
}
String clearString = new String(cleartext);
if ( clearString.trim().length() == 0 && clearString.length() == 0 ) {
- throw new CryptoException( ErrorMessageKeys.CM_UTIL_ERR_0073, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0073));
+ throw new CryptoException( "ERR.003.030.0073", CorePlugin.Util.getString("ERR.003.030.0073")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Turn char array into string and get its bytes using "standard" encoding
byte[] clearBytes = clearString.getBytes();
@@ -197,17 +196,17 @@
encryptCipher = Cipher.getInstance( cipherAlgorithm );
encryptCipher.init( Cipher.ENCRYPT_MODE, encryptKey );
} catch ( NoSuchAlgorithmException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0076, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0076, cipherAlgorithm ));
+ throw new CryptoException( e, "ERR.003.030.0076", CorePlugin.Util.getString("ERR.003.030.0076", cipherAlgorithm )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( NoSuchPaddingException e ) {
- throw new CryptoException(e, ErrorMessageKeys.CM_UTIL_ERR_0072, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0077, cipherAlgorithm , e.getMessage() ));
+ throw new CryptoException(e, "ERR.003.030.0072", CorePlugin.Util.getString("ERR.003.030.0077", cipherAlgorithm , e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
} catch ( InvalidKeyException e ) {
- throw new CryptoException( e, ErrorMessageKeys.CM_UTIL_ERR_0078, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0078, e.getMessage() ));
+ throw new CryptoException( e, "ERR.003.030.0078", CorePlugin.Util.getString("ERR.003.030.0078", e.getMessage() )); //$NON-NLS-1$ //$NON-NLS-2$
}
}
public synchronized Object sealObject(Object object) throws CryptoException {
if (object != null && !(object instanceof Serializable)) {
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, "not Serializable")); //$NON-NLS-1$
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", "not Serializable")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
try {
return new SealedObject((Serializable)object, encryptCipher);
@@ -217,7 +216,7 @@
} catch (CryptoException err) {
//shouldn't happen
}
- throw new CryptoException(ErrorMessageKeys.CM_UTIL_ERR_0081, CorePlugin.Util.getString(ErrorMessageKeys.CM_UTIL_ERR_0081, e.getMessage()));
+ throw new CryptoException("ERR.003.030.0081", CorePlugin.Util.getString("ERR.003.030.0081", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/DataTypeManager.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -41,7 +41,6 @@
import java.util.Set;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.basic.AnyToObjectTransform;
import org.teiid.core.types.basic.AnyToStringTransform;
import org.teiid.core.types.basic.BooleanToNumberTransform;
@@ -323,7 +322,7 @@
public static Transform getTransform(Class sourceType, Class targetType) {
if (sourceType == null || targetType == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0002, sourceType, targetType));
+ "ERR.003.029.0002", sourceType, targetType)); //$NON-NLS-1$
}
return getTransformFromMaps(
DataTypeManager.getDataTypeName(sourceType), DataTypeManager
@@ -345,7 +344,7 @@
String targetTypeName) {
if (sourceTypeName == null || targetTypeName == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0003, sourceTypeName,
+ "ERR.003.029.0003", sourceTypeName, //$NON-NLS-1$
targetTypeName));
}
return getTransformFromMaps(sourceTypeName, targetTypeName);
@@ -363,7 +362,7 @@
public static boolean isTransformable(Class sourceType, Class targetType) {
if (sourceType == null || targetType == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0002, sourceType, targetType));
+ "ERR.003.029.0002", sourceType, targetType)); //$NON-NLS-1$
}
return (getTransformFromMaps(DataTypeManager
.getDataTypeName(sourceType), DataTypeManager
@@ -385,7 +384,7 @@
String targetTypeName) {
if (sourceTypeName == null || targetTypeName == null) {
throw new IllegalArgumentException(CorePlugin.Util.getString(
- ErrorMessageKeys.TYPES_ERR_0003, sourceTypeName,
+ "ERR.003.029.0003", sourceTypeName, //$NON-NLS-1$
targetTypeName));
}
return (getTransformFromMaps(sourceTypeName, targetTypeName) != null);
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigDecimalTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import java.math.BigDecimal;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -44,7 +43,7 @@
try {
return new BigDecimal(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0014, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0014, value));
+ throw new TransformationException("ERR.003.029.0014", CorePlugin.Util.getString("ERR.003.029.0014", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToBigIntegerTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import java.math.BigInteger;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -44,7 +43,7 @@
try {
return new BigInteger(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0015, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0015, value));
+ throw new TransformationException("ERR.003.029.0015", CorePlugin.Util.getString("ERR.003.029.0015", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToByteTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Byte.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0016, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0016, value));
+ throw new TransformationException("ERR.003.029.0016", CorePlugin.Util.getString("ERR.003.029.0016", value));
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDateTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import java.sql.Date;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Date.valueOf( (String) value );
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0018, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0018, value));
+ throw new TransformationException(e, "ERR.003.029.0018", CorePlugin.Util.getString("ERR.003.029.0018", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!result.toString().equals(value)) {
throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToDoubleTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Double.valueOf((String)value);
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0019, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0019, value));
+ throw new TransformationException("ERR.003.029.0019", CorePlugin.Util.getString("ERR.003.029.0019", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToFloatTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Float.valueOf((String)value);
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0020, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0020, value));
+ throw new TransformationException("ERR.003.029.0020", CorePlugin.Util.getString("ERR.003.029.0020", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToIntegerTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Integer.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0021, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0021, value));
+ throw new TransformationException("ERR.003.029.0021", CorePlugin.Util.getString("ERR.003.029.0021", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToLongTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Long.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0022, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0022, value));
+ throw new TransformationException("ERR.003.029.0022", CorePlugin.Util.getString("ERR.003.029.0022", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToShortTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -23,7 +23,6 @@
package org.teiid.core.types.basic;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -41,7 +40,7 @@
try {
return Short.valueOf(((String)value).trim());
} catch(NumberFormatException e) {
- throw new TransformationException(ErrorMessageKeys.TYPES_ERR_0023, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0023, value));
+ throw new TransformationException("ERR.003.029.0023", CorePlugin.Util.getString("ERR.003.029.0023", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimeTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import java.sql.Time;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Time.valueOf((String)value);
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0025, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0025, value));
+ throw new TransformationException(e, "ERR.003.029.0025", CorePlugin.Util.getString("ERR.003.029.0025", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!result.toString().equals(value)) {
throw new TransformationException(CorePlugin.Util.getString("transform.invalid_string_for_date", value, getTargetType().getSimpleName())); //$NON-NLS-1$
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/types/basic/StringToTimestampTransform.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import java.sql.Timestamp;
import org.teiid.core.CorePlugin;
-import org.teiid.core.ErrorMessageKeys;
import org.teiid.core.types.Transform;
import org.teiid.core.types.TransformationException;
@@ -46,7 +45,7 @@
try {
result = Timestamp.valueOf( (String) value );
} catch(Exception e) {
- throw new TransformationException(e, ErrorMessageKeys.TYPES_ERR_0024, CorePlugin.Util.getString(ErrorMessageKeys.TYPES_ERR_0024, value));
+ throw new TransformationException(e, "ERR.003.029.0024", CorePlugin.Util.getString("ERR.003.029.0024", value)); //$NON-NLS-1$ //$NON-NLS-2$
}
//validate everything except for fractional seconds
if (!((String)value).startsWith(result.toString().substring(0, 19))) {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -109,7 +109,6 @@
import org.teiid.query.sql.util.ValueIterator;
import org.teiid.query.sql.util.ValueIteratorSource;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
import org.teiid.translator.WSConnection.Util;
@@ -224,7 +223,7 @@
} else if (criteria instanceof ExpressionCriteria) {
return (Boolean)evaluate(((ExpressionCriteria)criteria).getExpression(), tuple);
} else {
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0010, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0010, criteria));
+ throw new ExpressionEvaluationException("ERR.015.006.0010", QueryPlugin.Util.getString("ERR.015.006.0010", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -274,7 +273,7 @@
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[] {"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[] {"left", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -287,7 +286,7 @@
try {
rightValue = evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"right", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -310,7 +309,7 @@
case CompareCriteria.GE:
return Boolean.valueOf((compareValues(leftValue, rightValue) >= 0));
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException("ERR.015.006.0012", QueryPlugin.Util.getString("ERR.015.006.0012", criteria.getOperator())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -332,7 +331,7 @@
try {
value = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"left", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"left", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -357,7 +356,7 @@
try {
rightValue = (String) evaluate(criteria.getRightExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0011, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0011, new Object[]{"right", criteria})); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0011", QueryPlugin.Util.getString("ERR.015.006.0011", new Object[]{"right", criteria})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// Shortcut if null
@@ -384,7 +383,7 @@
Matcher matcher = patternRegex.matcher(search);
return matcher.matches();
} catch(PatternSyntaxException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0014, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0014, new Object[]{pattern, e.getMessage()}));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0014", QueryPlugin.Util.getString("ERR.015.006.0014", new Object[]{pattern, e.getMessage()})); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -396,7 +395,7 @@
try {
leftValue = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Shortcut if null
@@ -450,7 +449,7 @@
try {
value = evaluate((Expression) possibleValue, tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, possibleValue));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", possibleValue)); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
value = possibleValue;
@@ -480,7 +479,7 @@
try {
value = evaluate(criteria.getExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
return (value == null ^ criteria.isNegated());
@@ -494,7 +493,7 @@
try {
leftValue = evaluate(criteria.getLeftExpression(), tuple);
} catch(ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0015, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0015, criteria));
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0015", QueryPlugin.Util.getString("ERR.015.006.0015", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Shortcut if null
@@ -544,7 +543,7 @@
result = Boolean.valueOf(compare >= 0);
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0012, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0012, criteria.getOperator()));
+ throw new ExpressionEvaluationException("ERR.015.006.0012", QueryPlugin.Util.getString("ERR.015.006.0012", criteria.getOperator())); //$NON-NLS-1$ //$NON-NLS-2$
}
switch(criteria.getPredicateQuantifier()) {
@@ -559,7 +558,7 @@
}
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException("ERR.015.006.0057", QueryPlugin.Util.getString("ERR.015.006.0057", criteria.getPredicateQuantifier())); //$NON-NLS-1$ //$NON-NLS-2$
}
} else { // value is null
@@ -572,7 +571,7 @@
result = null;
break;
default:
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0057, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0057, criteria.getPredicateQuantifier()));
+ throw new ExpressionEvaluationException("ERR.015.006.0057", QueryPlugin.Util.getString("ERR.015.006.0057", criteria.getPredicateQuantifier())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -661,7 +660,7 @@
} else if (expression instanceof XMLParse){
return evaluateXMLParse(tuple, (XMLParse)expression);
} else {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0016, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0016, expression.getClass().getName()));
+ throw new TeiidComponentException("ERR.015.006.0016", QueryPlugin.Util.getString("ERR.015.006.0016", expression.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -906,7 +905,7 @@
return internalEvaluate(expr.getThenExpression(i), tuple);
}
} catch (ExpressionEvaluationException e) {
- throw new ExpressionEvaluationException(e, ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, "CASE", expr.getWhenCriteria(i))); //$NON-NLS-1$
+ throw new ExpressionEvaluationException(e, "ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", "CASE", expr.getWhenCriteria(i))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
if (expr.getElseExpression() != null) {
@@ -947,7 +946,7 @@
// Check for special lookup function
if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
if(dataMgr == null) {
- throw new ComponentNotFoundException(ErrorMessageKeys.PROCESSOR_0055, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0055));
+ throw new ComponentNotFoundException("ERR.015.006.0055", QueryPlugin.Util.getString("ERR.015.006.0055")); //$NON-NLS-1$ //$NON-NLS-2$
}
String codeTableName = (String) values[0];
@@ -981,7 +980,7 @@
if(valueIter.hasNext()) {
// The subquery should be scalar, but has produced
// more than one result value - this is an exception case
- throw new ExpressionEvaluationException(ErrorMessageKeys.PROCESSOR_0058, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0058, scalarSubquery.getCommand()));
+ throw new ExpressionEvaluationException("ERR.015.006.0058", QueryPlugin.Util.getString("ERR.015.006.0058", scalarSubquery.getCommand())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return result;
@@ -994,7 +993,7 @@
private CommandContext getContext(LanguageObject expression) throws TeiidComponentException {
if (context == null) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return context;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionDescriptor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -37,7 +37,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -236,7 +235,7 @@
// give name and types from fd
Method method = getInvocationMethod();
if(method == null) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0002, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0002, getName()));
+ throw new FunctionExecutionException("ERR.015.001.0002", QueryPlugin.Util.getString("ERR.015.001.0002", getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
if (getDeterministic() >= FunctionMethod.USER_DETERMINISTIC && values.length > 0 && values[0] instanceof CommandContext) {
@@ -255,11 +254,11 @@
Object result = method.invoke(null, values);
return importValue(result, getReturnType());
} catch(ArithmeticException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0003, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0003, getName()));
+ throw new FunctionExecutionException(e, "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
} catch(InvocationTargetException e) {
- throw new FunctionExecutionException(e.getTargetException(), ErrorMessageKeys.FUNCTION_0003, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0003, getName()));
+ throw new FunctionExecutionException(e.getTargetException(), "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
} catch(IllegalAccessException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0004, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0004, method.toString()));
+ throw new FunctionExecutionException(e, "ERR.015.001.0004", QueryPlugin.Util.getString("ERR.015.001.0004", method.toString())); //$NON-NLS-1$ //$NON-NLS-2$
} catch (TransformationException e) {
throw new FunctionExecutionException(e, e.getMessage());
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -56,7 +56,6 @@
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* Static method hooks for most of the function library.
@@ -236,14 +235,14 @@
return new Double(context.getNextRand(((Integer)seed).longValue()));
}
}
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0069, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0069, "rand", seed)); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0069", QueryPlugin.Util.getString("ERR.015.001.0069", "rand", seed)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static Object rand(CommandContext context) throws FunctionExecutionException {
if(context != null) {
return new Double(context.getNextRand());
}
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0069, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0069, "rand")); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0069", QueryPlugin.Util.getString("ERR.015.001.0069", "rand")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
// ================== Function = mod =====================
@@ -450,7 +449,7 @@
int month = getField(date, Calendar.MONTH);
if (month > 11) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0066, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0066,
+ throw new FunctionExecutionException("ERR.015.001.0066", QueryPlugin.Util.getString("ERR.015.001.0066", //$NON-NLS-1$ //$NON-NLS-2$
new Object[] {"quarter", date.getClass().getName()})); //$NON-NLS-1$
}
return Integer.valueOf(month/3 + 1);
@@ -637,7 +636,7 @@
throws FunctionExecutionException {
int countValue = count.intValue();
if(countValue < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0017, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0017, countValue));
+ throw new FunctionExecutionException("ERR.015.001.0017", QueryPlugin.Util.getString("ERR.015.001.0017", countValue)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(string.length() < countValue) {
return string;
@@ -651,7 +650,7 @@
throws FunctionExecutionException {
int countValue = count.intValue();
if(countValue < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0017, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0017, countValue));
+ throw new FunctionExecutionException("ERR.015.001.0017", QueryPlugin.Util.getString("ERR.015.001.0017", countValue)); //$NON-NLS-1$ //$NON-NLS-2$
} else if(string.length() < countValue) {
return string;
} else {
@@ -767,11 +766,11 @@
// Check some invalid cases
if(startValue < 1 || (startValue-1) > string1.length()) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0061, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0061, start, string1));
+ throw new FunctionExecutionException("ERR.015.001.0061", QueryPlugin.Util.getString("ERR.015.001.0061", start, string1)); //$NON-NLS-1$ //$NON-NLS-2$
} else if (len < 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0062, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0062, len));
+ throw new FunctionExecutionException("ERR.015.001.0062", QueryPlugin.Util.getString("ERR.015.001.0062", len)); //$NON-NLS-1$ //$NON-NLS-2$
} else if (string1.length() == 0 && (startValue > 1 || len >0) ) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0063, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0063));
+ throw new FunctionExecutionException("ERR.015.001.0063", QueryPlugin.Util.getString("ERR.015.001.0063")); //$NON-NLS-1$ //$NON-NLS-2$
}
StringBuffer result = new StringBuffer();
@@ -853,7 +852,7 @@
throws FunctionExecutionException {
int length = padLength.intValue();
if(length < 1) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0025, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0025));
+ throw new FunctionExecutionException("ERR.015.001.0025", QueryPlugin.Util.getString("ERR.015.001.0025")); //$NON-NLS-1$ //$NON-NLS-2$
}
if(length < str.length()) {
return str.substring(0, length);
@@ -863,7 +862,7 @@
}
// Get pad character
if(padStr.length() == 0) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0027, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0027));
+ throw new FunctionExecutionException("ERR.015.001.0027", QueryPlugin.Util.getString("ERR.015.001.0027")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Pad string
StringBuffer outStr = new StringBuffer(str);
@@ -908,7 +907,7 @@
public static Object translate(String str, String in, String out)
throws FunctionExecutionException {
if(in.length() != out.length()) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0031, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0031));
+ throw new FunctionExecutionException("ERR.015.001.0031", QueryPlugin.Util.getString("ERR.015.001.0031")); //$NON-NLS-1$ //$NON-NLS-2$
}
if(in.length() == 0 || str.length() == 0) {
@@ -942,7 +941,7 @@
try {
return DataTypeManager.transformValue(src, DataTypeManager.getDataTypeClass(type));
} catch(TransformationException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0033, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0033, new Object[]{src, DataTypeManager.getDataTypeName(src.getClass()), type}));
+ throw new FunctionExecutionException(e, "ERR.015.001.0033", QueryPlugin.Util.getString("ERR.015.001.0033", new Object[]{src, DataTypeManager.getDataTypeName(src.getClass()), type})); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -959,7 +958,7 @@
public static Object context(Object context, Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035));
+ throw new FunctionExecutionException("ERR.015.001.0035", QueryPlugin.Util.getString("ERR.015.001.0035")); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -973,7 +972,7 @@
public static Object rowlimit(Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035a, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035a));
+ throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -987,7 +986,7 @@
public static Object rowlimitexception(Object expression)
throws FunctionExecutionException {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0035a, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0035a));
+ throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
}
// ================== Function = lookup =====================
@@ -1033,7 +1032,7 @@
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
} catch (IllegalArgumentException iae) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0042, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0042 ,
+ throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
iae.getMessage()));
}
}
@@ -1045,7 +1044,7 @@
try {
return df.parse(date);
} catch (ParseException e) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0043, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0043 ,
+ throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
date, format));
}
}
@@ -1062,7 +1061,7 @@
DecimalFormat df = new DecimalFormat(format);
return df.format(number);
} catch (IllegalArgumentException iae) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0042, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0042 ,
+ throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
iae.getMessage()));
}
}
@@ -1112,7 +1111,7 @@
try {
return df.parse(number);
} catch (ParseException e) {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0043, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0043 ,
+ throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
number,format));
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -46,7 +46,6 @@
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.function.metadata.FunctionParameter;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -107,7 +106,7 @@
if(sourceObj instanceof FunctionMetadataSource) {
addSource((FunctionMetadataSource) sourceObj);
} else {
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0044, sourceObj.getClass().getName()));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.001.0044", sourceObj.getClass().getName())); //$NON-NLS-1$
}
}
}
@@ -127,7 +126,7 @@
while(functionIter.hasNext()) {
Object functionObj = functionIter.next();
if(! (functionObj instanceof FunctionMethod)) {
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0045, functionObj.getClass().getName()));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.001.0045", functionObj.getClass().getName())); //$NON-NLS-1$
}
FunctionMethod method = (FunctionMethod) functionObj;
@@ -138,7 +137,7 @@
// Add to tree
addFunction(source, method);
} else {
- LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0046, new Object[]{method}));
+ LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE, QueryPlugin.Util.getString("ERR.015.001.0046", new Object[]{method})); //$NON-NLS-1$
}
}
}
@@ -310,10 +309,10 @@
// not have the function jar files. The modeler never invokes, so this isn't a
// problem.
} catch (Exception e) {
- throw new TeiidRuntimeException(e, ErrorMessageKeys.FUNCTION_0047, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0047, new Object[]{method.getInvocationClass(), invocationMethod, inputTypes}));
+ throw new TeiidRuntimeException(e, "ERR.015.001.0047", QueryPlugin.Util.getString("ERR.015.001.0047", new Object[]{method.getInvocationClass(), invocationMethod, inputTypes})); //$NON-NLS-1$ //$NON-NLS-2$
}
if(invocationMethod != null && !FunctionTree.isValidMethod(invocationMethod)) {
- throw new TeiidRuntimeException(ErrorMessageKeys.FUNCTION_0047, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0047, new Object[]{method.getInvocationClass(), invocationMethod, inputTypes}));
+ throw new TeiidRuntimeException("ERR.015.001.0047", QueryPlugin.Util.getString("ERR.015.001.0047", new Object[]{method.getInvocationClass(), invocationMethod, inputTypes})); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
inputTypes.add(0, CommandContext.class);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.query.function.metadata.FunctionMetadataValidator;
import org.teiid.query.function.source.SystemSource;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
public class SystemFunctionManager {
@@ -44,7 +43,7 @@
validateSource(systemSource, report);
if(report.hasItems()) {
// Should never happen as SystemSource doesn't change
- System.err.println(QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0005, report));
+ System.err.println(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
}
systemFunctionTree = new FunctionTree(systemSource);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -30,7 +30,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -90,7 +89,7 @@
try {
return ((BigDecimal)sum).divide(new BigDecimal(count), AVG_SCALE, BigDecimal.ROUND_HALF_UP);
} catch(ArithmeticException e) {
- throw new FunctionExecutionException(e, ErrorMessageKeys.FUNCTION_0048, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0048, sum, new Integer(count)));
+ throw new FunctionExecutionException(e, "ERR.015.001.0048", QueryPlugin.Util.getString("ERR.015.001.0048", sum, new Integer(count))); //$NON-NLS-1$ //$NON-NLS-2$
}
default:
throw new AssertionError("unknown accumulator type"); //$NON-NLS-1$
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -57,7 +56,7 @@
maxValue = valueComp;
}
} else {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0050, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0050, "MAX", value.getClass().getName())); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MAX", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -57,7 +56,7 @@
minValue = valueComp;
}
} else {
- throw new FunctionExecutionException(ErrorMessageKeys.FUNCTION_0050, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0050, "MIN", value.getClass().getName())); //$NON-NLS-1$
+ throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MIN", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/metadata/FunctionMetadataValidator.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -29,7 +29,6 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.QueryPlugin;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -79,7 +78,7 @@
*/
public static final void validateFunctionMethod(FunctionMethod method, ActivityReport report) {
if(method == null) {
- updateReport(report, method, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0052, "FunctionMethod")); //$NON-NLS-1$
+ updateReport(report, method, QueryPlugin.Util.getString("ERR.015.001.0052", "FunctionMethod")); //$NON-NLS-1$ //$NON-NLS-2$
return; // can't validate
}
@@ -127,7 +126,7 @@
*/
public static final void validateFunctionParameter(FunctionParameter param) throws FunctionMetadataException {
if(param == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0053, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0053));
+ throw new FunctionMetadataException("ERR.015.001.0053", QueryPlugin.Util.getString("ERR.015.001.0053")); //$NON-NLS-1$ //$NON-NLS-2$
}
// Validate attributes
@@ -166,7 +165,7 @@
validateIsNotNull(type, "Type"); //$NON-NLS-1$
if(DataTypeManager.getDataTypeClass(type) == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0054, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0054, type));
+ throw new FunctionMetadataException("ERR.015.001.0054", QueryPlugin.Util.getString("ERR.015.001.0054", type)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -227,7 +226,7 @@
*/
private static final void validateIsNotNull(Object object, String objName) throws FunctionMetadataException {
if(object == null) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0052, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0052, objName));
+ throw new FunctionMetadataException("ERR.015.001.0052", QueryPlugin.Util.getString("ERR.015.001.0052", objName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -241,7 +240,7 @@
*/
private static final void validateLength(String string, int maxLength, String strName) throws FunctionMetadataException {
if(string.length() > maxLength) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0055, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0055,strName, new Integer(maxLength)));
+ throw new FunctionMetadataException("ERR.015.001.0055", QueryPlugin.Util.getString("ERR.015.001.0055",strName, new Integer(maxLength))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -262,14 +261,14 @@
char firstChar = name.charAt(0);
if(! Character.isLetter(firstChar)) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0056, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0056,strName, new Character(firstChar)));
+ throw new FunctionMetadataException("ERR.015.001.0056", QueryPlugin.Util.getString("ERR.015.001.0056",strName, new Character(firstChar))); //$NON-NLS-1$ //$NON-NLS-2$
}
// Then check the rest of the characters
for(int i=1; i<name.length(); i++) {
char ch = name.charAt(i);
if(! (Character.isLetterOrDigit(ch) || ch == '_')) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0057, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0057,strName, new Character(ch)));
+ throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, new Character(ch))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -288,7 +287,7 @@
if(identifier.length() > 0) {
char firstChar = identifier.charAt(0);
if(! Character.isJavaIdentifierStart(firstChar)) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0056, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0056,strName, new Character(firstChar)));
+ throw new FunctionMetadataException("ERR.015.001.0056", QueryPlugin.Util.getString("ERR.015.001.0056",strName, new Character(firstChar))); //$NON-NLS-1$ //$NON-NLS-2$
}
// Then check the rest of the characters
@@ -296,13 +295,13 @@
char ch = identifier.charAt(i);
if(! Character.isJavaIdentifierPart(ch)) {
if(! allowMultiple || ! (ch == '.')) {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0057, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0057,strName, new Character(ch)));
+ throw new FunctionMetadataException("ERR.015.001.0057", QueryPlugin.Util.getString("ERR.015.001.0057",strName, new Character(ch))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
if(identifier.charAt(identifier.length()-1) == '.') {
- throw new FunctionMetadataException(ErrorMessageKeys.FUNCTION_0058, QueryPlugin.Util.getString(ErrorMessageKeys.FUNCTION_0058,strName));
+ throw new FunctionMetadataException("ERR.015.001.0058", QueryPlugin.Util.getString("ERR.015.001.0058",strName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingNode.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -33,7 +33,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -386,7 +385,7 @@
}
return traverseDownForFirstNodeWithPropertyString(propertyKey, value, isStringValue, node, true);
} else {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0009, searchDirection ));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.002.0009", searchDirection )); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/mapping/xml/MappingOutputter.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -35,7 +35,6 @@
import javax.xml.stream.XMLStreamWriter;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -147,7 +146,7 @@
*/
void addElementProperty(String name, Object value ) throws XMLStreamException {
if ( value == null ) {
- throw new IllegalArgumentException( QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0010, name) );
+ throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0010", name) ); //$NON-NLS-1$
}
if (value instanceof Collection){
Iterator i = ((Collection)value).iterator();
@@ -172,7 +171,7 @@
} else if ( obj instanceof Boolean ) {
return getXMLText( (Boolean)obj );
} else {
- throw new IllegalArgumentException( QueryPlugin.Util.getString(ErrorMessageKeys.MAPPING_0011, obj.getClass().getName() ));
+ throw new IllegalArgumentException( QueryPlugin.Util.getString("ERR.015.002.0011", obj.getClass().getName() )); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/PlanToProcessConverter.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -95,7 +95,6 @@
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.EvaluatableVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class PlanToProcessConverter {
@@ -447,7 +446,7 @@
break;
default:
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0007, NodeConstants.getNodeTypeString(node.getType())));
+ throw new QueryPlannerException(QueryExecPlugin.Util.getString("ERR.015.004.0007", NodeConstants.getNodeTypeString(node.getType()))); //$NON-NLS-1$
}
if(processNode != null) {
@@ -538,7 +537,7 @@
String cbName = metadata.getFullName(modelID);
return cbName;
} catch(QueryMetadataException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0009));
+ throw new QueryPlannerException(e, QueryExecPlugin.Util.getString("ERR.015.004.0009")); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -105,7 +105,6 @@
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.validator.ValidationVisitor;
@@ -261,7 +260,7 @@
}
if(! appliedHint) {
- String msg = QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0010, groupName);
+ String msg = QueryExecPlugin.Util.getString("ERR.015.004.0010", groupName); //$NON-NLS-1$
if (this.analysisRecord.recordAnnotations()) {
this.analysisRecord.addAnnotation(new Annotation(Annotation.HINTS, msg, "ignoring hint", Priority.MEDIUM)); //$NON-NLS-1$
}
@@ -1036,7 +1035,7 @@
try {
result = QueryParser.getQueryParser().parseCommand(qnode.getQuery());
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0011, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0011, qnode.getGroupName()));
+ throw new QueryResolverException(e, "ERR.015.008.0011", QueryPlugin.Util.getString("ERR.015.008.0011", qnode.getGroupName())); //$NON-NLS-1$ //$NON-NLS-2$
}
//Handle bindings and references
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/FrameUtil.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -67,7 +67,6 @@
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class FrameUtil {
@@ -300,7 +299,7 @@
try {
return QueryRewriter.rewriteCriteria(criteria, null, null, metadata);
} catch(TeiidProcessingException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0023, criteria));
+ throw new QueryPlannerException(e, QueryExecPlugin.Util.getString("ERR.015.004.0023", criteria)); //$NON-NLS-1$
} catch (TeiidComponentException e) {
throw new TeiidRuntimeException(e);
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAccessPatternValidation.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -41,7 +41,6 @@
import org.teiid.query.sql.lang.Update;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -116,7 +115,7 @@
}
Object groups = node.getGroups();
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0012, new Object[] {groups, accessPatterns}));
+ throw new QueryPlannerException(QueryExecPlugin.Util.getString("ERR.015.004.0012", new Object[] {groups, accessPatterns})); //$NON-NLS-1$
}
public String toString() {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushSelectCriteria.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -57,7 +57,6 @@
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
public final class RulePushSelectCriteria implements OptimizerRule {
@@ -298,7 +297,7 @@
return currentNode.getFirstChild();
}
} catch(QueryMetadataException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0020, currentNode.getGroups()));
+ throw new QueryPlannerException(e, QueryExecPlugin.Util.getString("ERR.015.004.0020", currentNode.getGroups())); //$NON-NLS-1$
}
} else if(currentNode.getType() == NodeConstants.Types.JOIN) {
//pushing below a join is not necessary under an access node
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleValidateWhereAll.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -40,7 +40,6 @@
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.lang.Update;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -72,7 +71,7 @@
if(CapabilitiesUtil.requiresCriteria(modelID, metadata, capFinder)
&& hasNoCriteria((Command) node.getProperty(NodeConstants.Info.ATOMIC_REQUEST))) {
String modelName = metadata.getFullName(modelID);
- throw new QueryPlannerException(QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0024, modelName));
+ throw new QueryPlannerException(QueryExecPlugin.Util.getString("ERR.015.004.0024", modelName)); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/CriteriaPlanner.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -44,7 +44,6 @@
import org.teiid.query.sql.symbol.Function;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class CriteriaPlanner {
@@ -89,7 +88,7 @@
if (context == null) {
context = otherContext;
} else if (context != otherContext){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0068, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0068, criteria));
+ throw new QueryPlannerException("ERR.015.004.0068", QueryExecPlugin.Util.getString("ERR.015.004.0068", criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -301,7 +300,7 @@
//assumes that all non-xml group elements are temp elements
boolean hasTempElement = !metadata.isXMLGroup(group.getMetadataID());
if(!first && hasTempElement && resultSet == null) {
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0035, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0035, conjunct));
+ throw new QueryPlannerException("ERR.015.004.0035", QueryExecPlugin.Util.getString("ERR.015.004.0035", conjunct)); //$NON-NLS-1$ //$NON-NLS-2$
}
if (hasTempElement) {
@@ -336,7 +335,7 @@
MappingNode contextNode = MappingNode.findNode(planEnv.mappingDoc, targetContext.getCanonicalName());
if (contextNode == null){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0037, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0037, targetContext));
+ throw new QueryPlannerException("ERR.015.004.0037", QueryExecPlugin.Util.getString("ERR.015.004.0037", targetContext)); //$NON-NLS-1$ //$NON-NLS-2$
}
return contextNode;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/QueryUtil.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -58,7 +58,6 @@
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
@@ -84,7 +83,7 @@
try {
query = QueryParser.getQueryParser().parseCommand(queryNode.getQuery());
} catch (QueryParserException e) {
- throw new QueryPlannerException(e, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0054, new Object[]{queryNode.getGroupName(), queryNode.getQuery()}));
+ throw new QueryPlannerException(e, QueryExecPlugin.Util.getString("ERR.015.004.0054", new Object[]{queryNode.getGroupName(), queryNode.getQuery()})); //$NON-NLS-1$
}
}
return query;
@@ -144,7 +143,7 @@
ResolverUtil.resolveGroup(gs, metadata);
queryNode = metadata.getVirtualPlan(gs.getMetadataID());
} catch (QueryResolverException e) {
- throw new QueryPlannerException(e, ErrorMessageKeys.OPTIMIZER_0029, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0029, groupName));
+ throw new QueryPlannerException(e, "ERR.015.004.0029", QueryExecPlugin.Util.getString("ERR.015.004.0029", groupName)); //$NON-NLS-1$ //$NON-NLS-2$
}
return queryNode;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/optimizer/xml/XMLNodeMappingVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -37,7 +37,6 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Symbol;
import org.teiid.query.sql.visitor.AbstractSymbolMappingVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -124,7 +123,7 @@
Collection unmappedSymbols = mappingVisitor.getUnmappedSymbols();
if (unmappedSymbols != null && unmappedSymbols.size() > 0){
- throw new QueryPlannerException(ErrorMessageKeys.OPTIMIZER_0046, QueryExecPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0046, new Object[] {unmappedSymbols, object}));
+ throw new QueryPlannerException("ERR.015.004.0046", QueryExecPlugin.Util.getString("ERR.015.004.0046", new Object[] {unmappedSymbols, object})); //$NON-NLS-1$ //$NON-NLS-2$
}
return copy;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -64,7 +64,6 @@
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
/**
*/
@@ -532,7 +531,7 @@
private CursorState getCursorState(String rsKey) throws TeiidComponentException {
CursorState state = this.cursorStates.get(rsKey);
if (state == null) {
- throw new TeiidComponentException(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0037, rsKey));
+ throw new TeiidComponentException(QueryExecPlugin.Util.getString("ERR.015.006.0037", rsKey)); //$NON-NLS-1$
}
return state;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/relational/ProjectNode.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -48,7 +48,6 @@
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.SelectSymbol;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
public class ProjectNode extends SubqueryAwareRelationalNode {
@@ -218,7 +217,7 @@
Expression expression = ((ExpressionSymbol)symbol).getExpression();
tuple.add(getEvaluator(this.elementMap).evaluate(expression, values));
} else {
- Assertion.failed(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0034, symbol.getClass().getName()));
+ Assertion.failed(QueryExecPlugin.Util.getString("ERR.015.006.0034", symbol.getClass().getName())); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/AbortProcessingInstruction.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
import org.teiid.query.execution.QueryExecPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -43,7 +42,7 @@
* Default message included in the RuntimeException thrown from
* {@link #process}
*/
- public static final String DEFAULT_MESSAGE = QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0054);
+ public static final String DEFAULT_MESSAGE = QueryExecPlugin.Util.getString("ERR.015.006.0054"); //$NON-NLS-1$
/**
* Constructor for AbortProcessingInstruction.
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/MoveDocInstruction.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -29,7 +29,6 @@
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogManager;
import org.teiid.query.execution.QueryExecPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
import org.xml.sax.SAXException;
@@ -71,7 +70,7 @@
doc.moveToLastChild();
break;
default:
- Assertion.failed(QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0051, direction));
+ Assertion.failed(QueryExecPlugin.Util.getString("ERR.015.006.0051", direction)); //$NON-NLS-1$
break;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/RecurseProgramCondition.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -29,7 +29,6 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.execution.QueryExecPlugin;
import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -93,7 +92,7 @@
//handle the case of exception on recursion limit reached
if (terminate && this.exceptionOnRecursionLimit){
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0039, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0039));
+ throw new TeiidComponentException("ERR.015.006.0039", QueryExecPlugin.Util.getString("ERR.015.006.0039")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -61,7 +61,6 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.xml.sax.Attributes;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
@@ -226,7 +225,7 @@
if (xmlSchemas == null || xmlSchemas.isEmpty()){
// if there is no schema no need to validate
// return a warning saying there is no schema
- TeiidException noSchema = new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0042, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0042));
+ TeiidException noSchema = new TeiidComponentException("ERR.015.006.0042", QueryExecPlugin.Util.getString("ERR.015.006.0042")); //$NON-NLS-1$ //$NON-NLS-2$
addWarning(noSchema);
return;
}
@@ -389,7 +388,7 @@
} catch (Exception e){
e.printStackTrace();
LogManager.logWarning(LogConstants.CTX_XML_PLAN, e,
- QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0001));
+ QueryExecPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
}
return "XMLPlan"; //$NON-NLS-1$
}
@@ -440,13 +439,13 @@
}
public void error(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0049, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0049", QueryExecPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
public void fatalError(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0048, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0048", QueryExecPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
public void warning(SAXParseException ex){
- addException(new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0049, QueryExecPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0048, ex.getMessage())));
+ addException(new TeiidComponentException("ERR.015.006.0049", QueryExecPlugin.Util.getString("ERR.015.006.0048", ex.getMessage()))); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/report/ActivityReport.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/report/ActivityReport.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/report/ActivityReport.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import java.util.Iterator;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -74,7 +73,7 @@
*/
public void addItem(ReportItem item) {
if(item == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.REPORT_0001));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.007.0001")); //$NON-NLS-1$
}
this.items.add(item);
@@ -87,7 +86,7 @@
*/
public void addItems(Collection items) {
if(items == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.REPORT_0001));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.007.0001")); //$NON-NLS-1$
}
Iterator iter = items.iterator();
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/ProcedureContainerResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -46,7 +46,6 @@
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public abstract class ProcedureContainerResolver implements CommandResolver {
@@ -88,7 +87,7 @@
try {
subCommand = parser.parseCommand(plan);
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0045, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0045, group));
+ throw new QueryResolverException(e, "ERR.015.008.0045", QueryPlugin.Util.getString("ERR.015.008.0045", group)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(subCommand instanceof CreateUpdateProcedureCommand){
@@ -204,7 +203,7 @@
String plan = getPlan(metadata, procCommand.getGroup());
if(plan == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0009, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0009, procCommand.getGroup(), procCommand.getClass().getSimpleName()));
+ throw new QueryResolverException("ERR.015.008.0009", QueryPlugin.Util.getString("ERR.015.008.0009", procCommand.getGroup(), procCommand.getClass().getSimpleName())); //$NON-NLS-1$ //$NON-NLS-2$
}
return plan;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/ExecResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -57,7 +57,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -154,7 +153,7 @@
}
if(!namedParameters && (inputParams != inputExpressions.size())) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0007, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0007, new Object[] {new Integer(inputParams), new Integer(inputExpressions.size()), storedProcedureCommand.getGroup().toString()}));
+ throw new QueryResolverException("ERR.015.008.0007", QueryPlugin.Util.getString("ERR.015.008.0007", new Object[] {new Integer(inputParams), new Integer(inputExpressions.size()), storedProcedureCommand.getGroup().toString()})); //$NON-NLS-1$ //$NON-NLS-2$
}
// Walk through the resolved parameters and set the expressions from the
@@ -268,7 +267,7 @@
// and add implicit conversion if necessary
Class exprType = expr.getType();
if(paramType == null || exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0061, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0061, storedProcedureCommand.getProcedureName(), param.getName()));
+ throw new QueryResolverException("ERR.015.008.0061", QueryPlugin.Util.getString("ERR.015.008.0061", storedProcedureCommand.getProcedureName(), param.getName())); //$NON-NLS-1$ //$NON-NLS-2$
}
String tgtType = DataTypeManager.getDataTypeName(paramType);
String srcType = DataTypeManager.getDataTypeName(exprType);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -57,7 +57,6 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -151,7 +150,7 @@
try {
resolveList(insert.getVariables(), metadata, null, groups);
} catch (QueryResolverException e) {
- throw new QueryResolverException(e, QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0054, insert.getGroup(), e.getUnresolvedSymbols()));
+ throw new QueryResolverException(e, QueryPlugin.Util.getString("ERR.015.012.0054", insert.getGroup(), e.getUnresolvedSymbols())); //$NON-NLS-1$
}
}
@@ -176,7 +175,7 @@
// check that # of variables == # of values
if(values.size() != insert.getVariables().size()) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0010, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0010, insert.getVariables().size(), values.size()));
+ throw new QueryResolverException("ERR.015.008.0010", QueryPlugin.Util.getString("ERR.015.008.0010", insert.getVariables().size(), values.size())); //$NON-NLS-1$ //$NON-NLS-2$
}
Iterator valueIter = values.iterator();
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SetQueryResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -45,7 +45,6 @@
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.symbol.SingleElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public class SetQueryResolver implements CommandResolver {
@@ -76,7 +75,7 @@
QueryResolver.resolveCommand(rightCommand, Collections.EMPTY_MAP, metadata.getMetadata(), analysis, false);
if (firstProject.size() != rightCommand.getProjectedSymbols().size()) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0035, setQuery.getOperation()));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0035", setQuery.getOperation())); //$NON-NLS-1$
}
checkSymbolTypes(firstProjectTypes, rightCommand.getProjectedSymbols());
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/SimpleQueryResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -84,7 +84,6 @@
import org.teiid.query.sql.symbol.ScalarSubquery;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class SimpleQueryResolver implements CommandResolver {
@@ -140,7 +139,7 @@
String groupAlias = name.substring(0, index);
List<GroupSymbol> groupSymbols = ResolverUtil.findMatchingGroups(groupAlias.toUpperCase(), groups, metadata);
if(groupSymbols.isEmpty() || groupSymbols.size() > 1) {
- String msg = QueryPlugin.Util.getString(groupSymbols.isEmpty()?ErrorMessageKeys.RESOLVER_0047:"SimpleQueryResolver.ambiguous_all_in_group", allInGroupSymbol); //$NON-NLS-1$
+ String msg = QueryPlugin.Util.getString(groupSymbols.isEmpty()?"ERR.015.008.0047":"SimpleQueryResolver.ambiguous_all_in_group", allInGroupSymbol); //$NON-NLS-1$ //$NON-NLS-2$
QueryResolverException qre = new QueryResolverException(msg);
qre.addUnresolvedSymbol(new UnresolvedSymbolDescription(allInGroupSymbol.toString(), msg));
throw qre;
@@ -374,7 +373,7 @@
visitNode(group);
try {
if (!group.isProcedure() && metadata.isXMLGroup(group.getMetadataID())) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0003, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0003));
+ throw new QueryResolverException("ERR.015.008.0003", QueryPlugin.Util.getString("ERR.015.008.0003")); //$NON-NLS-1$ //$NON-NLS-2$
}
discoveredGroup(group);
if (group.isProcedure()) {
@@ -506,8 +505,8 @@
private void addDiscoveredGroups() {
for (GroupSymbol group : discoveredGroups) {
if (!this.currentGroups.add(group)) {
- String msg = QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0046, group.getName());
- QueryResolverException qre = new QueryResolverException(ErrorMessageKeys.RESOLVER_0046, msg);
+ String msg = QueryPlugin.Util.getString("ERR.015.008.0046", group.getName()); //$NON-NLS-1$
+ QueryResolverException qre = new QueryResolverException("ERR.015.008.0046", msg); //$NON-NLS-1$
qre.addUnresolvedSymbol(new UnresolvedSymbolDescription(group.toString(), msg));
throw new TeiidRuntimeException(qre);
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -72,7 +72,6 @@
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -105,7 +104,7 @@
// If still haven't found virtual group, the external metadata is bad
if(virtualGroup == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0012, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0012));
+ throw new QueryResolverException("ERR.015.008.0012", QueryPlugin.Util.getString("ERR.015.008.0012")); //$NON-NLS-1$ //$NON-NLS-2$
}
ResolveVirtualGroupCriteriaVisitor.resolveCriteria(procCommand, virtualGroup, metadata);
@@ -132,7 +131,7 @@
try {
transformCmd = QueryParser.getQueryParser().parseCommand(transformQuery);
} catch(QueryParserException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0013, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0013, virtualGroup));
+ throw new QueryResolverException(e, "ERR.015.008.0013", QueryPlugin.Util.getString("ERR.015.008.0013", virtualGroup)); //$NON-NLS-1$ //$NON-NLS-2$
}
QueryResolver.resolveCommand(transformCmd, metadata);
@@ -289,7 +288,7 @@
String groupName = loopStmt.getCursorName();
if (metadata.getMetadataStore().getTempGroupID(groupName) != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0065));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0065")); //$NON-NLS-1$
}
//check - cursor name should not start with #
@@ -314,7 +313,7 @@
case Statement.TYPE_CONTINUE:
break;
default:
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0015, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0015, statement.getType()));
+ throw new QueryResolverException("ERR.015.008.0015", QueryPlugin.Util.getString("ERR.015.008.0015", statement.getType())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -340,7 +339,7 @@
sepIndex = varName.lastIndexOf(ElementSymbol.SEPARATOR);
String groupName = varName.substring(0, sepIndex);
if(!groupName.equals(ProcedureReservedWords.VARIABLES)) {
- handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0031, new Object[]{ProcedureReservedWords.VARIABLES, variable}));
+ handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString("ERR.015.010.0031", new Object[]{ProcedureReservedWords.VARIABLES, variable})); //$NON-NLS-1$
}
}
boolean exists = false;
@@ -351,7 +350,7 @@
//ignore, not already defined
}
if (exists) {
- handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0032, variable.getOutputName()));
+ handleUnresolvableDeclaration(variable, QueryPlugin.Util.getString("ERR.015.010.0032", variable.getOutputName())); //$NON-NLS-1$
}
variable.setType(DataTypeManager.getDataTypeClass(typeName));
variable.setGroupSymbol(variables);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/command/XMLQueryResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -56,7 +56,6 @@
import org.teiid.query.sql.visitor.CommandCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -113,11 +112,11 @@
//we throw exceptions in these cases, since the clauses will not be resolved
if (query.getGroupBy() != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0031));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0031")); //$NON-NLS-1$
}
if (query.getHaving() != null) {
- throw new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0032));
+ throw new QueryResolverException(QueryPlugin.Util.getString("ERR.015.012.0032")); //$NON-NLS-1$
}
}
@@ -200,7 +199,7 @@
} else if (ss instanceof ExpressionSymbol) {
throw new QueryResolverException(QueryPlugin.Util.getString("XMLQueryResolver.no_expressions_in_select")); //$NON-NLS-1$
} else if (ss instanceof AliasSymbol) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0070, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0070));
+ throw new QueryResolverException("ERR.015.008.0070", QueryPlugin.Util.getString("ERR.015.008.0070")); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -388,11 +387,11 @@
try {
ResolverVisitor.resolveLanguageObject(elem, Collections.EMPTY_LIST, externalGroups, metadata);
} catch (QueryResolverException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0019, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0019, critElemName));
+ throw new QueryResolverException(e, "ERR.015.008.0019", QueryPlugin.Util.getString("ERR.015.008.0019", critElemName)); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
// Found multiple matches
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0020, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0020, critElemName));
+ throw new QueryResolverException("ERR.015.008.0020", QueryPlugin.Util.getString("ERR.015.008.0020", critElemName)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/BindVariableVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -44,7 +44,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.Reference;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -75,7 +74,7 @@
* @param metadata source of metadata
*/
public BindVariableVisitor(List bindings, QueryMetadataInterface metadata) {
- ArgCheck.isNotNull(bindings, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0049));
+ ArgCheck.isNotNull(bindings, QueryPlugin.Util.getString("ERR.015.008.0049")); //$NON-NLS-1$
this.bindings = bindings;
this.metadata = metadata;
@@ -118,7 +117,7 @@
try {
bindReference(obj, binding);
} catch(QueryParserException e) {
- handleException(new QueryResolverException(QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0022), e.getMessage()));
+ handleException(new QueryResolverException(QueryPlugin.Util.getString("ERR.015.008.0022"), e.getMessage())); //$NON-NLS-1$
} catch(QueryMetadataException e) {
handleException(new TeiidComponentException(e, e.getMessage()));
} catch(QueryResolverException e) {
@@ -149,7 +148,7 @@
Expression expr = QueryParser.getQueryParser().parseExpression(binding);
if(!(expr instanceof ElementSymbol)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0025, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0025, expr));
+ throw new QueryResolverException("ERR.015.008.0025", QueryPlugin.Util.getString("ERR.015.008.0025", expr)); //$NON-NLS-1$ //$NON-NLS-2$
}
ElementSymbol element = (ElementSymbol) expr;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -72,7 +72,6 @@
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -214,7 +213,7 @@
}
//Expression is wrong type and can't convert
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0041, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0041, new Object[] {targetTypeName, sourceExpression, sourceTypeName}));
+ throw new QueryResolverException("ERR.015.008.0041", QueryPlugin.Util.getString("ERR.015.008.0041", new Object[] {targetTypeName, sourceExpression, sourceTypeName})); //$NON-NLS-1$ //$NON-NLS-2$
}
public static Constant convertConstant(String sourceTypeName,
@@ -288,7 +287,7 @@
Reference ref = (Reference)expression;
if (ref.isPositional() && ref.getType() == null) {
if (targetType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0026, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0026, surroundingExpression));
+ throw new QueryResolverException("ERR.015.008.0026", QueryPlugin.Util.getString("ERR.015.008.0026", surroundingExpression)); //$NON-NLS-1$ //$NON-NLS-2$
}
ref.setType(targetType);
}
@@ -366,7 +365,7 @@
// if we already have a matched symbol, matching again here means it is duplicate/ambiguous
if(matchedSymbol != null) {
if (!matchedSymbol.equals(knownElements.get(j))) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
+ throw new QueryResolverException("ERR.015.008.0042", QueryPlugin.Util.getString("ERR.015.008.0042", symbolName)); //$NON-NLS-1$ //$NON-NLS-2$
}
continue;
}
@@ -405,7 +404,7 @@
try {
ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, command.getExternalGroupContexts(), metadata);
} catch(QueryResolverException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbol.getName()) );
+ throw new QueryResolverException(e, "ERR.015.008.0043", QueryPlugin.Util.getString("ERR.015.008.0043", symbol.getName()) );//$NON-NLS-1$ //$NON-NLS-2$
}
}
ResolverVisitor.resolveLanguageObject(sortKey, metadata);
@@ -758,13 +757,13 @@
// single projected symbol of the subquery
Class exprType = expression.getType();
if(exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, expression));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", expression)); //$NON-NLS-1$ //$NON-NLS-2$
}
String exprTypeName = DataTypeManager.getDataTypeName(exprType);
Collection projectedSymbols = crit.getCommand().getProjectedSymbols();
if (projectedSymbols.size() != 1){
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0032, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0032, crit.getCommand()));
+ throw new QueryResolverException("ERR.015.008.0032", QueryPlugin.Util.getString("ERR.015.008.0032", crit.getCommand())); //$NON-NLS-1$ //$NON-NLS-2$
}
Class subqueryType = ((Expression)projectedSymbols.iterator().next()).getType();
String subqueryTypeName = DataTypeManager.getDataTypeName(subqueryType);
@@ -772,7 +771,7 @@
try {
result = convertExpression(expression, exprTypeName, subqueryTypeName, metadata);
} catch (QueryResolverException qre) {
- throw new QueryResolverException(qre, ErrorMessageKeys.RESOLVER_0033, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0033, crit));
+ throw new QueryResolverException(qre, "ERR.015.008.0033", QueryPlugin.Util.getString("ERR.015.008.0033", crit)); //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
}
@@ -782,17 +781,17 @@
ResolvedLookup result = new ResolvedLookup();
// Special code to handle setting return type of the lookup function to match the type of the return element
if( !(args[0] instanceof Constant) || !(args[1] instanceof Constant) || !(args[2] instanceof Constant)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0063, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0063));
+ throw new QueryResolverException("ERR.015.008.0063", QueryPlugin.Util.getString("ERR.015.008.0063")); //$NON-NLS-1$ //$NON-NLS-2$
}
// If code table name in lookup function refers to temp group throw exception
GroupSymbol groupSym = new GroupSymbol((String) ((Constant)args[0]).getValue());
try {
groupSym.setMetadataID(metadata.getGroupID((String) ((Constant)args[0]).getValue()));
if (groupSym.getMetadataID() instanceof TempMetadataID) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0065, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0065, ((Constant)args[0]).getValue()));
+ throw new QueryResolverException("ERR.015.008.0065", QueryPlugin.Util.getString("ERR.015.008.0065", ((Constant)args[0]).getValue())); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, ((Constant)args[0]).getValue()));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", ((Constant)args[0]).getValue())); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setGroup(groupSym);
@@ -803,7 +802,7 @@
try {
ResolverVisitor.resolveLanguageObject(returnElement, groups, metadata);
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, returnElementName));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", returnElementName)); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setReturnElement(returnElement);
@@ -812,7 +811,7 @@
try {
ResolverVisitor.resolveLanguageObject(keyElement, groups, metadata);
} catch(QueryMetadataException e) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0062, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0062, keyElementName));
+ throw new QueryResolverException("ERR.015.008.0062", QueryPlugin.Util.getString("ERR.015.008.0062", keyElementName)); //$NON-NLS-1$ //$NON-NLS-2$
}
result.setKeyElement(keyElement);
args[3] = convertExpression(args[3], DataTypeManager.getDataTypeName(keyElement.getType()), metadata);
@@ -891,7 +890,7 @@
// didn't find this group ID
}
} else if(matches > 1) {
- throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0055));
+ throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString("ERR.015.008.0055")); //$NON-NLS-1$
}
}
}
@@ -908,7 +907,7 @@
}
if(groupID == null) {
- throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0056));
+ throw handleUnresolvedGroup(symbol, QueryPlugin.Util.getString("ERR.015.008.0056")); //$NON-NLS-1$
}
// set real metadata ID in the symbol
symbol.setMetadataID(groupID);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -70,7 +70,6 @@
import org.teiid.query.sql.symbol.SearchedCaseExpression;
import org.teiid.query.sql.symbol.XMLQuery;
import org.teiid.query.sql.symbol.XMLSerialize;
-import org.teiid.query.util.ErrorMessageKeys;
public class ResolverVisitor extends LanguageVisitor {
@@ -184,7 +183,7 @@
resolveAgainstGroups(shortCanonicalName, matchedGroups, matches);
if (matches.size() > 1) {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0053, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0053", elementSymbol)); //$NON-NLS-1$
return;
}
@@ -199,9 +198,9 @@
if (matches.isEmpty()) {
if (groupMatched) {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0054, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0054", elementSymbol)); //$NON-NLS-1$
} else {
- handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0051, elementSymbol));
+ handleUnresolvedElement(elementSymbol, QueryPlugin.Util.getString("ERR.015.008.0051", elementSymbol)); //$NON-NLS-1$
}
return;
}
@@ -307,7 +306,7 @@
try {
resolveFunction(obj, this.metadata.getFunctionLibrary());
} catch(QueryResolverException e) {
- if (ErrorMessageKeys.RESOLVER_0036.equals(e.getCode()) || ErrorMessageKeys.RESOLVER_0035.equals(e.getCode())) {
+ if ("ERR.015.008.0036".equals(e.getCode()) || "ERR.015.008.0035".equals(e.getCode())) { //$NON-NLS-1$ //$NON-NLS-2$
if (unresolvedFunctions == null) {
unresolvedFunctions = new LinkedHashMap<Function, QueryResolverException>();
}
@@ -442,7 +441,7 @@
types[i] = args[i].getType();
if(types[i] == null) {
if(!(args[i] instanceof Reference)){
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0035, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0035, new Object[] {args[i], function}));
+ throw new QueryResolverException("ERR.015.008.0035", QueryPlugin.Util.getString("ERR.015.008.0035", new Object[] {args[i], function})); //$NON-NLS-1$ //$NON-NLS-2$
}
hasArgWithoutType = true;
}
@@ -466,14 +465,14 @@
FunctionForm form = library.findFunctionForm(function.getName(), args.length);
if(form == null) {
// Unknown function form
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0039, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0039, function));
+ throw new QueryResolverException("ERR.015.008.0039", QueryPlugin.Util.getString("ERR.015.008.0039", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Known function form - but without type information
if (hasArgWithoutType) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0036, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0036, function));
+ throw new QueryResolverException("ERR.015.008.0036", QueryPlugin.Util.getString("ERR.015.008.0036", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Known function form - unable to find implicit conversions
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0040, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0040, function));
+ throw new QueryResolverException("ERR.015.008.0040", QueryPlugin.Util.getString("ERR.015.008.0040", function)); //$NON-NLS-1$ //$NON-NLS-2$
}
if(fd.getName().equalsIgnoreCase(FunctionLibrary.CONVERT) || fd.getName().equalsIgnoreCase(FunctionLibrary.CAST)) {
@@ -487,7 +486,7 @@
!srcTypeClass.equals(dataTypeClass) &&
!DataTypeManager.isTransformable(srcTypeClass, dataTypeClass)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0037, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0037, new Object[] {DataTypeManager.getDataTypeName(srcTypeClass), dataType}));
+ throw new QueryResolverException("ERR.015.008.0037", QueryPlugin.Util.getString("ERR.015.008.0037", new Object[] {DataTypeManager.getDataTypeName(srcTypeClass), dataType})); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
ResolverUtil.ResolvedLookup lookup = ResolverUtil.resolveLookup(function, metadata);
@@ -588,7 +587,7 @@
criteria.setUpperExpression(ResolverUtil.convertExpression(upper, upperTypeName, commonType, metadata));
} else {
// Couldn't find a common type to implicitly convert to
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0027, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0027, expTypeName, lowerTypeName, criteria));
+ throw new QueryResolverException("ERR.015.008.0027", QueryPlugin.Util.getString("ERR.015.008.0027", expTypeName, lowerTypeName, criteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
// invariants: exp.getType() == lower.getType() == upper.getType()
}
@@ -649,7 +648,7 @@
if (commonType == null) {
// Neither are aggs, but types can't be reconciled
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0027, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0027, new Object[] { leftTypeName, rightTypeName, ccrit }));
+ throw new QueryResolverException("ERR.015.008.0027", QueryPlugin.Util.getString("ERR.015.008.0027", new Object[] { leftTypeName, rightTypeName, ccrit })); //$NON-NLS-1$ //$NON-NLS-2$
}
ccrit.setLeftExpression(ResolverUtil.convertExpression(leftExpression, leftTypeName, commonType, metadata) );
ccrit.setRightExpression(ResolverUtil.convertExpression(rightExpression, rightTypeName, commonType, metadata) );
@@ -690,7 +689,7 @@
result = ResolverUtil.convertExpression(expr, type, DataTypeManager.DefaultDataTypes.CLOB, metadata);
} else {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0029, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0029, mcrit));
+ throw new QueryResolverException("ERR.015.008.0029", QueryPlugin.Util.getString("ERR.015.008.0029", mcrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@@ -703,7 +702,7 @@
// Check that each of the values are the same type as expression
Class exprType = scrit.getExpression().getType();
if(exprType == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, scrit.getExpression()));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", scrit.getExpression())); //$NON-NLS-1$ //$NON-NLS-2$
}
String exprTypeName = DataTypeManager.getDataTypeName(exprType);
@@ -744,9 +743,9 @@
while(valIter.hasNext()) {
Expression value = (Expression) valIter.next();
if(value.getType() == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0030, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0030, value));
+ throw new QueryResolverException("ERR.015.008.0030", QueryPlugin.Util.getString("ERR.015.008.0030", value)); //$NON-NLS-1$ //$NON-NLS-2$
} else if(! value.getType().equals(setType)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0031, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0031, scrit));
+ throw new QueryResolverException("ERR.015.008.0031", QueryPlugin.Util.getString("ERR.015.008.0031", scrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -754,7 +753,7 @@
scrit.setExpression(ResolverUtil.convertExpression(scrit.getExpression(), exprTypeName, setTypeName, metadata));
} else {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0031, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0031, scrit));
+ throw new QueryResolverException("ERR.015.008.0031", QueryPlugin.Util.getString("ERR.015.008.0031", scrit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -828,11 +827,11 @@
// 3. Perform implicit type conversions
String whenTypeName = ResolverUtil.getCommonType((String[])whenTypeNames.toArray(new String[whenTypeNames.size()]));
if (whenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "WHEN", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "WHEN", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
String thenTypeName = ResolverUtil.getCommonType((String[])thenTypeNames.toArray(new String[thenTypeNames.size()]));
if (thenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "THEN/ELSE", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "THEN/ELSE", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
obj.setExpression(ResolverUtil.convertExpression(obj.getExpression(), whenTypeName, metadata));
ArrayList whens = new ArrayList(whenCount);
@@ -918,7 +917,7 @@
// 3. Perform implicit type conversions
String thenTypeName = ResolverUtil.getCommonType((String[])thenTypeNames.toArray(new String[thenTypeNames.size()]));
if (thenTypeName == null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0068, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0068, "THEN/ELSE", obj)); //$NON-NLS-1$
+ throw new QueryResolverException("ERR.015.008.0068", QueryPlugin.Util.getString("ERR.015.008.0068", "THEN/ELSE", obj)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
ArrayList thens = new ArrayList(whenCount);
for (int i = 0; i < whenCount; i++) {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -150,7 +150,6 @@
import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
import org.teiid.query.sql.visitor.EvaluatableVisitor.EvaluationLevel;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.translator.SourceSystemFunctions;
@@ -590,7 +589,7 @@
try {
ResolverVisitor.resolveLanguageObject(translatedCriteria, metadata);
} catch(TeiidException ex) {
- throw new QueryValidatorException(ex, ErrorMessageKeys.REWRITER_0002, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0002, translatedCriteria));
+ throw new QueryValidatorException(ex, "ERR.015.009.0002", QueryExecPlugin.Util.getString("ERR.015.009.0002", translatedCriteria)); //$NON-NLS-1$ //$NON-NLS-2$
}
return translatedCriteria;
@@ -1168,7 +1167,7 @@
return FALSE_CRITERIA;
} catch(ExpressionEvaluationException e) {
- throw new QueryValidatorException(e, ErrorMessageKeys.REWRITER_0001, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0001, crit));
+ throw new QueryValidatorException(e, "ERR.015.009.0001", QueryExecPlugin.Util.getString("ERR.015.009.0001", crit)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -1383,7 +1382,7 @@
Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() } );
combinedConst = new Constant(result, descriptor.getReturnType());
} catch(FunctionExecutionException e) {
- throw new QueryValidatorException(e, ErrorMessageKeys.REWRITER_0003, QueryExecPlugin.Util.getString(ErrorMessageKeys.REWRITER_0003, e.getMessage()));
+ throw new QueryValidatorException(e, "ERR.015.009.0003", QueryExecPlugin.Util.getString("ERR.015.009.0003", e.getMessage())); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
Function conversion = new Function(descriptor.getName(), new Expression[] { rightExpr, const1 });
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/AbstractCompareCriteria.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -24,7 +24,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* <p>The common functionality of a {@link CompareCriteria} and a
@@ -79,7 +78,7 @@
*/
public void setOperator( int operator ) {
if (operator < EQ || operator > GE) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0001, operator));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0001", operator)); //$NON-NLS-1$
}
this.operator = operator;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/CompoundCriteria.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -30,7 +30,6 @@
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -128,7 +127,7 @@
*/
public void setOperator(int operator) {
if (!isValidOperator(operator)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0002, operator));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0002", operator)); //$NON-NLS-1$
}
this.operator = operator;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/GroupBy.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -34,7 +34,6 @@
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -105,7 +104,7 @@
*/
public void replaceSymbols( Collection symbols ) {
if(symbols == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0003));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0003")); //$NON-NLS-1$
}
this.symbols = new ArrayList(symbols);
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/SPParameter.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -33,7 +33,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -126,7 +125,7 @@
public void setParameterType(int parameterType){
// validate against above types
if(parameterType < ParameterInfo.IN || parameterType > ParameterInfo.RESULT_SET) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0006, parameterType));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0006", parameterType)); //$NON-NLS-1$
}
this.parameterType = parameterType;
}
@@ -244,7 +243,7 @@
*/
public ElementSymbol getResultSetColumn(int position){
if(resultSetColumns == null){
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0009));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0009")); //$NON-NLS-1$
}
//position is 1 based
@@ -252,7 +251,7 @@
if(position >= 0 && position < resultSetColumns.size()) {
return (ElementSymbol) resultSetColumns.get(position);
}
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0010, new Integer(position + 1)));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0010", new Integer(position + 1))); //$NON-NLS-1$
}
/**
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/lang/StoredProcedure.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -39,7 +39,6 @@
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -149,7 +148,7 @@
*/
public void setParameter(SPParameter parameter){
if(parameter == null){
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0011));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0011")); //$NON-NLS-1$
}
Integer key = new Integer(parameter.getIndex());
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/AliasSymbol.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -25,7 +25,6 @@
import org.teiid.core.util.Assertion;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -74,7 +73,7 @@
*/
public void setSymbol(SingleElementSymbol symbol) {
if(symbol instanceof AliasSymbol || symbol == null){
- Assertion.failed(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0029));
+ Assertion.failed(QueryPlugin.Util.getString("ERR.015.010.0029")); //$NON-NLS-1$
}
this.symbol = symbol;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/CaseExpression.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
public class CaseExpression extends AbstractCaseExpression {
@@ -68,7 +67,7 @@
*/
public void setExpression(Expression expr) {
if (expr == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0035));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0035")); //$NON-NLS-1$
}
this.expression = expr;
}
@@ -106,18 +105,18 @@
*/
public void setWhen(List when, List then) {
if (when == null || then == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
if (when.size() != then.size() ||
when.size() < 1) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
for (int i = 0 ; i < when.size(); i++) {
if (!(when.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0037));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0037")); //$NON-NLS-1$
}
if (!(then.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0038));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$
}
}
if (this.when != when) {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Constant.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -58,10 +57,10 @@
// Check that type is valid, then set it
if(type == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0014));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0014")); //$NON-NLS-1$
}
if(! DataTypeManager.getAllDataTypeClasses().contains(type)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0015, type.getName()));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0015", type.getName())); //$NON-NLS-1$
}
assert value == null || type.isAssignableFrom(value.getClass()) : "Invalid value for specified type."; //$NON-NLS-1$
this.type = type;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/GroupSymbol.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -24,7 +24,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* <p>This is the server's representation of a metadata group symbol. The group
@@ -132,7 +131,7 @@
*/
public void setMetadataID(Object metadataID) {
if(metadataID == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0016));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0016")); //$NON-NLS-1$
}
this.metadataID = metadataID;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/SearchedCaseExpression.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -29,7 +29,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.util.ErrorMessageKeys;
public class SearchedCaseExpression extends AbstractCaseExpression {
@@ -81,18 +80,18 @@
*/
public void setWhen(List when, List then) {
if (when == null || then == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
if (when.size() != then.size() ||
when.size() < 1) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0036));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0036")); //$NON-NLS-1$
}
for (int i = 0 ; i < when.size(); i++) {
if (!(when.get(i) instanceof Criteria)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0039));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0039")); //$NON-NLS-1$
}
if (!(then.get(i) instanceof Expression)) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0038));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0038")); //$NON-NLS-1$
}
}
if (this.when != when) {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/symbol/Symbol.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -26,7 +26,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.visitor.SQLStringVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -91,7 +90,7 @@
*/
public void setName(String name) {
if(name == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0017));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0017")); //$NON-NLS-1$
}
this.name = name;
this.outputName = null;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/UpdateProcedureGenerator.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.proc.*;
import org.teiid.query.sql.symbol.*;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.validator.UpdateValidationVisitor;
import org.teiid.query.validator.ValidatorReport;
@@ -164,7 +163,7 @@
throws TeiidComponentException, QueryMetadataException{
if(physicalElements.size()!= virtualElements.size()) {
- throw new QueryMetadataException(ErrorMessageKeys.SQL_0018, QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0018));
+ throw new QueryMetadataException("ERR.015.010.0018", QueryPlugin.Util.getString("ERR.015.010.0018")); //$NON-NLS-1$ //$NON-NLS-2$
}
//match the physical group elements to the virtual group elements
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/util/VariableContext.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -28,7 +28,6 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.query.QueryPlugin;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
public class VariableContext {
@@ -66,7 +65,7 @@
}
Object value = variableMap.get(variable);
if (value == null && !variableMap.containsKey(variable)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, variable, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", variable, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/ElementCollectorVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.symbol.AllInGroupSymbol;
import org.teiid.query.sql.symbol.AllSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -60,7 +59,7 @@
*/
public ElementCollectorVisitor(Collection<ElementSymbol> elements) {
if(elements == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0021));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0021")); //$NON-NLS-1$
}
this.elements = elements;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/FunctionCollectorVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -32,7 +32,6 @@
import org.teiid.query.sql.navigator.DeepPreOrderNavigator;
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -71,7 +70,7 @@
*/
public FunctionCollectorVisitor(Collection functions, String functionName) {
if(functions == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0022));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0022")); //$NON-NLS-1$
}
this.functions = functions;
this.functionName = functionName;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/sql/visitor/GroupCollectorVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.navigator.DeepPreOrderNavigator;
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -66,7 +65,7 @@
*/
public GroupCollectorVisitor(Collection<GroupSymbol> groups) {
if(groups == null) {
- throw new IllegalArgumentException(QueryPlugin.Util.getString(ErrorMessageKeys.SQL_0023));
+ throw new IllegalArgumentException(QueryPlugin.Util.getString("ERR.015.010.0023")); //$NON-NLS-1$
}
this.groups = groups;
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/util/CommandContext.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/util/CommandContext.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -401,11 +401,11 @@
public Object getFromContext(Expression expression) throws TeiidComponentException {
if (variableContext == null || !(expression instanceof ElementSymbol)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
Object value = variableContext.getValue((ElementSymbol)expression);
if (value == null && !variableContext.containsVariable((ElementSymbol)expression)) {
- throw new TeiidComponentException(ErrorMessageKeys.PROCESSOR_0033, QueryPlugin.Util.getString(ErrorMessageKeys.PROCESSOR_0033, expression, "No value was available")); //$NON-NLS-1$
+ throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return value;
}
Deleted: branches/7.1.x/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/util/ErrorMessageKeys.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -1,409 +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.
- */
-
-/*
- * Date: Apr 3, 2003
- * Time: 11:01:10 AM
- */
-package org.teiid.query.util;
-
-/**
- * LogMessageKeys.
- *
- * <p>Error messages for query project (015) to address internationalization.</p>
- *
- */
-public class ErrorMessageKeys {
-
- /** function package (001) */
- public static final String FUNCTION_0001 = "ERR.015.001.0001"; //$NON-NLS-1$
- public static final String FUNCTION_0002 = "ERR.015.001.0002"; //$NON-NLS-1$
- public static final String FUNCTION_0003 = "ERR.015.001.0003"; //$NON-NLS-1$
- public static final String FUNCTION_0004 = "ERR.015.001.0004"; //$NON-NLS-1$
- public static final String FUNCTION_0005 = "ERR.015.001.0005"; //$NON-NLS-1$
- public static final String FUNCTION_0006 = "ERR.015.001.0006"; //$NON-NLS-1$
- public static final String FUNCTION_0007 = "ERR.015.001.0007"; //$NON-NLS-1$
- public static final String FUNCTION_0008 = "ERR.015.001.0008"; //$NON-NLS-1$
- public static final String FUNCTION_0009 = "ERR.015.001.0009"; //$NON-NLS-1$
- public static final String FUNCTION_0010 = "ERR.015.001.0010"; //$NON-NLS-1$
- public static final String FUNCTION_0011 = "ERR.015.001.0011"; //$NON-NLS-1$
- public static final String FUNCTION_0012 = "ERR.015.001.0012"; //$NON-NLS-1$
- public static final String FUNCTION_0013 = "ERR.015.001.0013"; //$NON-NLS-1$
- public static final String FUNCTION_0014 = "ERR.015.001.0014"; //$NON-NLS-1$
- public static final String FUNCTION_0015 = "ERR.015.001.0015"; //$NON-NLS-1$
- public static final String FUNCTION_0016 = "ERR.015.001.0016"; //$NON-NLS-1$
- public static final String FUNCTION_0017 = "ERR.015.001.0017"; //$NON-NLS-1$
- public static final String FUNCTION_0018 = "ERR.015.001.0018"; //$NON-NLS-1$
- public static final String FUNCTION_0019 = "ERR.015.001.0019"; //$NON-NLS-1$
- public static final String FUNCTION_0020 = "ERR.015.001.0020"; //$NON-NLS-1$
- public static final String FUNCTION_0021 = "ERR.015.001.0021"; //$NON-NLS-1$
- public static final String FUNCTION_0022 = "ERR.015.001.0022"; //$NON-NLS-1$
- public static final String FUNCTION_0024 = "ERR.015.001.0024"; //$NON-NLS-1$
- public static final String FUNCTION_0025 = "ERR.015.001.0025"; //$NON-NLS-1$
- public static final String FUNCTION_0026 = "ERR.015.001.0026"; //$NON-NLS-1$
- public static final String FUNCTION_0027 = "ERR.015.001.0027"; //$NON-NLS-1$
- public static final String FUNCTION_0028 = "ERR.015.001.0028"; //$NON-NLS-1$
- public static final String FUNCTION_0029 = "ERR.015.001.0029"; //$NON-NLS-1$
- public static final String FUNCTION_0030 = "ERR.015.001.0030"; //$NON-NLS-1$
- public static final String FUNCTION_0031 = "ERR.015.001.0031"; //$NON-NLS-1$
- public static final String FUNCTION_0032 = "ERR.015.001.0032"; //$NON-NLS-1$
- public static final String FUNCTION_0033 = "ERR.015.001.0033"; //$NON-NLS-1$
- public static final String FUNCTION_0034 = "ERR.015.001.0034"; //$NON-NLS-1$
- public static final String FUNCTION_0035 = "ERR.015.001.0035"; //$NON-NLS-1$
- public static final String FUNCTION_0035a = "ERR.015.001.0035a"; //$NON-NLS-1$
- public static final String FUNCTION_0036 = "ERR.015.001.0036"; //$NON-NLS-1$
- public static final String FUNCTION_0037 = "ERR.015.001.0037"; //$NON-NLS-1$
- public static final String FUNCTION_0038 = "ERR.015.001.0038"; //$NON-NLS-1$
- public static final String FUNCTION_0039 = "ERR.015.001.0039"; //$NON-NLS-1$
- public static final String FUNCTION_0040 = "ERR.015.001.0040"; //$NON-NLS-1$
- public static final String FUNCTION_0041 = "ERR.015.001.0041"; //$NON-NLS-1$
- public static final String FUNCTION_0042 = "ERR.015.001.0042"; //$NON-NLS-1$
- public static final String FUNCTION_0043 = "ERR.015.001.0043"; //$NON-NLS-1$
- public static final String FUNCTION_0044 = "ERR.015.001.0044"; //$NON-NLS-1$
- public static final String FUNCTION_0045 = "ERR.015.001.0045"; //$NON-NLS-1$
- public static final String FUNCTION_0046 = "ERR.015.001.0046"; //$NON-NLS-1$
- public static final String FUNCTION_0047 = "ERR.015.001.0047"; //$NON-NLS-1$
- public static final String FUNCTION_0048 = "ERR.015.001.0048"; //$NON-NLS-1$
- public static final String FUNCTION_0050 = "ERR.015.001.0050"; //$NON-NLS-1$
- public static final String FUNCTION_0051 = "ERR.015.001.0051"; //$NON-NLS-1$
- public static final String FUNCTION_0052 = "ERR.015.001.0052"; //$NON-NLS-1$
- public static final String FUNCTION_0053 = "ERR.015.001.0053"; //$NON-NLS-1$
- public static final String FUNCTION_0054 = "ERR.015.001.0054"; //$NON-NLS-1$
- public static final String FUNCTION_0055 = "ERR.015.001.0055"; //$NON-NLS-1$
- public static final String FUNCTION_0056 = "ERR.015.001.0056"; //$NON-NLS-1$
- public static final String FUNCTION_0057 = "ERR.015.001.0057"; //$NON-NLS-1$
- public static final String FUNCTION_0058 = "ERR.015.001.0058"; //$NON-NLS-1$
- public static final String FUNCTION_0059 = "ERR.015.001.0059"; //$NON-NLS-1$
- public static final String FUNCTION_0060 = "ERR.015.001.0060"; //$NON-NLS-1$
- public static final String FUNCTION_0061 = "ERR.015.001.0061"; //$NON-NLS-1$
- public static final String FUNCTION_0062 = "ERR.015.001.0062"; //$NON-NLS-1$
- public static final String FUNCTION_0063 = "ERR.015.001.0063"; //$NON-NLS-1$
- public static final String FUNCTION_0064 = "ERR.015.001.0064"; //$NON-NLS-1$
- public static final String FUNCTION_0065 = "ERR.015.001.0065"; //$NON-NLS-1$
- public static final String FUNCTION_0066 = "ERR.015.001.0066"; //$NON-NLS-1$
- public static final String FUNCTION_0067 = "ERR.015.001.0067"; //$NON-NLS-1$
- public static final String FUNCTION_0068 = "ERR.015.001.0068"; //$NON-NLS-1$
- public static final String FUNCTION_0069 = "ERR.015.001.0069"; //$NON-NLS-1$
- public static final String FUNCTION_0070 = "ERR.015.001.0070"; //$NON-NLS-1$
- public static final String FUNCTION_0071 = "ERR.015.001.0071"; //$NON-NLS-1$
-
- /** mapping package (002) */
- public static final String MAPPING_0008 = "ERR.015.002.0008"; //$NON-NLS-1$
- public static final String MAPPING_0009 = "ERR.015.002.0009"; //$NON-NLS-1$
- public static final String MAPPING_0010 = "ERR.015.002.0010"; //$NON-NLS-1$
- public static final String MAPPING_0011 = "ERR.015.002.0011"; //$NON-NLS-1$
- public static final String MAPPING_0012 = "ERR.015.002.0012"; //$NON-NLS-1$
-
- /** optimizer package (004) */
- public static final String OPTIMIZER_0002 = "ERR.015.004.0002"; //$NON-NLS-1$
- public static final String OPTIMIZER_0005 = "ERR.015.004.0005"; //$NON-NLS-1$
- public static final String OPTIMIZER_0006 = "ERR.015.004.0006"; //$NON-NLS-1$
- public static final String OPTIMIZER_0007 = "ERR.015.004.0007"; //$NON-NLS-1$
- public static final String OPTIMIZER_0008 = "ERR.015.004.0008"; //$NON-NLS-1$
- public static final String OPTIMIZER_0009 = "ERR.015.004.0009"; //$NON-NLS-1$
- public static final String OPTIMIZER_0010 = "ERR.015.004.0010"; //$NON-NLS-1$
- public static final String OPTIMIZER_0011 = "ERR.015.004.0011"; //$NON-NLS-1$
- public static final String OPTIMIZER_0012 = "ERR.015.004.0012"; //$NON-NLS-1$
- public static final String OPTIMIZER_0014 = "ERR.015.004.0014"; //$NON-NLS-1$
- public static final String OPTIMIZER_0015 = "ERR.015.004.0015"; //$NON-NLS-1$
- public static final String OPTIMIZER_0016 = "ERR.015.004.0016"; //$NON-NLS-1$
- public static final String OPTIMIZER_0017 = "ERR.015.004.0017"; //$NON-NLS-1$
- public static final String OPTIMIZER_0019 = "ERR.015.004.0019"; //$NON-NLS-1$
- public static final String OPTIMIZER_0020 = "ERR.015.004.0020"; //$NON-NLS-1$
- public static final String OPTIMIZER_0021 = "ERR.015.004.0021"; //$NON-NLS-1$
- public static final String OPTIMIZER_0023 = "ERR.015.004.0023"; //$NON-NLS-1$
- public static final String OPTIMIZER_0024 = "ERR.015.004.0024"; //$NON-NLS-1$
- public static final String OPTIMIZER_0026 = "ERR.015.004.0026"; //$NON-NLS-1$
- public static final String OPTIMIZER_0029 = "ERR.015.004.0029"; //$NON-NLS-1$
- public static final String OPTIMIZER_0033 = "ERR.015.004.0033"; //$NON-NLS-1$
- public static final String OPTIMIZER_0034 = "ERR.015.004.0034"; //$NON-NLS-1$
- public static final String OPTIMIZER_0035 = "ERR.015.004.0035"; //$NON-NLS-1$
- public static final String OPTIMIZER_0036 = "ERR.015.004.0036"; //$NON-NLS-1$
- public static final String OPTIMIZER_0037 = "ERR.015.004.0037"; //$NON-NLS-1$
- public static final String OPTIMIZER_0038 = "ERR.015.004.0038"; //$NON-NLS-1$
- public static final String OPTIMIZER_0040 = "ERR.015.004.0040"; //$NON-NLS-1$
- public static final String OPTIMIZER_0041 = "ERR.015.004.0041"; //$NON-NLS-1$
- public static final String OPTIMIZER_0042 = "ERR.015.004.0042"; //$NON-NLS-1$
- public static final String OPTIMIZER_0043 = "ERR.015.004.0043"; //$NON-NLS-1$
- public static final String OPTIMIZER_0044 = "ERR.015.004.0044"; //$NON-NLS-1$
- public static final String OPTIMIZER_0045 = "ERR.015.004.0045"; //$NON-NLS-1$
- public static final String OPTIMIZER_0046 = "ERR.015.004.0046"; //$NON-NLS-1$
- public static final String OPTIMIZER_0047 = "ERR.015.004.0047"; //$NON-NLS-1$
- public static final String OPTIMIZER_0048 = "ERR.015.004.0048"; //$NON-NLS-1$
- public static final String OPTIMIZER_0051 = "ERR.015.004.0051"; //$NON-NLS-1$
- public static final String OPTIMIZER_0053 = "ERR.015.004.0053"; //$NON-NLS-1$
- public static final String OPTIMIZER_0054 = "ERR.015.004.0054"; //$NON-NLS-1$
- public static final String OPTIMIZER_0055 = "ERR.015.004.0055"; //$NON-NLS-1$
- public static final String OPTIMIZER_0056 = "ERR.015.004.0056"; //$NON-NLS-1$
- public static final String OPTIMIZER_0057 = "ERR.015.004.0057"; //$NON-NLS-1$
- public static final String OPTIMIZER_0058 = "ERR.015.004.0058"; //$NON-NLS-1$
- public static final String OPTIMIZER_0059 = "ERR.015.004.0059"; //$NON-NLS-1$
- public static final String OPTIMIZER_0060 = "ERR.015.004.0060"; //$NON-NLS-1$
- public static final String OPTIMIZER_0061 = "ERR.015.004.0061"; //$NON-NLS-1$
- public static final String OPTIMIZER_0063 = "ERR.015.004.0063"; //$NON-NLS-1$
- public static final String OPTIMIZER_0064 = "ERR.015.004.0064"; //$NON-NLS-1$
- public static final String OPTIMIZER_0066 = "ERR.015.004.0066"; //$NON-NLS-1$
- public static final String OPTIMIZER_0067 = "ERR.015.004.0067"; //$NON-NLS-1$
- public static final String OPTIMIZER_0068 = "ERR.015.004.0068"; //$NON-NLS-1$
- public static final String OPTIMIZER_0069 = "ERR.015.004.0069"; //$NON-NLS-1$
- public static final String OPTIMIZER_0070 = "ERR.015.004.0070"; //$NON-NLS-1$
- public static final String OPTIMIZER_0071 = "ERR.015.004.0071"; //$NON-NLS-1$
-
- /** processor package (006) */
- public static final String PROCESSOR_0001 = "ERR.015.006.0001"; //$NON-NLS-1$
- public static final String PROCESSOR_0003 = "ERR.015.006.0003"; //$NON-NLS-1$
- public static final String PROCESSOR_0010 = "ERR.015.006.0010"; //$NON-NLS-1$
- public static final String PROCESSOR_0011 = "ERR.015.006.0011"; //$NON-NLS-1$
- public static final String PROCESSOR_0012 = "ERR.015.006.0012"; //$NON-NLS-1$
- public static final String PROCESSOR_0014 = "ERR.015.006.0014"; //$NON-NLS-1$
- public static final String PROCESSOR_0015 = "ERR.015.006.0015"; //$NON-NLS-1$
- public static final String PROCESSOR_0016 = "ERR.015.006.0016"; //$NON-NLS-1$
- public static final String PROCESSOR_0017 = "ERR.015.006.0017"; //$NON-NLS-1$
- public static final String PROCESSOR_0019 = "ERR.015.006.0019"; //$NON-NLS-1$
- public static final String PROCESSOR_0020 = "ERR.015.006.0020"; //$NON-NLS-1$
- public static final String PROCESSOR_0021 = "ERR.015.006.0021"; //$NON-NLS-1$
- public static final String PROCESSOR_0022 = "ERR.015.006.0022"; //$NON-NLS-1$
- public static final String PROCESSOR_0023 = "ERR.015.006.0023"; //$NON-NLS-1$
- public static final String PROCESSOR_0024 = "ERR.015.006.0024"; //$NON-NLS-1$
- public static final String PROCESSOR_0025 = "ERR.015.006.0025"; //$NON-NLS-1$
- public static final String PROCESSOR_0026 = "ERR.015.006.0026"; //$NON-NLS-1$
- public static final String PROCESSOR_0027 = "ERR.015.006.0027"; //$NON-NLS-1$
- public static final String PROCESSOR_0029 = "ERR.015.006.0029"; //$NON-NLS-1$
- public static final String PROCESSOR_0032 = "ERR.015.006.0032"; //$NON-NLS-1$
- public static final String PROCESSOR_0033 = "ERR.015.006.0033"; //$NON-NLS-1$
- public static final String PROCESSOR_0034 = "ERR.015.006.0034"; //$NON-NLS-1$
- public static final String PROCESSOR_0035 = "ERR.015.006.0035"; //$NON-NLS-1$
- public static final String PROCESSOR_0037 = "ERR.015.006.0037"; //$NON-NLS-1$
- public static final String PROCESSOR_0038 = "ERR.015.006.0038"; //$NON-NLS-1$
- public static final String PROCESSOR_0039 = "ERR.015.006.0039"; //$NON-NLS-1$
- public static final String PROCESSOR_0040 = "ERR.015.006.0040"; //$NON-NLS-1$
- public static final String PROCESSOR_0041 = "ERR.015.006.0041"; //$NON-NLS-1$
- public static final String PROCESSOR_0042 = "ERR.015.006.0042"; //$NON-NLS-1$
- public static final String PROCESSOR_0046 = "ERR.015.006.0046"; //$NON-NLS-1$
- public static final String PROCESSOR_0047 = "ERR.015.006.0047"; //$NON-NLS-1$
- public static final String PROCESSOR_0048 = "ERR.015.006.0048"; //$NON-NLS-1$
- public static final String PROCESSOR_0049 = "ERR.015.006.0049"; //$NON-NLS-1$
- public static final String PROCESSOR_0050 = "ERR.015.006.0050"; //$NON-NLS-1$
- public static final String PROCESSOR_0051 = "ERR.015.006.0051"; //$NON-NLS-1$
- public static final String PROCESSOR_0052 = "ERR.015.006.0052"; //$NON-NLS-1$
- public static final String PROCESSOR_0054 = "ERR.015.006.0054"; //$NON-NLS-1$
- public static final String PROCESSOR_0055 = "ERR.015.006.0055"; //$NON-NLS-1$
- public static final String PROCESSOR_0056 = "ERR.015.006.0056"; //$NON-NLS-1$
- public static final String PROCESSOR_0057 = "ERR.015.006.0057"; //$NON-NLS-1$
- public static final String PROCESSOR_0058 = "ERR.015.006.0058"; //$NON-NLS-1$
- public static final String PROCESSOR_0060 = "ERR.015.006.0060"; //$NON-NLS-1$
- public static final String PROCESSOR_0061 = "ERR.015.006.0061"; //$NON-NLS-1$
-
- /** report package (007) */
- public static final String REPORT_0001 = "ERR.015.007.0001"; //$NON-NLS-1$
-
- /** resolver package (008) */
- public static final String RESOLVER_0001 = "ERR.015.008.0001"; //$NON-NLS-1$
- public static final String RESOLVER_0002 = "ERR.015.008.0002"; //$NON-NLS-1$
- public static final String RESOLVER_0003 = "ERR.015.008.0003"; //$NON-NLS-1$
- public static final String RESOLVER_0004 = "ERR.015.008.0004"; //$NON-NLS-1$
- public static final String RESOLVER_0005 = "ERR.015.008.0005"; //$NON-NLS-1$
- public static final String RESOLVER_0006 = "ERR.015.008.0006"; //$NON-NLS-1$
- public static final String RESOLVER_0007 = "ERR.015.008.0007"; //$NON-NLS-1$
- public static final String RESOLVER_0008 = "ERR.015.008.0008"; //$NON-NLS-1$
- public static final String RESOLVER_0009 = "ERR.015.008.0009"; //$NON-NLS-1$
- public static final String RESOLVER_0010 = "ERR.015.008.0010"; //$NON-NLS-1$
- public static final String RESOLVER_0011 = "ERR.015.008.0011"; //$NON-NLS-1$
- public static final String RESOLVER_0012 = "ERR.015.008.0012"; //$NON-NLS-1$
- public static final String RESOLVER_0013 = "ERR.015.008.0013"; //$NON-NLS-1$
- public static final String RESOLVER_0014 = "ERR.015.008.0014"; //$NON-NLS-1$
- public static final String RESOLVER_0015 = "ERR.015.008.0015"; //$NON-NLS-1$
- public static final String RESOLVER_0016 = "ERR.015.008.0016"; //$NON-NLS-1$
- public static final String RESOLVER_0017 = "ERR.015.008.0017"; //$NON-NLS-1$
- public static final String RESOLVER_0018 = "ERR.015.008.0018"; //$NON-NLS-1$
- public static final String RESOLVER_0019 = "ERR.015.008.0019"; //$NON-NLS-1$
- public static final String RESOLVER_0020 = "ERR.015.008.0020"; //$NON-NLS-1$
- public static final String RESOLVER_0021 = "ERR.015.008.0021"; //$NON-NLS-1$
- public static final String RESOLVER_0022 = "ERR.015.008.0022"; //$NON-NLS-1$
- public static final String RESOLVER_0023 = "ERR.015.008.0023"; //$NON-NLS-1$
- public static final String RESOLVER_0024 = "ERR.015.008.0024"; //$NON-NLS-1$
- public static final String RESOLVER_0025 = "ERR.015.008.0025"; //$NON-NLS-1$
- public static final String RESOLVER_0026 = "ERR.015.008.0026"; //$NON-NLS-1$
- public static final String RESOLVER_0027 = "ERR.015.008.0027"; //$NON-NLS-1$
- public static final String RESOLVER_0028 = "ERR.015.008.0028"; //$NON-NLS-1$
- public static final String RESOLVER_0029 = "ERR.015.008.0029"; //$NON-NLS-1$
- public static final String RESOLVER_0030 = "ERR.015.008.0030"; //$NON-NLS-1$
- public static final String RESOLVER_0031 = "ERR.015.008.0031"; //$NON-NLS-1$
- public static final String RESOLVER_0032 = "ERR.015.008.0032"; //$NON-NLS-1$
- public static final String RESOLVER_0033 = "ERR.015.008.0033"; //$NON-NLS-1$
- public static final String RESOLVER_0034 = "ERR.015.008.0034"; //$NON-NLS-1$
- public static final String RESOLVER_0035 = "ERR.015.008.0035"; //$NON-NLS-1$
- public static final String RESOLVER_0036 = "ERR.015.008.0036"; //$NON-NLS-1$
- public static final String RESOLVER_0037 = "ERR.015.008.0037"; //$NON-NLS-1$
- public static final String RESOLVER_0038 = "ERR.015.008.0038"; //$NON-NLS-1$
- public static final String RESOLVER_0039 = "ERR.015.008.0039"; //$NON-NLS-1$
- public static final String RESOLVER_0040 = "ERR.015.008.0040"; //$NON-NLS-1$
- public static final String RESOLVER_0041 = "ERR.015.008.0041"; //$NON-NLS-1$
- public static final String RESOLVER_0042 = "ERR.015.008.0042"; //$NON-NLS-1$
- public static final String RESOLVER_0043 = "ERR.015.008.0043"; //$NON-NLS-1$
- public static final String RESOLVER_0044 = "ERR.015.008.0044"; //$NON-NLS-1$
- public static final String RESOLVER_0045 = "ERR.015.008.0045"; //$NON-NLS-1$
- public static final String RESOLVER_0046 = "ERR.015.008.0046"; //$NON-NLS-1$
- public static final String RESOLVER_0047 = "ERR.015.008.0047"; //$NON-NLS-1$
- public static final String RESOLVER_0048 = "ERR.015.008.0048"; //$NON-NLS-1$
- public static final String RESOLVER_0049 = "ERR.015.008.0049"; //$NON-NLS-1$
- public static final String RESOLVER_0050 = "ERR.015.008.0050"; //$NON-NLS-1$
- public static final String RESOLVER_0051 = "ERR.015.008.0051"; //$NON-NLS-1$
- public static final String RESOLVER_0052 = "ERR.015.008.0052"; //$NON-NLS-1$
- public static final String RESOLVER_0053 = "ERR.015.008.0053"; //$NON-NLS-1$
- public static final String RESOLVER_0054 = "ERR.015.008.0054"; //$NON-NLS-1$
- public static final String RESOLVER_0055 = "ERR.015.008.0055"; //$NON-NLS-1$
- public static final String RESOLVER_0056 = "ERR.015.008.0056"; //$NON-NLS-1$
- public static final String RESOLVER_0057 = "ERR.015.008.0057"; //$NON-NLS-1$
- public static final String RESOLVER_0058 = "ERR.015.008.0058"; //$NON-NLS-1$
- public static final String RESOLVER_0059 = "ERR.015.008.0059"; //$NON-NLS-1$
- public static final String RESOLVER_0060 = "ERR.015.008.0060"; //$NON-NLS-1$
- public static final String RESOLVER_0061 = "ERR.015.008.0061"; //$NON-NLS-1$
- public static final String RESOLVER_0062 = "ERR.015.008.0062"; //$NON-NLS-1$
- public static final String RESOLVER_0063 = "ERR.015.008.0063"; //$NON-NLS-1$
- public static final String RESOLVER_0064 = "ERR.015.008.0064"; //$NON-NLS-1$
- public static final String RESOLVER_0065 = "ERR.015.008.0065"; //$NON-NLS-1$
- public static final String RESOLVER_0066 = "ERR.015.008.0066"; //$NON-NLS-1$
- public static final String RESOLVER_0067 = "ERR.015.008.0067"; //$NON-NLS-1$
- public static final String RESOLVER_0068 = "ERR.015.008.0068"; //$NON-NLS-1$
- public static final String RESOLVER_0069 = "ERR.015.008.0069"; //$NON-NLS-1$
- public static final String RESOLVER_0070 = "ERR.015.008.0070"; //$NON-NLS-1$
-
- /** rewriter package (009) */
- public static final String REWRITER_0001 = "ERR.015.009.0001"; //$NON-NLS-1$
- public static final String REWRITER_0002 = "ERR.015.009.0002"; //$NON-NLS-1$
- public static final String REWRITER_0003 = "ERR.015.009.0003"; //$NON-NLS-1$
- public static final String REWRITER_0004 = "ERR.015.009.0004"; //$NON-NLS-1$
- public static final String REWRITER_0005 = "ERR.015.009.0005"; //$NON-NLS-1$
-
- /** sql package (010) */
- public static final String SQL_0001 = "ERR.015.010.0001"; //$NON-NLS-1$
- public static final String SQL_0002 = "ERR.015.010.0002"; //$NON-NLS-1$
- public static final String SQL_0003 = "ERR.015.010.0003"; //$NON-NLS-1$
- public static final String SQL_0004 = "ERR.015.010.0004"; //$NON-NLS-1$
- public static final String SQL_0005 = "ERR.015.010.0005"; //$NON-NLS-1$
- public static final String SQL_0006 = "ERR.015.010.0006"; //$NON-NLS-1$
- public static final String SQL_0007 = "ERR.015.010.0007"; //$NON-NLS-1$
- public static final String SQL_0008 = "ERR.015.010.0008"; //$NON-NLS-1$
- public static final String SQL_0009 = "ERR.015.010.0009"; //$NON-NLS-1$
- public static final String SQL_0010 = "ERR.015.010.0010"; //$NON-NLS-1$
- public static final String SQL_0011 = "ERR.015.010.0011"; //$NON-NLS-1$
- public static final String SQL_0012 = "ERR.015.010.0012"; //$NON-NLS-1$
- public static final String SQL_0013 = "ERR.015.010.0013"; //$NON-NLS-1$
- public static final String SQL_0014 = "ERR.015.010.0014"; //$NON-NLS-1$
- public static final String SQL_0015 = "ERR.015.010.0015"; //$NON-NLS-1$
- public static final String SQL_0016 = "ERR.015.010.0016"; //$NON-NLS-1$
- public static final String SQL_0017 = "ERR.015.010.0017"; //$NON-NLS-1$
- public static final String SQL_0018 = "ERR.015.010.0018"; //$NON-NLS-1$
- public static final String SQL_0019 = "ERR.015.010.0019"; //$NON-NLS-1$
- public static final String SQL_0020 = "ERR.015.010.0020"; //$NON-NLS-1$
- public static final String SQL_0021 = "ERR.015.010.0021"; //$NON-NLS-1$
- public static final String SQL_0022 = "ERR.015.010.0022"; //$NON-NLS-1$
- public static final String SQL_0023 = "ERR.015.010.0023"; //$NON-NLS-1$
- public static final String SQL_0024 = "ERR.015.010.0024"; //$NON-NLS-1$
- public static final String SQL_0025 = "ERR.015.010.0025"; //$NON-NLS-1$
- public static final String SQL_0026 = "ERR.015.010.0026"; //$NON-NLS-1$
- public static final String SQL_0027 = "ERR.015.010.0027"; //$NON-NLS-1$
- public static final String SQL_0028 = "ERR.015.010.0028"; //$NON-NLS-1$
- public static final String SQL_0029 = "ERR.015.010.0029"; //$NON-NLS-1$
- public static final String SQL_0030 = "ERR.015.010.0030"; //$NON-NLS-1$
- public static final String SQL_0031 = "ERR.015.010.0031"; //$NON-NLS-1$
- public static final String SQL_0032 = "ERR.015.010.0032"; //$NON-NLS-1$
- public static final String SQL_0034 = "ERR.015.010.0034"; //$NON-NLS-1$
- public static final String SQL_0035 = "ERR.015.010.0035"; //$NON-NLS-1$
- public static final String SQL_0036 = "ERR.015.010.0036"; //$NON-NLS-1$
- public static final String SQL_0037 = "ERR.015.010.0037"; //$NON-NLS-1$
- public static final String SQL_0038 = "ERR.015.010.0038"; //$NON-NLS-1$
- public static final String SQL_0039 = "ERR.015.010.0039"; //$NON-NLS-1$
-
- /** util package (011) */
- public static final String UTIL_0001 = "ERR.015.011.0001"; //$NON-NLS-1$
-
- /** validator package (012) */
- public static final String VALIDATOR_0001 = "ERR.015.012.0001"; //$NON-NLS-1$
- public static final String VALIDATOR_0002 = "ERR.015.012.0002"; //$NON-NLS-1$
- public static final String VALIDATOR_0003 = "ERR.015.012.0003"; //$NON-NLS-1$
- public static final String VALIDATOR_0004 = "ERR.015.012.0004"; //$NON-NLS-1$
- public static final String VALIDATOR_0005 = "ERR.015.012.0005"; //$NON-NLS-1$
- public static final String VALIDATOR_0006 = "ERR.015.012.0006"; //$NON-NLS-1$
- public static final String VALIDATOR_0007 = "ERR.015.012.0007"; //$NON-NLS-1$
- public static final String VALIDATOR_0008 = "ERR.015.012.0008"; //$NON-NLS-1$
- public static final String VALIDATOR_0009 = "ERR.015.012.0009"; //$NON-NLS-1$
- public static final String VALIDATOR_0010 = "ERR.015.012.0010"; //$NON-NLS-1$
- public static final String VALIDATOR_0011 = "ERR.015.012.0011"; //$NON-NLS-1$
- public static final String VALIDATOR_0012 = "ERR.015.012.0012"; //$NON-NLS-1$
- public static final String VALIDATOR_0013 = "ERR.015.012.0013"; //$NON-NLS-1$
- public static final String VALIDATOR_0014 = "ERR.015.012.0014"; //$NON-NLS-1$
- public static final String VALIDATOR_0015 = "ERR.015.012.0015"; //$NON-NLS-1$
- public static final String VALIDATOR_0016 = "ERR.015.012.0016"; //$NON-NLS-1$
- public static final String VALIDATOR_0017 = "ERR.015.012.0017"; //$NON-NLS-1$
- public static final String VALIDATOR_0018 = "ERR.015.012.0018"; //$NON-NLS-1$
- public static final String VALIDATOR_0019 = "ERR.015.012.0019"; //$NON-NLS-1$
- public static final String VALIDATOR_0020 = "ERR.015.012.0020"; //$NON-NLS-1$
- public static final String VALIDATOR_0021 = "ERR.015.012.0021"; //$NON-NLS-1$
- public static final String VALIDATOR_0022 = "ERR.015.012.0022"; //$NON-NLS-1$
- public static final String VALIDATOR_0023 = "ERR.015.012.0023"; //$NON-NLS-1$
- public static final String VALIDATOR_0024 = "ERR.015.012.0024"; //$NON-NLS-1$
- public static final String VALIDATOR_0025 = "ERR.015.012.0025"; //$NON-NLS-1$
- public static final String VALIDATOR_0026 = "ERR.015.012.0026"; //$NON-NLS-1$
- public static final String VALIDATOR_0027 = "ERR.015.012.0027"; //$NON-NLS-1$
- public static final String VALIDATOR_0028 = "ERR.015.012.0028"; //$NON-NLS-1$
- public static final String VALIDATOR_0029 = "ERR.015.012.0029"; //$NON-NLS-1$
- public static final String VALIDATOR_0030 = "ERR.015.012.0030"; //$NON-NLS-1$
- public static final String VALIDATOR_0031 = "ERR.015.012.0031"; //$NON-NLS-1$
- public static final String VALIDATOR_0032 = "ERR.015.012.0032"; //$NON-NLS-1$
- public static final String VALIDATOR_0033 = "ERR.015.012.0033"; //$NON-NLS-1$
- public static final String VALIDATOR_0034 = "ERR.015.012.0034"; //$NON-NLS-1$
- public static final String VALIDATOR_0035 = "ERR.015.012.0035"; //$NON-NLS-1$
- public static final String VALIDATOR_0036 = "ERR.015.012.0036"; //$NON-NLS-1$
- public static final String VALIDATOR_0037 = "ERR.015.012.0037"; //$NON-NLS-1$
- public static final String VALIDATOR_0038 = "ERR.015.012.0038"; //$NON-NLS-1$
- public static final String VALIDATOR_0039 = "ERR.015.012.0039"; //$NON-NLS-1$
- public static final String VALIDATOR_0040 = "ERR.015.012.0040"; //$NON-NLS-1$
- public static final String VALIDATOR_0041 = "ERR.015.012.0041"; //$NON-NLS-1$
- public static final String VALIDATOR_0042 = "ERR.015.012.0042"; //$NON-NLS-1$
- public static final String VALIDATOR_0045 = "ERR.015.012.0045"; //$NON-NLS-1$
- public static final String VALIDATOR_0046 = "ERR.015.012.0046"; //$NON-NLS-1$
- public static final String VALIDATOR_0047 = "ERR.015.012.0047"; //$NON-NLS-1$
- public static final String VALIDATOR_0048 = "ERR.015.012.0048"; //$NON-NLS-1$
- public static final String VALIDATOR_0049 = "ERR.015.012.0049"; //$NON-NLS-1$
- public static final String VALIDATOR_0050 = "ERR.015.012.0050"; //$NON-NLS-1$
- public static final String VALIDATOR_0051 = "ERR.015.012.0051"; //$NON-NLS-1$
- public static final String VALIDATOR_0052 = "ERR.015.012.0052"; //$NON-NLS-1$
- public static final String VALIDATOR_0053 = "ERR.015.012.0053"; //$NON-NLS-1$
- public static final String VALIDATOR_0054 = "ERR.015.012.0054"; //$NON-NLS-1$
- public static final String VALIDATOR_0055 = "ERR.015.012.0055"; //$NON-NLS-1$
- public static final String VALIDATOR_0056 = "ERR.015.012.0056"; //$NON-NLS-1$
- public static final String VALIDATOR_0057 = "ERR.015.012.0057"; //$NON-NLS-1$
- public static final String VALIDATOR_0058 = "ERR.015.012.0058"; //$NON-NLS-1$
- public static final String VALIDATOR_0059 = "ERR.015.012.0059"; //$NON-NLS-1$
- public static final String VALIDATOR_0060 = "ERR.015.012.0060"; //$NON-NLS-1$
- public static final String VALIDATOR_0061 = "ERR.015.012.0061"; //$NON-NLS-1$
- public static final String VALIDATOR_0062 = "ERR.015.012.0062"; //$NON-NLS-1$
- public static final String VALIDATOR_0063 = "ERR.015.012.0063"; //$NON-NLS-1$
- public static final String VALIDATOR_0064 = "ERR.015.012.0064"; //$NON-NLS-1$
- public static final String VALIDATOR_0065 = "ERR.015.012.0065"; //$NON-NLS-1$
- public static final String VALIDATOR_0066 = "ERR.015.012.0066"; //$NON-NLS-1$
- public static final String VALIDATOR_0067 = "ERR.015.012.0067"; //$NON-NLS-1$
- public static final String VALIDATOR_0069 = "ERR.015.012.0069"; //$NON-NLS-1$
- public static final String VALIDATOR_0070 = "ERR.015.012.0070"; //$NON-NLS-1$
-}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/validator/AggregateValidationVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -39,7 +39,6 @@
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
* Validate that all ElementSymbol and ExpressionSymbols used in the HAVING
@@ -64,14 +63,14 @@
if(aggExp != null) {
Collection<AggregateSymbol> nestedAggs = AggregateSymbolCollectorVisitor.getAggregates(aggExp, true);
if(nestedAggs.size() > 0) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0039, nestedAggs), nestedAggs);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0039", nestedAggs), nestedAggs); //$NON-NLS-1$
}
}
// Verify data type of aggregate expression
Type aggregateFunction = obj.getAggregateFunction();
if((aggregateFunction == Type.SUM || aggregateFunction == Type.AVG) && obj.getType() == null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
} else if (obj.getType() != DataTypeManager.DefaultDataClasses.NULL) {
if (aggregateFunction == Type.XMLAGG && aggExp.getType() != DataTypeManager.DefaultDataClasses.XML) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
@@ -84,7 +83,7 @@
}
if(obj.isEnhancedNumeric()) {
if (!Number.class.isAssignableFrom(aggExp.getType())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0041, new Object[] {aggregateFunction, obj}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
if (obj.isDistinct()) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.invalid_distinct", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
@@ -121,11 +120,11 @@
if(groupExpressions == null) {
if (symbol instanceof ElementSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0037, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0037", symbol), symbol); //$NON-NLS-1$
}
} else if(! groupExpressions.contains(symbol)) {
if (symbol instanceof ElementSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0038, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0038", symbol), symbol); //$NON-NLS-1$
}
} else {
validateBelow = false;
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/validator/UpdateValidationVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -35,7 +35,6 @@
import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
/**
@@ -80,7 +79,7 @@
* @param obj The <code>SetQuery</code> object to be visited for validation
*/
public void visit(SetQuery obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0001));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0001")); //$NON-NLS-1$
}
/**
@@ -89,7 +88,7 @@
* @param obj The <code>StoredProcedure</code> object to be visited for validation
*/
public void visit(StoredProcedure obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0002));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0002")); //$NON-NLS-1$
}
/**
@@ -98,7 +97,7 @@
* @param obj The <code>Insert</code> object to be visited for validation
*/
public void visit(Insert obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0003));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0003")); //$NON-NLS-1$
}
/**
@@ -107,7 +106,7 @@
* @param obj The <code>Update</code> object to be visited for validation
*/
public void visit(Update obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0004));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0004")); //$NON-NLS-1$
}
/**
@@ -116,7 +115,7 @@
* @param obj The <code>Delete</code> object to be visited for validation
*/
public void visit(Delete obj) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0005));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0005")); //$NON-NLS-1$
}
/**
@@ -126,7 +125,7 @@
*/
public void visit(Query obj) {
if((obj.getGroupBy() != null) || (obj.getHaving() != null)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0006));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0006")); //$NON-NLS-1$
}
}
@@ -149,7 +148,7 @@
Expression ex = SymbolMap.getExpression(symbol);
if (!(ex instanceof ElementSymbol || ex instanceof Constant)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0007, symbol));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0007", symbol)); //$NON-NLS-1$
}
}
@@ -170,12 +169,12 @@
GroupSymbol group = (GroupSymbol) groupIter.next();
if(groupIter.hasNext()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0009, obj.getGroups()));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0009", obj.getGroups())); //$NON-NLS-1$
} else {
try {
Object groupID = group.getMetadataID();
if(groupID instanceof TempMetadataID) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0002));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0002")); //$NON-NLS-1$
} else {
Iterator elementsInGroupIter = getMetadata().getElementIDsInGroupID(groupID).iterator();
// walk through all the elements in the physical group
@@ -218,7 +217,7 @@
// this method should only be executed if the element is a required element
// and none of cases above are true
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0010, element));
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0010", element)); //$NON-NLS-1$
} catch(TeiidException e) {
handleException(e);
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -124,7 +124,6 @@
import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
-import org.teiid.query.util.ErrorMessageKeys;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
import org.teiid.translator.SourceSystemFunctions;
@@ -238,7 +237,7 @@
if(isXMLCommand(obj)) {
//no temp table (Select Into) allowed
if(obj.getInto() != null){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0069),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0069"),obj); //$NON-NLS-1$
}
this.isXML = true;
@@ -249,7 +248,7 @@
//if it is select with no from, should not have ScalarSubQuery
if(obj.getSelect() != null && obj.getFrom() == null){
if(!ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(obj.getSelect()).isEmpty()){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0067),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0067"),obj); //$NON-NLS-1$
}
}
@@ -268,7 +267,7 @@
public void visit(SubquerySetCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
@@ -277,7 +276,7 @@
//Subcommand should have one projected symbol (query with one expression
//in SELECT or stored procedure execution that returns a single value).
if(projSymbols.size() != 1) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0011),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0011"),obj); //$NON-NLS-1$
}
}
@@ -320,7 +319,7 @@
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.The_context_function_cannot_be_used_in_a_non-XML_command"), obj); //$NON-NLS-1$
} else {
if (!(obj.getArg(0) instanceof ElementSymbol)){
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.OPTIMIZER_0036), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.004.0036"), obj); //$NON-NLS-1$
}
for (Iterator functions = FunctionCollectorVisitor.getFunctions(obj.getArg(1), false).iterator(); functions.hasNext();) {
@@ -370,7 +369,7 @@
String groupName = variable.getGroupSymbol().getCanonicalName();
if(groupName.equals(ProcedureReservedWords.CHANGING) || groupName.equals(ProcedureReservedWords.INPUTS)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0012, ProcedureReservedWords.INPUTS, ProcedureReservedWords.CHANGING), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0012", ProcedureReservedWords.INPUTS, ProcedureReservedWords.CHANGING), obj); //$NON-NLS-1$
}
}
@@ -382,7 +381,7 @@
//Scalar subquery should have one projected symbol (query with one expression
//in SELECT or stored procedure execution that returns a single value).
if(projSymbols.size() != 1) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0032, obj.getCommand()), obj.getCommand());
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.008.0032", obj.getCommand()), obj.getCommand()); //$NON-NLS-1$
}
}
@@ -412,7 +411,7 @@
// varible cannot be one of the special variables
if(elementname.equals(ProcedureReservedWords.ROWS_UPDATED)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0017, new Object[] {ProcedureReservedWords.ROWS_UPDATED}), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0017", new Object[] {ProcedureReservedWords.ROWS_UPDATED}), obj); //$NON-NLS-1$
}
visit((AssignmentStatement)obj);
@@ -441,12 +440,12 @@
Criteria predicateCriteria = (Criteria) criteriaIter.next();
Iterator elmntIter = ElementCollectorVisitor.getElements(predicateCriteria, true).iterator();
if(predicateCriteria instanceof TranslateCriteria) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0019), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0019"), obj); //$NON-NLS-1$
} else if(!(predicateCriteria instanceof HasCriteria)) {
while(elmntIter.hasNext()) {
ElementSymbol element = (ElementSymbol) elmntIter.next();
if(!element.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0020), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0020"), obj); //$NON-NLS-1$
}
}
}
@@ -468,7 +467,7 @@
ElementSymbol leftExpr = (ElementSymbol)leftElmnts.iterator().next();
if(selectElmnts != null && !selectElmnts.contains(leftExpr)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0021), leftExpr);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0021"), leftExpr); //$NON-NLS-1$
}
}
}
@@ -589,7 +588,7 @@
if(transleElmnts.contains(criteriaElement)) {
Expression mappedExpr = (Expression) symbolMap.get(criteriaElement);
if(mappedExpr instanceof AggregateSymbol) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0022, criteriaElement), criteriaElement);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0022", criteriaElement), criteriaElement); //$NON-NLS-1$
}
Iterator mapElmntIter = ElementCollectorVisitor.getElements(mappedExpr, true).iterator();
@@ -602,7 +601,7 @@
}
}
if(!groupMatch) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0023, criteriaElement), criteriaElement);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0023", criteriaElement), criteriaElement); //$NON-NLS-1$
}
}
}
@@ -621,13 +620,13 @@
SupportConstants.Element.SELECT );
if(cantSelect != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0024, cantSelect), cantSelect);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0024", cantSelect), cantSelect); //$NON-NLS-1$
}
}
protected void validateHasProjectedSymbols(Command obj) {
if(obj.getProjectedSymbols().size() == 0) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0025), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0025"), obj); //$NON-NLS-1$
}
}
@@ -646,7 +645,7 @@
private void validateSortable(SingleElementSymbol symbol) {
if (isNonComparable(symbol)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0026, symbol), symbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0026", symbol), symbol); //$NON-NLS-1$
}
}
@@ -660,7 +659,7 @@
*/
protected void validateNoXMLUpdates(Command obj) {
if(isXMLCommand(obj)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0029), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0029"), obj); //$NON-NLS-1$
}
}
@@ -670,16 +669,16 @@
*/
protected void validateNoXMLProcedures(Command obj) {
if(isXMLCommand(obj)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0030), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0030"), obj); //$NON-NLS-1$
}
}
private void validateXMLQuery(Query obj) {
if(obj.getGroupBy() != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0031), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0031"), obj); //$NON-NLS-1$
}
if(obj.getHaving() != null) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0032), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0032"), obj); //$NON-NLS-1$
}
if(obj.getLimit() != null) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.limit_not_valid_for_xml"), obj); //$NON-NLS-1$
@@ -697,7 +696,7 @@
protected void validateGroupSupportsUpdate(GroupSymbol groupSymbol) {
try {
if(! getMetadata().groupSupports(groupSymbol.getMetadataID(), SupportConstants.Group.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0033, SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0033", SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol); //$NON-NLS-1$
}
} catch (TeiidComponentException e) {
handleException(e, groupSymbol);
@@ -709,7 +708,7 @@
// also check the columns of each for comparability
for (QueryCommand subQuery : query.getQueryCommands()) {
if(isXMLCommand(subQuery)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0034), query);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0034"), query); //$NON-NLS-1$
}
if (subQuery instanceof Query && ((Query)subQuery).getInto() != null) {
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.union_insert"), query); //$NON-NLS-1$
@@ -774,7 +773,7 @@
while(elementIter.hasNext()) {
ElementSymbol insertElem = (ElementSymbol) elementIter.next();
if(! getMetadata().elementSupports(insertElem.getMetadataID(), SupportConstants.Element.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0052, insertElem), insertElem);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0052", insertElem), insertElem); //$NON-NLS-1$
}
}
@@ -790,7 +789,7 @@
if(!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.DEFAULT_VALUE) &&
!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.NULL) &&
!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.AUTO_INCREMENT)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0053, new Object[] {insertGroup, nextElmnt}), nextElmnt);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0053", new Object[] {insertGroup, nextElmnt}), nextElmnt); //$NON-NLS-1$
}
}
@@ -805,7 +804,7 @@
// If nextValue is an expression, evaluate it before checking for null
Object evaluatedValue = Evaluator.evaluate(nextValue);
if(evaluatedValue == null && ! getMetadata().elementSupports(nextVar.getMetadataID(), SupportConstants.Element.NULL)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0055, SQLStringVisitor.getSQLString(nextVar)), nextVar);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0055", SQLStringVisitor.getSQLString(nextVar)), nextVar); //$NON-NLS-1$
}
} catch(ExpressionEvaluationException e) {
//ignore for now, we don't have the context which could be the problem
@@ -827,7 +826,7 @@
}
}
if(!dups.isEmpty()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0062, dups), dups);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0062", dups), dups); //$NON-NLS-1$
}
}
@@ -837,12 +836,12 @@
for (SetClause entry : update.getChangeList().getClauses()) {
ElementSymbol elementID = entry.getSymbol();
if(elementID.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0058, SQLStringVisitor.getSQLString(elementID)), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0058", SQLStringVisitor.getSQLString(elementID)), elementID); //$NON-NLS-1$
}
// Check that left side element is updatable
if(! getMetadata().elementSupports(elementID.getMetadataID(), SupportConstants.Element.UPDATE)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0059, elementID), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0059", elementID), elementID); //$NON-NLS-1$
}
// Check that right expression is a constant and is non-null
@@ -858,7 +857,7 @@
if(value instanceof Constant) {
// If value is null, check that element supports this as a nullable column
if(((Constant)value).isNull() && ! getMetadata().elementSupports(elementID.getMetadataID(), SupportConstants.Element.NULL)) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0060, SQLStringVisitor.getSQLString(elementID)), elementID);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0060", SQLStringVisitor.getSQLString(elementID)), elementID); //$NON-NLS-1$
}// end of if
} else if (!EvaluatableVisitor.willBecomeConstant(value)) {
// If this is an update on a virtual group, verify that no elements are in the right side
@@ -870,7 +869,7 @@
while(iter.hasNext()) {
ElementSymbol element = (ElementSymbol) iter.next();
if(! element.isExternalReference()) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0061, SQLStringVisitor.getSQLString(value)), value);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0061", SQLStringVisitor.getSQLString(value)), value); //$NON-NLS-1$
}
}
}
@@ -955,7 +954,7 @@
}
}
if(!foundVar) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0016, ProcedureReservedWords.ROWS_UPDATED), obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0016", ProcedureReservedWords.ROWS_UPDATED), obj); //$NON-NLS-1$
}
}
@@ -977,7 +976,7 @@
*/
public void visit(BetweenCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1012,7 +1011,7 @@
*/
public void visit(SetCriteria obj) {
if (isNonComparable(obj.getExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1023,7 +1022,7 @@
*/
public void visit(SubqueryCompareCriteria obj) {
if (isNonComparable(obj.getLeftExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
this.validateRowLimitFunctionNotInInvalidCriteria(obj);
}
@@ -1079,7 +1078,7 @@
@Override
public void visit(CompareCriteria obj) {
if (isNonComparable(obj.getLeftExpression())) {
- handleValidationError(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0027, obj),obj);
+ handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0027", obj),obj); //$NON-NLS-1$
}
// Validate use of 'rowlimit' and 'rowlimitexception' pseudo-functions - they cannot be nested within another
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/validator/ValidatorReport.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -27,7 +27,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.report.ActivityReport;
-import org.teiid.query.util.ErrorMessageKeys;
public class ValidatorReport extends ActivityReport {
@@ -51,12 +50,12 @@
public String getFailureMessage() {
Collection failures = getItemsByType(ValidatorFailure.VALIDATOR_FAILURE);
if(failures.size() == 0) {
- return QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0064);
+ return QueryPlugin.Util.getString("ERR.015.012.0064"); //$NON-NLS-1$
} else if(failures.size() == 1) {
return failures.iterator().next().toString();
} else {
StringBuffer err = new StringBuffer();
- err.append(QueryPlugin.Util.getString(ErrorMessageKeys.VALIDATOR_0063));
+ err.append(QueryPlugin.Util.getString("ERR.015.012.0063")); //$NON-NLS-1$
Iterator iter = failures.iterator();
ValidatorFailure failure = (ValidatorFailure) iter.next();
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 17:16:13 UTC (rev 2546)
@@ -98,7 +98,6 @@
import org.teiid.query.unittest.FakeMetadataStore;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.query.unittest.TimestampUtil;
-import org.teiid.query.util.ErrorMessageKeys;
@SuppressWarnings("nls")
public class TestResolver {
@@ -2900,7 +2899,7 @@
fail("expected exception");
} catch (RuntimeException e) {
QueryResolverException qre = (QueryResolverException)e.getCause();
- assertEquals(ErrorMessageKeys.RESOLVER_0040, qre.getCode());
+ assertEquals("ERR.015.008.0040", qre.getCode());
}
}
14 years, 3 months
teiid SVN: r2545 - in branches/7.1.x/engine/src: main/java/org/teiid/query/rewriter and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-09-08 12:07:43 -0400 (Wed, 08 Sep 2010)
New Revision: 2545
Modified:
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
branches/7.1.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
Log:
TEIID-1250 making the order by resolving logic more uniform, allowing for the proper resolving of external symbols and improving the rewrite logic
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 15:41:59 UTC (rev 2544)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 16:07:43 UTC (rev 2545)
@@ -351,16 +351,38 @@
for (int i = 0; i < orderBy.getVariableCount(); i++) {
SingleElementSymbol sortKey = orderBy.getVariable(i);
if (sortKey instanceof ElementSymbol) {
- int index = resolveSortKey(fromClauseGroups, knownElements, metadata, knownShortNames,
- (ElementSymbol)sortKey);
- if (index == -1) {
- index = expressions.indexOf(SymbolMap.getExpression(sortKey));
- if (index == -1 && !isSimpleQuery) {
- throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", sortKey)); //$NON-NLS-1$
- }
- }
- orderBy.setExpressionPosition(i, index);
- continue;
+ ElementSymbol symbol = (ElementSymbol)sortKey;
+ String groupPart = metadata.getGroupName(symbol.getName());
+ String symbolName = symbol.getName();
+ String shortName = symbol.getShortName();
+ if (groupPart == null) {
+ int position = -1;
+ SingleElementSymbol matchedSymbol = null;
+ // walk the SELECT col short names, looking for a match on the current ORDER BY 'short name'
+ for(int j=0; j<knownShortNames.length; j++) {
+ if( !shortName.equalsIgnoreCase( knownShortNames[j] )) {
+ continue;
+ }
+ // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
+ if(matchedSymbol != null) {
+ if (!matchedSymbol.equals(knownElements.get(j))) {
+ throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
+ }
+ continue;
+ }
+ matchedSymbol = knownElements.get(j);
+ position = j;
+ }
+ if (matchedSymbol != null) {
+ TempMetadataID tempMetadataID = new TempMetadataID(symbol.getName(), matchedSymbol.getType());
+ symbol.setMetadataID(tempMetadataID);
+ symbol.setType(matchedSymbol.getType());
+ }
+ if (position != -1) {
+ orderBy.setExpressionPosition(i, position);
+ continue;
+ }
+ }
} else if (sortKey instanceof ExpressionSymbol) {
// check for legacy positional
ExpressionSymbol es = (ExpressionSymbol)sortKey;
@@ -380,77 +402,22 @@
throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.setquery_order_expression", sortKey)); //$NON-NLS-1$
}
for (ElementSymbol symbol : ElementCollectorVisitor.getElements(sortKey, false)) {
- resolveSortKey(fromClauseGroups, null, metadata, null, symbol);
+ try {
+ ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, command.getExternalGroupContexts(), metadata);
+ } catch(QueryResolverException e) {
+ throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbol.getName()) );
+ }
}
ResolverVisitor.resolveLanguageObject(sortKey, metadata);
int index = expressions.indexOf(SymbolMap.getExpression(sortKey));
+ if (index == -1 && !isSimpleQuery) {
+ throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", sortKey)); //$NON-NLS-1$
+ }
orderBy.setExpressionPosition(i, index);
}
}
- private static int resolveSortKey(List fromClauseGroups, List knownElements,
- QueryMetadataInterface metadata, String[] knownShortNames,
- ElementSymbol symbol) throws TeiidComponentException,
- QueryMetadataException, QueryResolverException {
- String symbolName = symbol.getName();
- String groupPart = metadata.getGroupName(symbolName);
- String shortName = symbol.getShortName();
-
- //check for union order by
- if (fromClauseGroups.isEmpty() && groupPart != null && !shortName.equals(symbolName)) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbolName));
- }
-
- if (knownShortNames != null) {
- int position = -1;
- SingleElementSymbol matchedSymbol = null;
- // walk the SELECT col short names, looking for a match on the current ORDER BY 'short name'
- for(int i=0; i<knownShortNames.length; i++) {
- if( !shortName.equalsIgnoreCase( knownShortNames[i] )) {
- continue;
- }
- if (groupPart != null) {
- Object knownSymbol = knownElements.get(i);
- if(!(knownSymbol instanceof ElementSymbol)) {
- continue;
- }
- ElementSymbol knownElement = (ElementSymbol) knownSymbol;
- GroupSymbol group = knownElement.getGroupSymbol();
-
- // skip this one if the two short names are not from the same group
- if (!nameMatchesGroup(groupPart.toUpperCase(), group.getCanonicalName())) {
- continue;
- }
- }
-
- // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
- if(matchedSymbol != null) {
- if (!matchedSymbol.equals(knownElements.get(i))) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
- }
- continue;
- }
- matchedSymbol = (SingleElementSymbol)knownElements.get(i);
- position = i;
- }
- if (matchedSymbol != null) {
- TempMetadataID tempMetadataID = new TempMetadataID(symbol.getName(), matchedSymbol.getType());
- symbol.setMetadataID(tempMetadataID);
- symbol.setType(matchedSymbol.getType());
- return position;
- }
- }
-
- try {
- ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, metadata);
- } catch(QueryResolverException e) {
- throw new QueryResolverException(e, ErrorMessageKeys.RESOLVER_0043, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0043, symbol.getName()) );
- }
- return -1;
- }
-
-
/**
* Get the default value for the parameter, which could be null
* if the parameter is set to NULLABLE. If no default is available,
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-08 15:41:59 UTC (rev 2544)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2010-09-08 16:07:43 UTC (rev 2545)
@@ -851,17 +851,20 @@
for (int i = 0; i < orderBy.getVariableCount(); i++) {
SingleElementSymbol querySymbol = orderBy.getVariable(i);
int index = orderBy.getExpressionPosition(i);
+ boolean isUnrelated = false;
if (index == -1) {
unrelatedItems.add(orderBy.getOrderByItems().get(i));
- hasUnrelatedExpression |= (querySymbol instanceof ExpressionSymbol);
- continue; // must be unrelated
+ isUnrelated = (querySymbol instanceof ExpressionSymbol);
+ } else {
+ querySymbol = (SingleElementSymbol)projectedSymbols.get(index);
}
- querySymbol = (SingleElementSymbol)projectedSymbols.get(index);
Expression expr = SymbolMap.getExpression(querySymbol);
- if (!previousExpressions.add(expr) || (queryCommand instanceof Query && EvaluatableVisitor.isFullyEvaluatable(expr, true))) {
+ if (!previousExpressions.add(expr) || (queryCommand instanceof Query && EvaluatableVisitor.willBecomeConstant(expr))) {
orderBy.removeOrderByItem(i--);
+ } else if (!isUnrelated) {
+ orderBy.getOrderByItems().get(i).setSymbol((SingleElementSymbol)querySymbol.clone());
} else {
- orderBy.getOrderByItems().get(i).setSymbol((SingleElementSymbol)querySymbol.clone());
+ hasUnrelatedExpression = true;
}
}
if (orderBy.getVariableCount() == 0) {
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 15:41:59 UTC (rev 2544)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 16:07:43 UTC (rev 2545)
@@ -1991,16 +1991,20 @@
@Test public void testUnaliasedOrderByFails() {
helpResolveException("SELECT pm1.g1.e1 e2 FROM pm1.g1 group by pm1.g1.e1 ORDER BY pm1.g1.e2"); //$NON-NLS-1$
}
+
+ @Test public void testUnaliasedOrderByFails1() {
+ helpResolveException("SELECT pm1.g1.e1 e2 FROM pm1.g1 group by pm1.g1.e1 ORDER BY pm1.g1.e2 + 1"); //$NON-NLS-1$
+ }
/**
* the group g1 is not known to the order by clause of a union
*/
@Test public void testUnionOrderByFail() {
- helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY g1.e1", "Error Code:ERR.015.008.0043 Message:Element 'g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY g1.e1", "ORDER BY expression 'g1.e1' cannot be used with a set query."); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testUnionOrderByFail1() {
- helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY pm1.g1.e1", "Error Code:ERR.015.008.0043 Message:Element 'pm1.g1.e1' in ORDER BY was not found in SELECT clause."); //$NON-NLS-1$ //$NON-NLS-2$
+ helpResolveException("SELECT pm1.g1.e1 FROM pm1.g1 UNION SELECT pm1.g2.e1 FROM pm1.g2 ORDER BY pm1.g1.e1", "ORDER BY expression 'pm1.g1.e1' cannot be used with a set query."); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testOrderByPartiallyQualified() {
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2010-09-08 15:41:59 UTC (rev 2544)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2010-09-08 16:07:43 UTC (rev 2545)
@@ -1030,7 +1030,7 @@
procedure = procedure + "Declare String var1;\n"; //$NON-NLS-1$
procedure = procedure + "if(var1 = 'x' or var1 = 'y')\n"; //$NON-NLS-1$
procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
- procedure = procedure + "Select pm1.g1.e2, Input.e2, CHANGING.e2, CHANGING.e1 from pm1.g1 order by CHANGING.e1;\n"; //$NON-NLS-1$
+ procedure = procedure + "Select pm1.g1.e2, Input.e2, CHANGING.e2, CHANGING.e1 from pm1.g1 order by CHANGING.e1 + 1;\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
procedure = procedure + "END\n"; //$NON-NLS-1$
14 years, 3 months
teiid SVN: r2544 - branches/7.1.x/common-core/src/test/java/org/teiid/core/util.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-09-08 11:41:59 -0400 (Wed, 08 Sep 2010)
New Revision: 2544
Modified:
branches/7.1.x/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java
Log:
TEIID-1027: fix the test
Modified: branches/7.1.x/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java
===================================================================
--- branches/7.1.x/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java 2010-09-08 15:30:47 UTC (rev 2543)
+++ branches/7.1.x/common-core/src/test/java/org/teiid/core/util/TestStringUtil.java 2010-09-08 15:41:59 UTC (rev 2544)
@@ -97,11 +97,11 @@
}
public void testComputeDisplayableForm4() {
- helpTestComputeDisplayableForm("MetaMatrix", "MetaMatrix"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("MetaMatrix", "Meta Matrix"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm5() {
- helpTestComputeDisplayableForm("metaMatrix", "MetaMatrix"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("metaMatrix", "Meta Matrix"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm6() {
@@ -109,15 +109,15 @@
}
public void testComputeDisplayableForm7() {
- helpTestComputeDisplayableForm("SomeMetaMatrixEmbedded", "Some MetaMatrix Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomeMetaMatrixEmbedded", "Some Meta Matrix Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm8() {
- helpTestComputeDisplayableForm("SomeMetaMetaMatrixMetaEmbedded", "Some Meta MetaMatrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomeMetaMetaMatrixMetaEmbedded", "Some Meta Meta Matrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputeDisplayableForm9() {
- helpTestComputeDisplayableForm("SomemetaMatrixMetaMatrixMetaEmbedded", "Somemeta Matrix MetaMatrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestComputeDisplayableForm("SomemetaMatrixMetaMatrixMetaEmbedded", "Somemeta Matrix Meta Matrix Meta Embedded"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testComputePluralForm1() {
14 years, 3 months
teiid SVN: r2543 - in branches/7.1.x/engine/src: test/java/org/teiid/query/resolver and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-09-08 11:30:47 -0400 (Wed, 08 Sep 2010)
New Revision: 2543
Modified:
branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
Log:
TEIID-1251 TEIID-1250 order by resolving enhancement/fix
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 15:26:49 UTC (rev 2542)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverUtil.java 2010-09-08 15:30:47 UTC (rev 2543)
@@ -351,10 +351,13 @@
for (int i = 0; i < orderBy.getVariableCount(); i++) {
SingleElementSymbol sortKey = orderBy.getVariable(i);
if (sortKey instanceof ElementSymbol) {
- int index = resolveSortKey(fromClauseGroups, knownElements, metadata, isSimpleQuery,
- knownShortNames, (ElementSymbol)sortKey);
+ int index = resolveSortKey(fromClauseGroups, knownElements, metadata, knownShortNames,
+ (ElementSymbol)sortKey);
if (index == -1) {
index = expressions.indexOf(SymbolMap.getExpression(sortKey));
+ if (index == -1 && !isSimpleQuery) {
+ throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", sortKey)); //$NON-NLS-1$
+ }
}
orderBy.setExpressionPosition(i, index);
continue;
@@ -377,7 +380,7 @@
throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.setquery_order_expression", sortKey)); //$NON-NLS-1$
}
for (ElementSymbol symbol : ElementCollectorVisitor.getElements(sortKey, false)) {
- resolveSortKey(fromClauseGroups, null, metadata, isSimpleQuery, null, symbol);
+ resolveSortKey(fromClauseGroups, null, metadata, null, symbol);
}
ResolverVisitor.resolveLanguageObject(sortKey, metadata);
@@ -387,10 +390,9 @@
}
private static int resolveSortKey(List fromClauseGroups, List knownElements,
- QueryMetadataInterface metadata, boolean isSimpleQuery,
- String[] knownShortNames, ElementSymbol symbol) throws TeiidComponentException,
+ QueryMetadataInterface metadata, String[] knownShortNames,
+ ElementSymbol symbol) throws TeiidComponentException,
QueryMetadataException, QueryResolverException {
- SingleElementSymbol matchedSymbol = null;
String symbolName = symbol.getName();
String groupPart = metadata.getGroupName(symbolName);
String shortName = symbol.getShortName();
@@ -401,42 +403,45 @@
}
if (knownShortNames != null) {
+ int position = -1;
+ SingleElementSymbol matchedSymbol = null;
// walk the SELECT col short names, looking for a match on the current ORDER BY 'short name'
for(int i=0; i<knownShortNames.length; i++) {
- if( shortName.equalsIgnoreCase( knownShortNames[i] )) {
- if (groupPart != null) {
- Object knownSymbol = knownElements.get(i);
- if(knownSymbol instanceof ElementSymbol) {
- ElementSymbol knownElement = (ElementSymbol) knownSymbol;
- GroupSymbol group = knownElement.getGroupSymbol();
-
- // skip this one if the two short names are not from the same group
- if (!nameMatchesGroup(groupPart.toUpperCase(), group.getCanonicalName())) {
- continue;
- }
- }
- }
-
- // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
- if(matchedSymbol != null) {
- throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
- }
- matchedSymbol = (SingleElementSymbol)knownElements.get(i);
- }
+ if( !shortName.equalsIgnoreCase( knownShortNames[i] )) {
+ continue;
+ }
+ if (groupPart != null) {
+ Object knownSymbol = knownElements.get(i);
+ if(!(knownSymbol instanceof ElementSymbol)) {
+ continue;
+ }
+ ElementSymbol knownElement = (ElementSymbol) knownSymbol;
+ GroupSymbol group = knownElement.getGroupSymbol();
+
+ // skip this one if the two short names are not from the same group
+ if (!nameMatchesGroup(groupPart.toUpperCase(), group.getCanonicalName())) {
+ continue;
+ }
+ }
+
+ // if we already have a matched symbol, matching again here means it is duplicate/ambiguous
+ if(matchedSymbol != null) {
+ if (!matchedSymbol.equals(knownElements.get(i))) {
+ throw new QueryResolverException(ErrorMessageKeys.RESOLVER_0042, QueryPlugin.Util.getString(ErrorMessageKeys.RESOLVER_0042, symbolName));
+ }
+ continue;
+ }
+ matchedSymbol = (SingleElementSymbol)knownElements.get(i);
+ position = i;
}
if (matchedSymbol != null) {
TempMetadataID tempMetadataID = new TempMetadataID(symbol.getName(), matchedSymbol.getType());
- int position = knownElements.indexOf(matchedSymbol);
symbol.setMetadataID(tempMetadataID);
symbol.setType(matchedSymbol.getType());
return position;
}
}
- if (!isSimpleQuery) {
- throw new QueryResolverException(QueryPlugin.Util.getString("ResolverUtil.invalid_unrelated", symbol.getName())); //$NON-NLS-1$
- }
- // Didn't find it by full name or short name, so try resolving
try {
ResolverVisitor.resolveLanguageObject(symbol, fromClauseGroups, metadata);
} catch(QueryResolverException e) {
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 15:26:49 UTC (rev 2542)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-09-08 15:30:47 UTC (rev 2543)
@@ -1983,6 +1983,14 @@
@Test public void testUnaliasedOrderBySucceeds() {
helpResolve("SELECT pm1.g1.e1 a, pm1.g1.e1 b FROM pm1.g1 ORDER BY pm1.g1.e1"); //$NON-NLS-1$
}
+
+ @Test public void testUnaliasedOrderBySucceeds1() {
+ helpResolve("SELECT pm1.g1.e1 a FROM pm1.g1 group by pm1.g1.e1 ORDER BY pm1.g1.e1"); //$NON-NLS-1$
+ }
+
+ @Test public void testUnaliasedOrderByFails() {
+ helpResolveException("SELECT pm1.g1.e1 e2 FROM pm1.g1 group by pm1.g1.e1 ORDER BY pm1.g1.e2"); //$NON-NLS-1$
+ }
/**
* the group g1 is not known to the order by clause of a union
14 years, 3 months
teiid SVN: r2542 - branches/7.1.x/engine/src/main/resources/org/teiid/query.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-09-08 11:26:49 -0400 (Wed, 08 Sep 2010)
New Revision: 2542
Modified:
branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIID-1027 adding back sqlparser messages
Modified: branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-08 03:27:08 UTC (rev 2541)
+++ branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-08 15:26:49 UTC (rev 2542)
@@ -400,9 +400,16 @@
SQLParser.Unknown_join_type=Unknown join type: {0}
+SQLParser.Aggregate_only_top_level=Aggregate expressions are allowed only as top level functions in the SELECT and HAVING clauses.
+SQLParser.Unknown_agg_func=Unknown aggregate function: {0}
SQLParser.Invalid_func=Invalid function name: [{0}]
+SQLParser.Integer_parse=Unable to parse integer literal: {0}
+SQLParser.Float_parse=Unable to parse floating point literal: {0}
+SQLParser.Invalid_id=Invalid metadata ID format: [{0}]
SQLParser.Invalid_alias=Invalid alias format: [{0}]
SQLParser.Invalid_short_name=Invalid simple identifier format: [{0}]
+SQLParser.Invalid_char={0} value must be a single character: [{1}].
+SQLParser.expected_non_reserved=Expected non-reserved word {0}, but was {1}.
SystemSource.Add_desc=Add two numbers
SystemSource.Add_result_desc=Left operand + right operand
SystemSource.Subtract_desc=Subtract two numbers
14 years, 3 months
teiid SVN: r2541 - in branches/7.1.x/documentation: admin-guide/src/main/docbook/en-US/content and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-09-07 23:27:08 -0400 (Tue, 07 Sep 2010)
New Revision: 2541
Modified:
branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
Log:
TEIID-1215 adding a performance chapter to the admin guide
Modified: branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml
===================================================================
--- branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-09-08 00:37:02 UTC (rev 2540)
+++ branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/admin_guide.xml 2010-09-08 03:27:08 UTC (rev 2541)
@@ -50,6 +50,7 @@
<xi:include href="content/security.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/logging.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/clustering.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/performance.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/admin-console.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/adminshell.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/appendix-a.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml
===================================================================
--- branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2010-09-08 00:37:02 UTC (rev 2540)
+++ branches/7.1.x/documentation/admin-guide/src/main/docbook/en-US/content/performance.xml 2010-09-08 03:27:08 UTC (rev 2541)
@@ -1,28 +1,127 @@
-<!--
-TODO: incorporate a performance chapter.
-
-The information about document materialization belongs in the reference though. And is not completely correct
-w.r.t. the use of document projection.
-
- <para>Your application can use a statement object to execute queries that return XML documents.
- The query must specify a valid document in VDB, or should have used SQL XML functions
- to create a XMl document.</para>
- <section>
- <title>XML Streaming</title>
- <para>XML documents are streamed from Teiid Server to the Teiid JDBC API.
- Normally, the document never materializes in the server memory, avoiding potential
- out-of-memory issues and improving the first response time for large documents.
- When using style sheets, or XQuery, the whole document
- must be materialized on the server. Therefore memory issues may occur for large documents.
- A result document can be obtained from the JDBC resultset using <code>getSQLXML</code> method.
- </para>
- <para>The document is broken into pieces when being created and streamed.
- The maximum size of each piece in the stream can be configured with the
- <code>"lobChunkSizeInKB"</code> system property on the Server. The default value is 100 KB.
- At any given time, this is the maximum amount of memory that can be held by a particular
- XML query against the system. In heavily loaded or memory-constrained scenarios,
- this value can decrease the amount of memory used. As a side effect, streaming will occur in smaller pieces, reducing initial document response time while
- increasing full response time (as this is less efficient).</para>
- </section>
-
- -->
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
+<chapter id="performance">
+ <title>Performance Tuning</title>
+ <section id="memory_management">
+ <title>Memory Management</title>
+ <para>The BufferManager is responsible for tracking both memory and disk usage
+ by Teiid. Configuring the BufferManager properly is one of the most
+ important parts of ensuring high performance. See the &jboss-beans;
+ file for all BufferManager settings.
+ </para>
+ <para>
+ The Teiid engine uses batching to reduce the number of memory
+ rows processed at a given time. The batch sizes may be adjusted to larger values if few clients will be
+ accessing the Teiid server simultaneously.
+ </para>
+ <para>
+ The <code>maxReserveBatchColumns</code>
+ setting determines the total number of batches (with a max of
+ <code>processorBatchSize</code> rows) multiplied by their column width
+ that can be held in memory directly by the BufferManager.
+ This number does not include persistent batches held by soft (such as
+ index pages) or weak references. When your installation can dedicate
+ more memory to Teiid, consider increasing this value in proportion to the number of gigabytes you
+ wish Teiid to use - e.g. 2GB on a 32 bit VM would double the value to
+ 32768. For 64 bit VMs you should use a value of approximately 11000
+ per GB.
+ The BufferManager automatically triggers the use of a canonical
+ value cache when more than 25% of the reserve is in use.
+ This can dramatically cut the memory usage in situations where similar
+ value sets are being read through Teiid, but does introduce a lookup cost.
+ If you are processing large (100s of MBs) of highly unique datasets
+ through Teiid, you should consider <link linkend="system_properties">disabling value caching</link> since it
+ will not significantly reduce memory consumption.
+ </para>
+ <para>
+ Each intermediate result buffer, temporary LOB, and temporary table
+ is stored in its own set of buffer files,
+ where an individual file is
+ limited to <code>maxFileSize</code> megabytes.
+ Consider increasing the storage space available to all such
+ files <code>maxBufferSpace</code>
+ if your installation makes use of internal materialization, makes
+ heavy use of SQL/XML, or processes large row counts.
+ </para>
+ </section>
+ <section>
+ <title>Threading</title>
+ <para>Socket threads are configured for each <link linkend="socket_transport">transport</link>.
+ They handle NIO non-blocking IO operations as well as directly servicing any operation that can run without blocking.</para>
+ <para>For longer running operations, the socket threads queue with work the query engine.
+ The query engine has two settings that determine its thread utilization.
+ <code>maxThreads</code> sets the total number of threads available for query engine work (processing plans, transaction control operations, processing source queries, etc.).
+ You should consider increasing the maximum threads on systems with a large number of available processors and/or when it's common to issue non-transactional queries with that
+ issue a large number of concurrent source requests.
+ <code>maxActivePlans</code>, which should always be smaller than maxThreads, sets the number of the maxThreads
+ that should be used for user query processing. Increasing the maxActivePlans should be considered for workloads with a high number of long
+ running queries and/or systems with a large number of available processors. If memory issues arise from increasing the max threads and the
+ max active plans, then consider decreasing the processor/connector batch sizes to limit the base number of memory rows consumed by each plan.</para>
+ </section>
+ <section>
+ <title>Cache Tuning</title>
+ <para>Caching can be tuned for cached result (including user query results and procedure results) and prepared plans (including user and stored procedure plans).
+ Even though it is possible to disable or otherwise severely constrain these caches, this would probably never be done in practice as it would lead to poor performance.
+ </para><para>Cache statistics can be obtained through the Admin Console or Adminshell. The statistics can be used to help tune cache parameters and ensure a hit ratio.</para>
+ <para>Plans are currently fully held in memory and may have a significant memory footprint. When making extensive use of prepared statements and/or virtual procedures,
+ the size of the plan cache may be increased proportionally to number of GB intended for use by Teiid.
+ </para><para>While the result cache parameters control the cache result entries (max number, eviction, etc.), the result batches themselves are accessed through the <link linkend="memory_management">BufferManager</link>.
+ If the size of the result cache is increased, you may need to tune the BufferManager configuration to ensure there is enough buffer space.
+ </para>
+ </section>
+ <section id="socket_transport">
+ <title>Socket Transports</title>
+ <para>Teiid separates the configuration of its socket transports for
+ JDBC, ODBC, and Admin access.
+ Typical installations will not need to
+ adjust the default thread and buffer
+ size settings. At this time, ODBC
+ queries are executed synchronously from the socket thread.
+ Simultaneous long-running queries may exhaust the available threads.
+ Consider increasing the default max threads (15) for ODBC if you
+ expect a higher concurrent load of long-running queries.</para>
+ </section>
+ <section>
+ <title>LOBs</title>
+ <para>LOBs and XML documents are streamed from the Teiid Server to the
+ Teiid JDBC API.
+ Normally, these values are not materialized in the
+ server memory - avoiding potential out-of-memory issues.
+ When using style sheets, or XQuery, whole XML documents must be
+ materialized on the server.
+ Even when using the XMLQuery or XMLTable functions and
+ document projection is applied, memory issues may occur for large
+ documents.
+ </para>
+ <para>
+ LOBs are broken into pieces when being created and streamed.
+ The maximum size of each piece when fetched by the client can be
+ configured with the <code>"lobChunkSizeInKB"</code>
+ property in the &jboss-beans; file. The default value is 100 KB.
+ When dealing with extremely large LOBs, you may consider increasing this
+ value to decrease the amount of round-trips to stream the result.
+ Setting the value too high may cause the server or client to have
+ memory issues.
+ </para>
+ <para>Source LOB values are typically accessed by reference, rather
+ than having the value copied to a temporary location.
+ Thus care must be taken to ensure that source LOBs are returned in a
+ memory-safe manner.
+ </para>
+ </section>
+ <section>
+ <title>Other Considerations</title>
+ <para>When
+ using Teiid in a development environment, you may consider setting
+ the maxSourceRows property in the &jboss-beans;
+ file to reasonably small level value (e.g. 10000) to prevent large
+ amounts of data from being pulled from sources.
+ Leaving the exceptionOnMaxSourceRows set to true will alert the developer
+ through an exception that an attempt was made to retrieve more than
+ the specified number of rows.
+ </para>
+ </section>
+</chapter>
\ No newline at end of file
Modified: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-09-08 00:37:02 UTC (rev 2540)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-09-08 03:27:08 UTC (rev 2541)
@@ -1968,7 +1968,8 @@
<para>xquery in string. Return value is xml.</para>
<para>XMLQUERY is part of the SQL/XML 2006 specification.</para>
<para>See also <link linkend="xmltable">XMLTABLE</link></para>
- <note><para>A technique known as document projection is used to reduce the memory footprint of the context item document. Only the parts of the document needed by the xquery will be loaded into memory.</para></note>
+ <note><para>A technique known as document projection is used to reduce the memory footprint of the context item document.
+ Only the parts of the document needed by the XQuery path expressions will be loaded into memory. Since document projection analysis uses all relevant path expressions, even 1 expression that could potentially use many nodes, e.g. //x rather than /a/b/x will cause a larger memory footprint.</para></note>
</section>
<section id="xmlserialize">
14 years, 3 months
teiid SVN: r2540 - in branches/7.1.x: common-core/src/main/java/org/teiid/core and 5 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-09-07 20:37:02 -0400 (Tue, 07 Sep 2010)
New Revision: 2540
Modified:
branches/7.1.x/client/src/main/resources/org/teiid/net/i18n.properties
branches/7.1.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
branches/7.1.x/common-core/src/main/java/org/teiid/core/util/StringUtil.java
branches/7.1.x/common-core/src/main/resources/org/teiid/core/i18n.properties
branches/7.1.x/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
branches/7.1.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1027: verbose messages in the "i18N.properties" file. These are legacy messages did not get deleted when the code got refactored.
Modified: branches/7.1.x/client/src/main/resources/org/teiid/net/i18n.properties
===================================================================
--- branches/7.1.x/client/src/main/resources/org/teiid/net/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/client/src/main/resources/org/teiid/net/i18n.properties 2010-09-08 00:37:02 UTC (rev 2540)
@@ -20,8 +20,6 @@
# 02110-1301 USA.
#
-SessionToken.session_compare_null = Attempt to compare null to SessionToken.
-TrustedSessionToken.token_null = The trusted token for a session token may not be null.
StreamImpl.Unable_to_read_data_from_stream=Unable to read data from the stream: {0}
RequestMessage.invalid_txnAutoWrap=''{0}'' is an invalid transaction autowrap mode.
@@ -58,13 +56,8 @@
SocketServerInstance.Connection_Error.Unknown_Host = Error establishing socket. Unknown host: {0}
SocketServerInstance.Connection_Error.Connect_Failed = Error establishing socket to host and port: {0}:{1}. Reason: {2}
-SocketServerInstance.Connection_Error.Connect_Failed_to_HostInfo_Max_Attempts = Failed to connect to {0} on try [{1}]. Maximum number of retries reached.
-SocketServerInstance.Connection_Warning.Connect_Failed_to_HostInfo_Will_retry = Failed to connect to {0} on try [{1}]. Will attempt up to [{2}] time(s).
-SocketServerInstance.Connection_Detail.Connected_to_HostInfo = Connected to {0} on attempt number [{1}].
-SocketServerInstance.Connection_Detail.Connecting_to_HostInfo = Connecting to {0}. Attempt [{1}] of [{2}].
-
ERR.014.001.0001 = Lost communication with the AdminAPI - the connection has been closed.
ERR.014.001.0002 = Lost communication with the AdminAPI.
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2010-09-08 00:37:02 UTC (rev 2540)
@@ -41,7 +41,7 @@
public static final long serialVersionUID = -4035276728007979320L;
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- public static final String CAUSED_BY_STRING = CorePlugin.Util.getString("MetaMatrixRuntimeException.Caused_by"); //$NON-NLS-1$
+ public static final String CAUSED_BY_STRING = CorePlugin.Util.getString("RuntimeException.Caused_by"); //$NON-NLS-1$
//############################################################################################################################
//# Static Methods #
Modified: branches/7.1.x/common-core/src/main/java/org/teiid/core/util/StringUtil.java
===================================================================
--- branches/7.1.x/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2010-09-08 00:37:02 UTC (rev 2540)
@@ -549,7 +549,7 @@
// ... and the previous character is not uppercase, then insert
if ( !previousCharUppercase ) {
// ... and this is not the 'M' of 'MetaMatrix' ...
- if ( currentChar != 'M' || i < 4 || (!newName.substring(i-4).startsWith(CorePlugin.Util.getString("StringUtil.Displayable.MetaMatrix"))) ) { //$NON-NLS-1$
+ if ( currentChar != 'M' || i < 4 || (!newName.substring(i-4).startsWith(CorePlugin.Util.getString("StringUtil.Displayable"))) ) { //$NON-NLS-1$
newName.insert(i, ' ' );
++i; // skip, since we just move the character back one position
}
Modified: branches/7.1.x/common-core/src/main/resources/org/teiid/core/i18n.properties
===================================================================
--- branches/7.1.x/common-core/src/main/resources/org/teiid/core/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/common-core/src/main/resources/org/teiid/core/i18n.properties 2010-09-08 00:37:02 UTC (rev 2540)
@@ -20,18 +20,8 @@
# 02110-1301 USA.
#
-PlatformLogger._NullLogEntry_exception = A null log entry was logged
-SystemLogger._NullLogEntry_exception = A null log entry was logged
+StringUtil.Displayable=Teiid
-Stopwatch.Stopwatch_Statistics =Stopwatch Statistics:
-Stopwatch.Statistics_Total =\ \ Total = {0}
-Stopwatch.Statistics_Previous =\ \ Previous = {0}
-Stopwatch.Statistics_Count =\ \ Count = {0}
-Stopwatch.Statistics_Average =\ \ Average = {0}
-Stopwatch.Statistics_Minimum =\ \ Minimum = {0}
-Stopwatch.Statistics_Maximum =\ \ Maximum = {0}
-StringUtil.Displayable.MetaMatrix=MetaMatrix
-
ArgCheck.isNonNegativeInt=Expected argument to be non-negative but argument= {0}
ArgCheck.isNonPositiveInt=Expected argument to be non-positive but argument= {0}
ArgCheck.isNegativeInt=Expected argument to be negative but argument= {0}
@@ -70,14 +60,12 @@
UUIDFactory.Description=An universally unique identifier that is composed of a 36-character formatted string.
ParsedObjectID.The_stringified_ObjectID_does_not_have_a_protocol=The stringified ObjectID does not have a protocol
ParsedObjectID.The_stringified_ObjectID_does_not_have_the_required_protocol_{0}=The stringified ObjectID does not have the required protocol {0}
-DebuggerImpl.conflictWarning = Debug context "{0}" is defined in both plugins "{1}" and "{2}"; context from plugin "{1}" will be ignored.
-DebuggerImpl.timerStop =TIMER STOPPED | TIME={1} ms |ID = {0} | {2}
ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._1=Error translating results from data type {0} to a byte[].
ObjectConverterUtil.Error_translating_results_from_data_type_to_a_byte[]._2=Error translating results from data type {0} to a byte[].
ObjectConverterUtil.Object_type_not_supported_for_object_conversion._3=Object type {0} not supported for object conversion.
FileUtils.File_does_not_exist._1=File {0} does not exist.
FileUtils.Not_a_directory=\"{0}\" is not a directory.
-MetaMatrixRuntimeException.Caused_by=Caused by:
+RuntimeException.Caused_by=Caused by:
IDGenerator.The_protocol_may_not_be_null=The protocol may not be null
IDGenerator.The_stringified_ID_may_not_be_null=The stringified ID may not be null
FileUtils.The_name_of_the_file_may_not_be_null=The name of the file may not be null
@@ -90,18 +78,6 @@
FileUtils.File_already_exists=File "\{0}\" already exists
-#=================================================================================================================================
-# PluginUtilImpl
-
-PluginUtilImpl.invalidJavaVersionMessage = {0} requires Java version {1} or higher. Currently executing Java version {2}.
-
-#=================================================================================================================================
-# AspectJ
-
-
-
-
-
StringIDFactory.The_specified_ID_value_is_invalid=The specified ID value \"{0}\" is invalid for the protocol \"{1}\".
Modified: branches/7.1.x/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2010-09-08 00:37:02 UTC (rev 2540)
@@ -26,8 +26,6 @@
JDBCQueryExecution.Error_executing_query__1 = {0}\n\nExecuting statement:\n\n {1}
-JDBCQueryExecution.Error_executing_query__2 = {0}\n\nAfter executing batch statements:\n
-JDBCQueryExecution.Error_executing_query__3 = {0}\n\nWhile executing batch statements:\n
ConnectionListener.failed_to_report_jdbc_connection_details=Failed to report the JDBC driver and connection information
Modified: branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-08 00:37:02 UTC (rev 2540)
@@ -274,7 +274,6 @@
ValidationVisitor.invalid_lookup_key=Expressions of type OBJECT, CLOB, BLOB, or XML cannot be used as LOOKUP key columns: {0}.
ValidationVisitor.limit_not_valid_for_xml=The limit clause cannot be used on an XML document query.
ValidationVisitor.translated_or=Translated user criteria must not contain OR criteria
-ValidateCriteriaVistitor.element_not_comparable = The following data elements are not supported in comparison criteria: {0}.
ValidationVisitor.union_insert = Select into is not allowed under a set operation: {0}.
ERR.015.012.0028 = The following data elements are not supported in match criteria: {0}.
ERR.015.012.0029 = INSERT, UPDATE, and DELETE not allowed on XML documents
Modified: branches/7.1.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- branches/7.1.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
+++ branches/7.1.x/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2010-09-08 00:37:02 UTC (rev 2540)
@@ -24,35 +24,12 @@
LocalBufferService.Failed_initializing_buffer_manager._8=Failed initializing buffer manager.
-VDBConfigFileReader.No_connector_binding_in_config = A model \"{0}\" specifies a connection factory "{1}" for which there is no definition found in the configuration or VDB definition files.
-
VDBService.VDB_does_not_exist._1=VDB \"{0}\" version \"{1}\" does not exist.
VDBService.VDB_does_not_exist._2=VDB \"{0}\" version \"{1}\" is not in "active" status.
-
-
-
-
-
-
-
-
-# authorization service
-AuthorizationServiceImpl.wrong_realms = Permission collection contains requests from different realms.
-
-# membership service
-MembershipServiceImpl.loaded = Loaded membership domain: "{0}".
-MembershipServiceImpl.failed_to_create = Unable to create membership domain {0}
-MembershipServiceImpl.unable_to_create = Unable to create membership domain "{0}". Factory class not found in environment properties.
-MembershipServiceImpl.invalid_principal = The principal "{0}" is invalid.
-MembershipServiceImpl.error_shuting_down = Error shutting down domain after ''killService'' method received.
-
-
-
# session service
SessionServiceImpl.invalid_session=The specified session ID "{0}" is invalid. It cannot be found in the userbase.
-SessionServiceImpl.reached_max_sessions = The server has reached the maximum number of sessions of {0} as defined by the property metamatrix.session.max.connections. If more sessions are required, modify this property value in the MetaMatrix Console.
-SessionServiceImpl.failed_to_getprincipal = Membership service encountered an error getting the principal for user "{0}".
+SessionServiceImpl.reached_max_sessions = The server has reached the maximum number of sessions of {0} as defined by the property "sessionMaxLimit". If more sessions are required, modify this property value in the "teiid-jboss-beans.xml" file.
SessionServiceImpl.expireSession = Expiring session {0}
SessionServiceImpl.keepaliveFailed = Keepalive failed for session {0}
SessionServiceImpl.The_username_0_and/or_password_are_incorrect=The username "{0}" and/or password and/or payload token could not be authenticated by any membership domain.
14 years, 3 months
teiid SVN: r2539 - in branches/7.1.x: engine/src/main/resources/org/teiid/query and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-09-07 19:28:26 -0400 (Tue, 07 Sep 2010)
New Revision: 2539
Modified:
branches/7.1.x/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
Log:
TEIID-1027: verbose messages in the "i18N.properties" file. These are legacy messages did not get deleted when the code got refactored.
Modified: branches/7.1.x/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
===================================================================
--- branches/7.1.x/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2010-09-07 22:36:07 UTC (rev 2538)
+++ branches/7.1.x/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
@@ -24,13 +24,7 @@
LDAPConnection.urlPropNotFound=Ldap URL property not found.
LDAPConnection.adminUserDNPropNotFound=Ldap Admin User DN property not found.
LDAPConnection.adminUserPassPropNotFound=Ldap Admin password property not found.
-LDAPConnection.maxCriteriaParseError=Ldap Max Criteria property has an invalid format.
-LDAPConnection.maxCriteriaPropNotFound=Ldap Max Criteria property not found.
-LDAPConnection.contextInitFailed=LDAP context initialization failed. Please check connector properties, and verify against LDAP server.
-LDAPConnection.propertyFileParseFailed=The Properties file could not be parsed.
LDAPConnection.directoryNamingError=Initializing LDAP directory context failed. Please check LDAP connection properties, including username and password: {0}
-LDAPConnection.directoryInitError=Initializing LDAP directory context failed.
-LDAPConnection.unsupportedExecMode=LDAPConnector does not support requested execution mode.
LDAPConnection.contextCloseError=The Connection failed to close LDAP context: {0}
#
Modified: branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-07 22:36:07 UTC (rev 2538)
+++ branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-09-07 23:28:26 UTC (rev 2539)
@@ -98,13 +98,6 @@
ERR.015.001.0071 = Unknown type signature for evaluating function of: {0} ({1})
# mapping (002)
-QueryTreeConverter.jdomErr=Unable to create a JDOM document with string ({0})
-QueryTreeConverter.nullNode=QueryNode to convert is null.
-QueryTreeConverter.errConverting=Unable to create Query Node.
-QueryTreeMapper.errParseBinding=Unable to parse expression for binding: {0}, {1}
-QueryTreeMapper.errMapping=Unable to map the following symbols: {0}
-QueryTreeMapper.symbolParseErr=Unable to parse query for symbol mapping: {0}
-QueryTreeMapper.cantMapGroup=Unable to map the group name {0}
ERR.015.002.0008 = Mapping file or stream must be specified prior to initializing mapping reader.
ERR.015.002.0009 = Search direction arg ''{0}'' is not one of the search constants defined in MappingNodeConstants.
ERR.015.002.0010 = Value for property ''{0}'' is null.
@@ -116,9 +109,7 @@
# parser (005)
QueryParser.emptysql=Parser cannot parse an empty sql statement.
QueryParser.parsingError=Parsing error: {0}
-QueryParser.parsingErrorWithLocation=Parsing error at line {0}, column {1}: {2}
QueryParser.nullSqlCrit=Parser cannot parse a null sql criteria.
-QueryParser.nullBlock= Parser cannot parse a null block.
QueryParser.lexicalError= Lexical error: {0}
QueryParser.nullSqlExpr= Parser cannot parse a null sql expression.
QueryParser.xqueryCompilation= Direct usage of XQuery is no longer supported, use XMLQUERY instead.
@@ -408,24 +399,11 @@
# validator (012)
MSG.015.012.0001 =
-UpdateProcedureResolver.._1=.
-SQLParser.Cant_alias_star=Symbols such as {0} cannot be named with an alias.
SQLParser.Unknown_join_type=Unknown join type: {0}
-SQLParser.Aggregate_only_top_level=Aggregate expressions are allowed only as top level functions in the SELECT and HAVING clauses.
-SQLParser.Unknown_agg_func=Unknown aggregate function: {0}
SQLParser.Invalid_func=Invalid function name: [{0}]
-SQLParser.Integer_parse=Unable to parse integer literal: {0}
-SQLParser.Float_parse=Unable to parse floating point literal: {0}
-SQLParser.Boolean_parse=Illegal boolean format: {0}, expecting '{'b'true''}' or '{'b'false''}'
-SQLParser.Timestamp_parse=Illegal timestamp format: {0}, expecting '{'d'YYYY-MM-DD HH:MM:SS[.XXX]''}'
-SQLParser.Date_parse=Illegal date format: {0}, expecting '{'d'YYYY-MM-DD''}'
-SQLParser.Time_parse=Illegal time format: {0}, expecting '{'t'HH:MM:SS''}'
-SQLParser.Invalid_id=Invalid metadata ID format: [{0}]
SQLParser.Invalid_alias=Invalid alias format: [{0}]
SQLParser.Invalid_short_name=Invalid simple identifier format: [{0}]
-SQLParser.Invalid_char={0} value must be a single character: [{1}].
-SQLParser.expected_non_reserved=Expected non-reserved word {0}, but was {1}.
SystemSource.Add_desc=Add two numbers
SystemSource.Add_result_desc=Left operand + right operand
SystemSource.Subtract_desc=Subtract two numbers
@@ -540,8 +518,6 @@
SystemSource.Rand_desc=Random Number
SystemSource.Rand_arg=Number
SystemSource.Rand_result_desc=Generated Random Number
-SystemSource.Float_arg=Number
-SystemSource.Double_arg=Number
SystemSource.Double_arg2=Number
SystemSource.Atan_arg1=Number parameter1
SystemSource.Atan_arg2=Number parameter2
@@ -576,16 +552,6 @@
SystemSource.Timestampadd_ts_arg2=Count number
SystemSource.Timestampadd_ts_arg3=Timestamp type
SystemSource.Timestampadd_ts_result=Returned modified timestamp
-SystemSource.Timestampdiff_d_desc=Calculate estimated number of intervals between start and end date
-SystemSource.Timestampdiff_d_arg1=Interval type
-SystemSource.Timestampdiff_d_arg2=Start day
-SystemSource.Timestampdiff_d_arg3=End day
-SystemSource.Timestampdiff_result_desc=Returns estimated number of intervals between start and end date
-SystemSource.Timestampdiff_t_desc=Calculate estimated number of intervals between start and end time
-SystemSource.Timestampdiff_t_arg1=Interval type
-SystemSource.Timestampdiff_t_arg2=Start time
-SystemSource.Timestampdiff_t_arg3=End time
-SystemSource.Timestampdiff_t_result_desc=Returns estimated number of intervals between start and end time
SystemSource.Timestampdiff_ts_desc=Calculate estimated number of intervals between start and end timestamp
SystemSource.Timestampdiff_ts_arg1=Interval type
SystemSource.Timestampdiff_ts_arg2=Start timestamp
@@ -668,11 +634,6 @@
SystemSource.Lpad_arg1=String
SystemSource.Lpad_arg2=Padded length
SystemSource.Lpad_result=Padded string
-SystemSource.Lpad2_desc=Pad the input string on the left to length with pad character
-SystemSource.Lpad2_arg1=String
-SystemSource.Lpad2_arg2=Padded length
-SystemSource.Lpad2_arg3=Pad character
-SystemSource.Lpad2_result=Padded string
SystemSource.Lpad3_desc=Pad the input string on the left to length with pad character
SystemSource.Lpad3_arg1=String
SystemSource.Lpad3_arg2=Padded length
@@ -682,11 +643,6 @@
SystemSource.Rpad1_arg1=String
SystemSource.Rpad1_arg2=Padded length
SystemSource.Rpad1_result=Padded string
-SystemSource.Rpad2_desc=Pad the input string on the right to length with pad character
-SystemSource.Rpad2_arg1=String
-SystemSource.Rpad2_arg2=Padded length
-SystemSource.Rpad2_arg3=Pad character
-SystemSource.Rpad2_result=Padded string
SystemSource.Rpad3_desc=Pad the input string on the right to length with pad character
SystemSource.Rpad3_arg1=String
SystemSource.Rpad3_arg2=Padded length
@@ -704,17 +660,6 @@
SystemSource.Context_arg1=XML context tag
SystemSource.Context_arg2=XML element
SystemSource.Context_result=Expression in higher context
-SystemSource.Relate_desc=Evaluate XML expression using the sibling relationship mode
-SystemSource.Relate_arg1=Relationship mapping root
-SystemSource.Relate_arg2=Relationship source root
-SystemSource.Relate_arg3=Relationship object root
-SystemSource.Relate_result=Same expression
-SystemSource.RelateSource_desc=Apply XML expression to the source entity when using XML relationship mode
-SystemSource.RelateSource_arg1=Expression
-SystemSource.RelateSource_result=Same expression
-SystemSource.RelateTarget_desc=Apply XML expression to the target entity when using XML relationship mode
-SystemSource.RelateTarget_arg1=Expression
-SystemSource.RelateTarget_result=Same expression
SystemSource.Rowlimit_desc=Limit the number of rows from an XML mapping class
SystemSource.RowlimitException_desc=Limit the number of rows from an XML mapping class, throw Exception if passed
SystemSource.Rowlimit_arg1=XML tag in the scope of a mapping class
@@ -770,19 +715,13 @@
SystemSource.Bitfunc2_arg2=Second integer
SystemSource.Convert_desc=Convert from {0} to target type
SystemSource.xpathvalue_description=Retrieve the first match content for an XPath statement
-SystemSource.xpath_description=Evaluate the XPath expression against a document
SystemSource.xpath_param1=Source document
SystemSource.xpath_param2=XPath expression
SystemSource.xpathvalue_result=Single result
-SystemSource.xpath_result=XPath result
SystemSource.xsltransform_description=Transform the document with the given stylesheet.
SystemSource.xsltransform_param1=Source document
SystemSource.xsltransform_param2=XSL stylesheet
SystemSource.xsltransform_result=Clob result
-SystemSource.xmlelement_description=Create an XML element.
-SystemSource.xmlelement_param1=Element name
-SystemSource.xmlelement_param2=Element contents
-SystemSource.xmlelement_result=XML result
SystemSource.xmlconcat_description=Concat XML types.
SystemSource.xmlconcat_param1=First element
SystemSource.xmlcomment_description=Create an XML comment.
@@ -810,7 +749,6 @@
SystemSource.from_unixtime_result=Timestamp value
SystemSource.nullif_description=Equivalent to case when (param1 = param2) then null else param1
SystemSource.nullif_param1=First parameter
-SystemSource.nullif_param2=Second parameter
SystemSource.nullif_result=null if the parameters are equivalent else param1
SystemSource.coalesce_description=Returns the first non-null parameter
SystemSource.coalesce_param1=parameter
@@ -828,36 +766,20 @@
ExpressionEvaluator.Must_push=Function {0} is marked in the function metadata as a function that must be evaluated at the source.
ExpressionEvaluator.Eval_failed=Unable to evaluate {0}: {1}
XMLSerialize.resolvingError=XMLSerialize is valid only for XML expressions: {0}
-QueryString.resolvingError=All query string expressions must be convertable to string.
Evaluator.xmlserialize=XMLSerialize: data exception - not an xml document
Evaluator.xmlquery=Error evaluating XMLQuery: {0}
-Evaluator.xmlquery_content=XQuery evaluation was expected to return content, but it returned a sequence.
-FunctionDefinitionsReader.Read_error=Error reading FunctionDefinitions.xmi: {0}
-FunctionDefinitionsSource.Read_error=Error reading {0}
ExecResolver.Param_convert_fail=Unable to convert procedural parameter of type {0} to expected type {1}
DynamicCommandResolver.SQL_String=Expected dynamic command sql to be of type STRING instead of type {0}.
-UnionQueryResolver.type_conversion_fail=Union query projected element {0} with type {1} and projected element {2} with type {3} are not compatible.
UnionQueryResolver.type_conversion=The Expression {0} used in a nested UNION ORDER BY clause cannot be implicitly converted from type {1} to type {2}.
ValidationVisitor.select_into_no_implicit_conversion=There is no implicit conversion between the source element type ({0}) and the target element type ({1}) at position {2} of the query: {3}
ValidationVisitor.excpet_intersect_all=EXCEPT ALL and INTERSECT ALL are currently unsupported
-ValidationVisitor.batch_command_updated_invalid_group=Only physical tables can be updated by a batched command. Cannot update {0} within a batch.
-ValidationVisitor.select_into_too_few_elements=Too few elements being SELECTed INTO the target table. Must select exactly {0} elements.
ValidationVisitor.element_updates_not_allowed=Metadata does not allow updates on the element: {0}
-ValidationVisitor.validateAccessPattern1=Access pattern is not satisfied for query {0}
ValidationVisitor.invalid_batch_command=Only INSERT, UPDATE, DELETE, and SELECT ... INTO statements are allowed within a batch.
-ValidationVisitor.badoffset1=The row offset in the LIMIT clause must be an integer literal
ValidationVisitor.badoffset2=The row offset in the LIMIT clause must be >= 0
-ValidationVisitor.badlimit1=The row limit in the LIMIT clause must be an integer literal
ValidationVisitor.badlimit2=The row limit in the LIMIT clause must be >= 0
-ValidationVisitor.pi_isNotNull=Cannot have a negated null check on a procedure input
-ValidationVisitor.proc_input_element=The assignment expression ''{0}'' is invalid. A procedure input element cannot be set to another element
ValidationVisitor.invalid_scalar_group_reference=Cannot reference a scalar group as a table: {0}
-ValidationVisitor.temp_group_in_dynamic=Only temp groups should be specified in a dyanmic command into clause
-ValidationVisitor.if_subquery=If and while criteria cannot contain subqueries.
-ValidationVisitor.assignment_subquery=Assignment, declaration, dynamic SQL, and dynamic SQL USING expressions cannot contain subqueries. A separate assignment statement should be used for each subquery.
ValidationVisitor.select_into_wrong_elements=Wrong number of elements being SELECTed INTO the target table. Expected {0} elements, but was {1}.
SimpleQueryResolver.Query_was_redirected_to_Mat_table=The query against {0} was redirected to the materialization table {1}.
-SimpleQueryResolver.Loading_materialized_table=The query is loading materialized group {0} so primary transformation was used.
SimpleQueryResolver.ambiguous_all_in_group=The symbol {0} refers to more than one group defined in the FROM clause.
SimpleQueryResolver.Proc_Relational_Name_conflict=Cannot access procedure {0} using table semantics since the parameter and result set column names are not all unique.
QueryResolver.invalid_xpath=Invalid xpath value: {0}
@@ -867,8 +789,6 @@
SimpleQueryResolver.procedure_cache_used=Procedure caching will be used for {0}.
SimpleQueryResolver.procedure_cache_not_usable=Procedure caching will not be used for {0} since the result set cache is disabled or the results/parameters cannot be cached.
SimpleQueryResolver.procedure_cache_not_used=Procedure caching will not be used for {0} due to the use of OPTION NOCACHE.
-ValidationVisitor.input_variable_data_type_not_match=The expression "{0}" assigned to input variable "{1}" is of type "{2}" which cannot be implicitly converted to the expected type "{3}".
-ValidationVisitor.input_variable_can_not_in_function=Input variable "{0}" cannot be an argument of a function in the criteria.
ValidationVisitor.groupby_subquery=Expressions used in a GROUP BY cannot be constant and must not contain subqueries: "{0}".
ValidationVisitor.Procedure_should_have_query=Procedure must execute at least one command to define the procedure result set.
ValidationVisitor.Procedure_has_group_self_reference=Procedure cannot have a Group reference to itself.
@@ -880,13 +800,7 @@
ValidationVisitor.2=The ''rowlimit'' and ''rowlimitexception'' functions arg must be an XML node symbol
ValidationVisitor.3=''Rowlimit'' and ''rowlimitexception'' functions can only be used within a compare criteria which is entirely a single conjunct.
ValidationVisitor.Context_function_nested=Context functions cannot be nested
-ValidationVisitor.update_temp=Update or Delete operations are not allowed on temporary tables: ''{0}''
ERR.015.004.0036= First argument in ''context'' must be the name of a node in the XML document model. Found Object {0} of Class {1}
-XMLSystemFunctions.xpathvalue_takes_only_string=The XPathValue function can only accept XML data in string form. The input is of type {0}.
-XMLSystemFunctions.wrap_exception=Error occurred evaluating XPathValue with XPath=''{0}'': {1}
-FunctionMethods.cant_execute_relate=The relate function may only be used in XML queries.
-FunctionMethods.cant_execute_relateSource=The relateSource function may only be used in XML relationship models and queries.
-FunctionMethods.cant_execute_relateTarget=The relateTarget function may only be used in XML relationship models and queries.
ExecResolver.invalid_named_params=Invalid param name(s): {0}. Name(s) of params without explicit values: {1}
ExecResolver.duplicate_named_params=Duplicate named param ''{0}''
ResolverUtil.required_param=Required parameter ''{0}'' has no value was set or is an invalid parameter.
@@ -895,14 +809,10 @@
ResolverUtil.setquery_order_expression=ORDER BY expression ''{0}'' cannot be used with a set query.
ResolverUtil.invalid_unrelated=Unrelated order by column {0} cannot be used in a SET query, with SELECT DISTINCT, or GROUP BY
XMLQueryResolver.xml_only_valid_alone=If any symbol in SELECT clause is ''xml'' or group.''xml'' , then no other element is allowed.
-EvaluateExpressionVisitor.Cant_get_iterator=Unable to retrieve ValueIterator with independent value expression: {0}
-ResolveFunctionsVisitor.xpath_cant_be_null=XPath cannot be null
ResolveVariablesVisitor.datatype_for_the_expression_not_resolvable=The datatype for the expression was not resolvable.
-Create.type_not_supported=The data type "{0}" is not supported.
TempTableResolver.unqualified_name_required=Cannot create temporary table "{0}". Local temporary tables must be created with unqualified names.
TempTableResolver.table_already_exists=Cannot create temporary table "{0}". A table with the same name already exists.
ValidationVisitor.drop_of_nontemptable=Cannot drop a non temporary table "{0}".
-ValidationVisitor.unrelated_orderby_xml=XML queries cannot order by an unrelated order by item.
ValidationVisitor.orderby_expression_xml=XML queries cannot order by an expression.
ValidationVisitor.text_table_invalid_width=For a fixed width text table, all columns must have width set.
ValidationVisitor.text_table_width=Fixed width text tables should not have DELIMITER, QUOTE, ESCAPE, or HEADER specified.
@@ -924,20 +834,16 @@
ValidationVisitor.xmlserialize_type=XMLSERIALIZE expects a STRING, CLOB, or BLOB value.
ValidationVisitor.invalid_encoding=Encoding {0} is not valid.
UpdateProcedureResolver.only_variables=Element symbol "{0}" cannot be assigned a value. Only declared VARIABLES can be assigned values.
-wrong_result_type=No results found; or non-XML result object has been produced as a result of the execution of XQuery expression. Please note that only XML type results are supported.
MappingLoader.unknown_node_type=Unknown Node Type "{0}" being loaded by the XML mapping document.
-MappingLoader.invalid_parent=Attribute or Comment nodes can not have children.
MappingLoader.invalid_criteria_node=Invalid criteria node found; A criteria node must have criteria specified or it must be a default node.
WrongTypeChild=Wrong type of child node is being added.
NoCriteria=Failed to add the node, because Criteria nodes must have "criteria" value set on them, or they need to be the default node.
root_cannotbe_null=Root node assigned to a document can be null.
invalid_recurive_node= Found recursive node {0} without recursive root node.
-criteria_node_not_allowed=Criteria Nodes can be only added on the Choice nodes; Wrong type of parent found.
SaxonXQueryExpression.bad_xquery=Failed to evaluate XQuery expression; Please check the query and correct errors in syntax or usage.
SaxonXQueryExpression.compile_failed=Could not compile XQuery; Please check the query for syntax or usage errors.
SaxonXQueryExpression.invalid_path=Column "{0}" has an invalid path expression: {1}
SaxonXQueryExpression.bad_context=Error building Source for context item.
-SimpleQueryResolver.unknown_group_in_nocache=Unknown group "{0}" found in the Option NOCACHE hint.
MappingLoader.invalidName=Null or blank name found in the Mapping Document, Must have valid name. Re-build the VDB
MatchCriteria.invalid_escape=Invalid escape sequence "{0}" with escape character "{1}"
QueryUtil.wrong_number_of_values=The number of bound values ''{0}'' does not match the number of parameters ''{1}'' in the prepared statement.
@@ -947,12 +853,10 @@
NewCalculateCostUtil.badCost=Unexpected format encountered for max or min value
WorkerPool.Max_thread=Reached maximum thread count "{0}" for worker pool "{1}" with a queue size of "{2}".
-WorkerPool.New_thread=Created worker thread "{0}".
WorkerPool.uncaughtException=Uncaught exception processing work
-XMLSystemFunctions.invalid_namespaces=Invalid namespaces supplied for XPath expression - ''{0}''
TempTable.duplicate_key=Duplicate key
ValidationVisitor.group_in_both_dep=Table specified in both dependent and independent queries '{0}'
XMLQuery.resolvingError=Failed to resolve the query '{0}'
-SQLParser.non_position_constant=Invalid order by at {0}
\ No newline at end of file
+SQLParser.non_position_constant=Invalid order by at {0}
14 years, 3 months
teiid SVN: r2538 - in branches/7.1.x/connectors: translator-salesforce/src/main/java/org/teiid/translator/salesforce and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-09-07 18:36:07 -0400 (Tue, 07 Sep 2010)
New Revision: 2538
Removed:
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
Modified:
branches/7.1.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
Log:
TEIID-1027: Removing the Messages class. use SalesForcePlugin instead.
Modified: branches/7.1.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
--- branches/7.1.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -33,7 +33,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.resource.spi.BasicConnection;
-import org.teiid.translator.salesforce.Messages;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.execution.DataPayload;
import org.teiid.translator.salesforce.execution.DeletedObject;
@@ -115,7 +114,7 @@
} catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
throw new ResourceException(e.getCause().getMessage());
}
- LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username);
+ LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
sh = new SessionHeader();
sh.setSessionId(loginResult.getSessionId());
@@ -156,7 +155,7 @@
if(batchSize > 2000) {
batchSize = 2000;
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.reduced.batch.size")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "reduced.batch.size"); //$NON-NLS-1$
}
QueryResult qr = null;
@@ -216,7 +215,7 @@
DeleteResult result = results.get(i);
if(!result.isSuccess()) {
if(allGood) {
- errorMessages.append("Error(s) executing DELETE: ");
+ errorMessages.append("Error(s) executing DELETE: "); //$NON-NLS-1$
allGood = false;
}
List<com.sforce.soap.partner.Error> errors = result.getErrors();
Deleted: branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Messages.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -1,40 +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.MissingResourceException;
-
-import org.teiid.core.BundleUtil;
-
-public class Messages {
-
- private static final BundleUtil RESOURCE_BUNDLE = BundleUtil.getBundleUtil(Messages.class);
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
Modified: branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/Util.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -30,9 +30,9 @@
public class Util {
public static String stripQutes(String id) {
- if((id.startsWith("'") && id.endsWith("'"))) {
+ if((id.startsWith("'") && id.endsWith("'"))) { //$NON-NLS-1$ //$NON-NLS-2$
id = id.substring(1,id.length()-1);
- } else if ((id.startsWith("\"") && id.endsWith("\""))) {
+ } else if ((id.startsWith("\"") && id.endsWith("\""))) { //$NON-NLS-1$ //$NON-NLS-2$
id = id.substring(1,id.length()-1);
}
return id;
@@ -40,11 +40,11 @@
public static String addSingleQuotes(String text) {
StringBuffer result = new StringBuffer();
- if(!text.startsWith("'")) {
+ if(!text.startsWith("'")) { //$NON-NLS-1$
result.append('\'');
}
result.append(text);
- if(!text.endsWith("'")) {
+ if(!text.endsWith("'")) { //$NON-NLS-1$
result.append('\'');
}
return result.toString();
@@ -52,20 +52,20 @@
public static void validateQueryLength(StringBuffer query) throws TranslatorException {
if(query.length() >= 10000) {
- throw new TranslatorException(Messages.getString("Util.query.exceeds.max.length"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("Util.query.exceeds.max.length")); //$NON-NLS-1$
}
}
public static SimpleDateFormat getSalesforceDateTimeFormat() {
- return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+ return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); //$NON-NLS-1$
}
public static SimpleDateFormat getTimeZoneOffsetFormat() {
- return new SimpleDateFormat("Z");
+ return new SimpleDateFormat("Z"); //$NON-NLS-1$
}
public static DateFormat getSalesforceDateFormat() {
- return new SimpleDateFormat("yyyy-MM-dd");
+ return new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
}
}
Modified: branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/QueryExecutionImpl.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -49,7 +49,7 @@
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.SalesforceConnection;
import org.teiid.translator.salesforce.Util;
import org.teiid.translator.salesforce.execution.visitors.JoinQueryVisitor;
@@ -104,11 +104,11 @@
}
public void cancel() throws TranslatorException {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.cancel"));//$NON-NLS-1$
}
public void close() {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, Messages.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.close")); //$NON-NLS-1$
}
@Override
@@ -248,7 +248,7 @@
if (element.getNameInSource().equalsIgnoreCase("id")) { //$NON-NLS-1$
setValueInColumn(j, sObject.getId(), result);
} else {
- throw new TranslatorException(Messages.getString("SalesforceQueryExecutionImpl.missing.field")+ element.getNameInSource()); //$NON-NLS-1$
+ throw new TranslatorException(SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.missing.field")+ element.getNameInSource()); //$NON-NLS-1$
}
} else {
Object cell;
@@ -305,7 +305,7 @@
@SuppressWarnings("unchecked")
private Object getCellDatum(Column element, Element elem) throws TranslatorException {
if(!element.getNameInSource().equals(elem.getLocalName())) {
- throw new TranslatorException(Messages.getString("SalesforceQueryExecutionImpl.column.mismatch1") + element.getNameInSource() + Messages.getString("SalesforceQueryExecutionImpl.column.mismatch2") + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new TranslatorException(SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.column.mismatch1") + element.getNameInSource() + SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.column.mismatch2") + elem.getLocalName()); //$NON-NLS-1$ //$NON-NLS-2$
}
String value = elem.getTextContent();
Object result = null;
@@ -318,37 +318,31 @@
result = Boolean.valueOf(value);
} else if (type.equals(Double.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = Double.valueOf(value);
}
}
} else if (type.equals(Integer.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = Integer.valueOf(value);
}
}
} else if (type.equals(java.sql.Date.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else {
+ if(!value.isEmpty()) {
result = java.sql.Date.valueOf(value);
}
}
} else if (type.equals(java.sql.Timestamp.class)) {
if (null != value) {
- if(value.isEmpty()) {
- result = null;
- } else try {
- Date date = Util.getSalesforceDateTimeFormat().parse(value);
- result = new Timestamp(date.getTime());
- } catch (ParseException e) {
- throw new TranslatorException(e, Messages.getString("SalesforceQueryExecutionImpl.datatime.parse") + value); //$NON-NLS-1$
+ if(!value.isEmpty()) {
+ try {
+ Date date = Util.getSalesforceDateTimeFormat().parse(value);
+ result = new Timestamp(date.getTime());
+ } catch (ParseException e) {
+ throw new TranslatorException(e, SalesForcePlugin.Util.getString("SalesforceQueryExecutionImpl.datatime.parse") + value); //$NON-NLS-1$
+ }
}
}
} else {
Modified: branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/CriteriaVisitor.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -45,7 +45,7 @@
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.metadata.Table;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.Util;
@@ -54,21 +54,21 @@
*/
public abstract class CriteriaVisitor extends HierarchyVisitor implements ICriteriaVisitor {
- private static final String RESTRICTEDMULTISELECTPICKLIST = "restrictedmultiselectpicklist";
- private static final String MULTIPICKLIST = "multipicklist";
- protected static final String SELECT = "SELECT";
- protected static final String FROM = "FROM";
- protected static final String WHERE = "WHERE";
- protected static final String ORDER_BY = "ORDER BY";
- protected static final String LIMIT = "LIMIT";
- protected static final String SPACE = " ";
- protected static final String EXCLUDES = "EXCLUDES";
- protected static final String INCLUDES = "includes";
- protected static final String COMMA = ",";
- protected static final String SEMI = ";";
- protected static final String APOS = "'";
- protected static final String OPEN = "(";
- protected static final String CLOSE = ")";
+ private static final String RESTRICTEDMULTISELECTPICKLIST = "restrictedmultiselectpicklist"; //$NON-NLS-1$
+ private static final String MULTIPICKLIST = "multipicklist"; //$NON-NLS-1$
+ protected static final String SELECT = "SELECT"; //$NON-NLS-1$
+ protected static final String FROM = "FROM"; //$NON-NLS-1$
+ protected static final String WHERE = "WHERE"; //$NON-NLS-1$
+ protected static final String ORDER_BY = "ORDER BY"; //$NON-NLS-1$
+ protected static final String LIMIT = "LIMIT"; //$NON-NLS-1$
+ protected static final String SPACE = " "; //$NON-NLS-1$
+ protected static final String EXCLUDES = "EXCLUDES"; //$NON-NLS-1$
+ protected static final String INCLUDES = "includes"; //$NON-NLS-1$
+ protected static final String COMMA = ","; //$NON-NLS-1$
+ protected static final String SEMI = ";"; //$NON-NLS-1$
+ protected static final String APOS = "'"; //$NON-NLS-1$
+ protected static final String OPEN = "("; //$NON-NLS-1$
+ protected static final String CLOSE = ")"; //$NON-NLS-1$
protected RuntimeMetadata metadata;
private HashMap<Comparison.Operator, String> comparisonOperators;
@@ -87,12 +87,12 @@
public CriteriaVisitor( RuntimeMetadata metadata ) {
this.metadata = metadata;
comparisonOperators = new HashMap<Comparison.Operator, String>();
- comparisonOperators.put(Operator.EQ, "=");
- comparisonOperators.put(Operator.GE, ">=");
- comparisonOperators.put(Operator.GT, ">");
- comparisonOperators.put(Operator.LE, "<=");
- comparisonOperators.put(Operator.LT, "<");
- comparisonOperators.put(Operator.NE, "!=");
+ comparisonOperators.put(Operator.EQ, "="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.GE, ">="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.GT, ">"); //$NON-NLS-1$
+ comparisonOperators.put(Operator.LE, "<="); //$NON-NLS-1$
+ comparisonOperators.put(Operator.LT, "<"); //$NON-NLS-1$
+ comparisonOperators.put(Operator.NE, "!="); //$NON-NLS-1$
}
@Override
@@ -111,12 +111,11 @@
public void visit( Like criteria ) {
try {
if (isIdColumn(criteria.getLeftExpression())) {
- TranslatorException e = new TranslatorException(Messages.getString("CriteriaVisitor.LIKE.not.supported.on.Id"));
+ TranslatorException e = new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.LIKE.not.supported.on.Id")); //$NON-NLS-1$
exceptions.add(e);
}
if (isMultiSelectColumn(criteria.getLeftExpression())) {
- TranslatorException e = new TranslatorException(
- Messages.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect"));
+ TranslatorException e = new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.LIKE.not.supported.on.multiselect")); //$NON-NLS-1$
exceptions.add(e);
}
} catch (TranslatorException e) {
@@ -187,9 +186,9 @@
public void parseFunction( Function func ) {
String functionName = func.getName();
try {
- if (functionName.equalsIgnoreCase("includes")) {
+ if (functionName.equalsIgnoreCase("includes")) { //$NON-NLS-1$
generateMultiSelect(func, INCLUDES);
- } else if (functionName.equalsIgnoreCase("excludes")) {
+ } else if (functionName.equalsIgnoreCase("excludes")) { //$NON-NLS-1$
generateMultiSelect(func, EXCLUDES);
}
} catch (TranslatorException e) {
@@ -238,13 +237,13 @@
private void validateFunction( List<Expression> expressions ) throws TranslatorException {
if (expressions.size() != 2) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.invalid.arg.count"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.invalid.arg.count")); //$NON-NLS-1$
}
if (!(expressions.get(0) instanceof ColumnReference)) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.column.arg"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.column.arg")); //$NON-NLS-1$
}
if (!(expressions.get(1) instanceof Literal)) {
- throw new TranslatorException(Messages.getString("CriteriaVisitor.function.not.literal.arg"));
+ throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.literal.arg")); //$NON-NLS-1$
}
}
@@ -253,7 +252,7 @@
criterion.append(OPEN);
boolean first = true;
String fullParam = param.toString();
- String[] params = fullParam.split(",");
+ String[] params = fullParam.split(","); //$NON-NLS-1$
for (int i = 0; i < params.length; i++) {
String token = params[i];
if (first) {
@@ -309,7 +308,7 @@
criteriaList.add(queryString.toString());
- if (columnName.equals("IsDeleted")) {
+ if (columnName.equals("IsDeleted")) { //$NON-NLS-1$
Literal isDeletedLiteral = (Literal)compCriteria.getRightExpression();
Boolean isDeleted = (Boolean)isDeletedLiteral.getValue();
if (isDeleted) {
@@ -328,9 +327,9 @@
queryString.append(getValue(leftExp));
queryString.append(' ');
if (criteria.isNegated()) {
- queryString.append("NOT ");
+ queryString.append("NOT "); //$NON-NLS-1$
}
- queryString.append("IN");
+ queryString.append("IN"); //$NON-NLS-1$
queryString.append('(');
Column column = ((ColumnReference)criteria.getLeftExpression()).getMetadataObject();
boolean timeColumn = isTimeColumn(column);
@@ -366,17 +365,16 @@
Literal literal = (Literal)expr;
result = literal.getValue().toString();
} else {
- throw new RuntimeException("unknown type in SalesforceQueryExecution.getValue(): " + expr.toString());
+ throw new RuntimeException("unknown type in SalesforceQueryExecution.getValue(): " + expr.toString()); //$NON-NLS-1$
}
return result;
}
protected void loadColumnMetadata( NamedTable group ) throws TranslatorException {
table = group.getMetadataObject();
- String supportsQuery = table.getProperties().get("Supports Query");
+ String supportsQuery = table.getProperties().get("Supports Query"); //$NON-NLS-1$
if (!Boolean.valueOf(supportsQuery)) {
- throw new TranslatorException(table.getNameInSource() + " "
- + Messages.getString("CriteriaVisitor.query.not.supported"));
+ throw new TranslatorException(table.getNameInSource() + " " + SalesForcePlugin.Util.getString("CriteriaVisitor.query.not.supported")); //$NON-NLS-1$ //$NON-NLS-2$
}
List<Column> columnIds = table.getColumns();
for (Column element : columnIds) {
@@ -384,7 +382,7 @@
columnElementsByName.put(name, element);
// influences queryAll behavior
- if (element.getNameInSource().equals("IsDeleted")) {
+ if (element.getNameInSource().equals("IsDeleted")) { //$NON-NLS-1$
String isDeleted = element.getDefaultValue();
if (Boolean.parseBoolean(isDeleted)) {
this.queryAll = true;
@@ -398,7 +396,7 @@
if (expression instanceof ColumnReference) {
Column element = ((ColumnReference)expression).getMetadataObject();
String nameInSource = element.getNameInSource();
- if (nameInSource.equalsIgnoreCase("id")) {
+ if (nameInSource.equalsIgnoreCase("id")) { //$NON-NLS-1$
result = true;
}
}
Modified: branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-09-07 22:20:04 UTC (rev 2537)
+++ branches/7.1.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/visitors/SelectVisitor.java 2010-09-07 22:36:07 UTC (rev 2538)
@@ -40,7 +40,7 @@
import org.teiid.metadata.Table;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.Constants;
-import org.teiid.translator.salesforce.Messages;
+import org.teiid.translator.salesforce.SalesForcePlugin;
import org.teiid.translator.salesforce.Util;
@@ -61,8 +61,7 @@
public void visit(Select query) {
super.visit(query);
if (query.isDistinct()) {
- exceptions.add(new TranslatorException(
- Messages.getString("SelectVisitor.distinct.not.supported")));
+ exceptions.add(new TranslatorException(SalesForcePlugin.Util.getString("SelectVisitor.distinct.not.supported")));
}
selectSymbols = query.getDerivedColumns();
selectSymbolCount = selectSymbols.size();
@@ -78,9 +77,7 @@
selectSymbolNameToIndex .put(element.getNameInSource(), index);
String nameInSource = element.getNameInSource();
if (null == nameInSource || nameInSource.length() == 0) {
- exceptions.add(new TranslatorException(
- "name in source is null or empty for column "
- + symbol.toString()));
+ exceptions.add(new TranslatorException("name in source is null or empty for column "+ symbol.toString()));
continue;
}
if (nameInSource.equalsIgnoreCase("id")) {
@@ -98,8 +95,7 @@
String supportsQuery = table.getProperties().get(Constants.SUPPORTS_QUERY);
objectSupportsRetrieve = Boolean.valueOf(table.getProperties().get(Constants.SUPPORTS_RETRIEVE));
if (!Boolean.valueOf(supportsQuery)) {
- throw new TranslatorException(table.getNameInSource() + " "
- + Messages.getString("CriteriaVisitor.query.not.supported"));
+ throw new TranslatorException(table.getNameInSource() + " " + SalesForcePlugin.Util.getString("CriteriaVisitor.query.not.supported"));
}
loadColumnMetadata(obj);
} catch (TranslatorException ce) {
14 years, 3 months