teiid SVN: r3084 - in trunk: engine/src/main/java/org/teiid/query/function/aggregate and 16 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-12 19:20:51 -0400 (Tue, 12 Apr 2011)
New Revision: 3084
Added:
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCProceduresSchema.java
trunk/test-integration/common/src/test/resources/bqt.vdb
Removed:
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_PROC.expected
Modified:
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected
trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_INDEX.expected
trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testIndexInfo.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testPrimaryKeys.expected
trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected
trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
Log:
TEIID-1164: adding parameter metadata support for procedures. This required adding additional data types, implementing a array_agg function.
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -357,6 +357,9 @@
public static final String WITHIN = "WITHIN"; //$NON-NLS-1$
public static final String WITHOUT = "WITHOUT"; //$NON-NLS-1$
public static final String YEAR = "YEAR"; //$NON-NLS-1$
+
+ // SQL 2008 words
+ public static final String ARRAY_AGG= "ARRAY_AGG"; //$NON-NLS-1$
//SQL/XML
Added: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -0,0 +1,68 @@
+/*
+ * 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.query.function.aggregate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.teiid.api.exception.query.ExpressionEvaluationException;
+import org.teiid.api.exception.query.FunctionExecutionException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.util.CommandContext;
+
+public class ArrayAgg extends AggregateFunction {
+
+ private ArrayList<Object> result;
+ private CommandContext context;
+
+ public ArrayAgg(CommandContext context) {
+ this.context = context;
+ }
+
+ @Override
+ public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
+ if (this.result == null) {
+ this.result = new ArrayList<Object>();
+ }
+ this.result.add(input);
+ }
+
+ @Override
+ public Object getResult() throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException,TeiidProcessingException {
+ if (this.result == null) {
+ return null;
+ }
+ return this.result.toArray();
+ }
+
+ @Override
+ public void reset() {
+ this.result = null;
+ }
+
+ @Override
+ boolean filter(Object value) {
+ // handle the null values too.
+ return false;
+ }
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -44,6 +44,7 @@
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.aggregate.AggregateFunction;
+import org.teiid.query.function.aggregate.ArrayAgg;
import org.teiid.query.function.aggregate.Avg;
import org.teiid.query.function.aggregate.ConstantFunction;
import org.teiid.query.function.aggregate.Count;
@@ -189,6 +190,9 @@
case XMLAGG:
functions[i] = new XMLAgg(context);
break;
+ case ARRAY_AGG:
+ functions[i] = new ArrayAgg(context);
+ break;
case TEXTAGG:
functions[i] = new TextAgg(context, (TextLine)ex);
break;
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -62,6 +62,7 @@
MAX,
XMLAGG,
TEXTAGG,
+ ARRAY_AGG,
ANY,
SOME,
EVERY,
@@ -176,6 +177,8 @@
return DataTypeManager.DefaultDataClasses.BOOLEAN;
} else if (isEnhancedNumeric()) {
return DataTypeManager.DefaultDataClasses.DOUBLE;
+ } else if (this.aggregate == Type.ARRAY_AGG) {
+ return DataTypeManager.DefaultDataClasses.OBJECT;
} else {
return this.getExpression().getType();
}
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-04-12 23:20:51 UTC (rev 3084)
@@ -102,6 +102,7 @@
| <AND: "and">
| <ANY: "any">
| <ARRAY: "array">
+| <ARRAY_AGG: "array_agg">
| <AS: "as">
| <ASC: "asc">
| <ATOMIC: "atomic">
@@ -389,6 +390,8 @@
| <RPAREN: ")">
| <LBRACE: "{">
| <RBRACE: "}">
+| <LSBRACE: "[">
+| <RSBRACE: "]">
| <EQ: "=">
| <NE: "<>">
| <NE2: "!=">
@@ -1869,7 +1872,31 @@
}
}
+AggregateSymbol arrayAgg(ParseInfo info) :
+{
+ Expression expression = null;
+ OrderBy orderBy = null;
+}
+{
+ <ARRAY_AGG> <LPAREN>
+ expression = expression(info)
+ [
+ orderBy = orderby(info)
+ ]
+ <RPAREN>
+ {
+ if(! info.aggregatesAllowed) {
+ throw new ParseException(QueryPlugin.Util.getString("SQLParser.Aggregate_only_top_level")); //$NON-NLS-1$
+ }
+
+ String name = generateFunctionName(info, "ARRAY_AGG");
+ AggregateSymbol agg = new AggregateSymbol(name, "ARRAY_AGG", false, expression);
+ agg.setOrderBy(orderBy);
+ return agg;
+ }
+}
+
AggregateSymbol textAgg(ParseInfo info) :
{
DerivedColumn expression = null;
@@ -3294,6 +3321,7 @@
Token symbol = null;
Constant literal = null;
QueryCommand subquery = null;
+ Integer arrayIndex = null;
}
{
(
@@ -3311,8 +3339,8 @@
<RBRACE>
)
|
- LOOKAHEAD(<ID> <LPAREN> <FOR>) (expression=textAgg(info))
- |
+ LOOKAHEAD(<ID> <LPAREN> <FOR>) (expression=textAgg(info))
+ |
// Aggregate function
LOOKAHEAD(<ID>, {matchesAny(getToken(1).image, "count", "min", "max", "sum", "avg", "every", "STDDEV_POP", "STDDEV_SAMP", "VAR_SAMP", "VAR_POP") != null}) (expression=aggregateSymbol(info))
|
@@ -3322,6 +3350,8 @@
|
(expression=xmlAgg(info))
|
+ (expression=arrayAgg(info))
+ |
// Function
LOOKAHEAD(2) (expression=function(info))
|
@@ -3334,6 +3364,7 @@
symbol = null;
}
}
+ (<LSBRACE> arrayIndex = intVal() <RSBRACE>)?
)
|
LOOKAHEAD(subquery(info)) subquery = subquery(info)
@@ -3341,6 +3372,7 @@
( <LPAREN>
expression = expression(info)
<RPAREN>
+ (<LSBRACE> arrayIndex = intVal() <RSBRACE>)?
)
|
// Searched CASE expressions
@@ -3355,16 +3387,18 @@
if (refToken.image.charAt(0) == '$') {
return new Reference(Integer.parseInt(refToken.image.substring(1)) -1);
}
- return new Reference(info.referenceCount++);
+ expression = new Reference(info.referenceCount++);
} else if(symbol != null) {
- return new ElementSymbol(normalizeId(symbol.image));
+ expression = new ElementSymbol(normalizeId(symbol.image));
} else if(literal != null) {
- return literal; // may be null literal
+ expression = literal; // may be null literal
} else if (subquery != null){
- return new ScalarSubquery(subquery);
- } else {
- return expression;
+ expression = new ScalarSubquery(subquery);
}
+ if (arrayIndex != null) {
+ expression = new Function("array_get", new Expression[] {expression, new Constant(arrayIndex)});
+ }
+ return expression;
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -6749,6 +6749,24 @@
helpTest(sql, "SELECT TEXTAGG(FOR e1 AS col1, e2 AS col2 DELIMITER ',' HEADER ORDER BY e2)", query);
}
+ @Test public void testArrayAggWithOrderBy() throws Exception {
+ String sql = "SELECT array_agg(1 order by e2)"; //$NON-NLS-1$
+ AggregateSymbol as = new AggregateSymbol("foo", Reserved.ARRAY_AGG, false, new Constant(1));
+ as.setOrderBy(new OrderBy(Arrays.asList(new ElementSymbol("e2"))));
+ Query query = new Query();
+ query.setSelect(new Select(Arrays.asList(as)));
+ helpTest(sql, "SELECT ARRAY_AGG(1 ORDER BY e2)", query);
+ }
+
+ @Test public void testArrayAggWithIndexing() throws Exception {
+ String sql = "SELECT (array_agg(1))[1]"; //$NON-NLS-1$
+ AggregateSymbol as = new AggregateSymbol("foo", Reserved.ARRAY_AGG, false, new Constant(1));
+ ExpressionSymbol expr = new ExpressionSymbol("expr", new Function("array_get", new Expression[] {as, new Constant(1)}));
+ Query query = new Query();
+ query.setSelect(new Select(Arrays.asList(expr)));
+ helpTest(sql, "SELECT array_get(ARRAY_AGG(1), 1)", query);
+ }
+
@Test public void testNestedTable() throws Exception {
String sql = "SELECT * from TABLE(exec foo()) as x"; //$NON-NLS-1$
Query query = new Query();
Modified: trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -109,6 +109,11 @@
CompositeMetadataStore compositeStore = new CompositeMetadataStore(stores.getStores());
for (MetadataStore s:this.additionalStores) {
compositeStore.addMetadataStore(s);
+ for (Schema schema:s.getSchemas().values()) {
+ if (!schema.getFunctions().isEmpty()) {
+ udfs.add(new FunctionTree(schema.getName(), new UDFSource(schema.getFunctions().values()), true));
+ }
+ }
}
TransformationMetadata metadata = new TransformationMetadata(vdb, compositeStore, visibilityMap, systemFunctions, udfs);
Modified: trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -22,6 +22,7 @@
package org.teiid.deployers;
import java.math.BigInteger;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.Properties;
@@ -30,13 +31,22 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.metadata.AbstractMetadataRecord;
+import org.teiid.metadata.Column;
import org.teiid.metadata.Datatype;
+import org.teiid.metadata.FunctionMethod;
+import org.teiid.metadata.FunctionParameter;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.Table;
+import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.metadata.Table.Type;
import org.teiid.translator.TranslatorException;
public class PgCatalogMetadataStore extends MetadataFactory {
+
+ public static final int PG_TYPE_OIDVECTOR = 30;
+ public static final int PG_TYPE_OIDARRAY = 1028;
+ public static final int PG_TYPE_CHARARRAY = 1002;
+ public static final int PG_TYPE_TEXTARRAY = 1009;
private static final long serialVersionUID = 5391872008395637166L;
private Random random;
@@ -56,6 +66,8 @@
add_pg_database();
add_pg_user();
add_matpg_relatt();
+ add_matpg_datatype();
+ addHasFunctionPrivilage();
}
@Override
@@ -154,13 +166,7 @@
"false as atthasdef " + //$NON-NLS-1$
"FROM SYS.Columns as t1 LEFT OUTER JOIN " + //$NON-NLS-1$
"SYS.Tables st ON (st.Name = t1.TableName AND st.SchemaName = t1.SchemaName) LEFT OUTER JOIN " + //$NON-NLS-1$
- "pg_catalog.pg_type pt ON (CASE " +//$NON-NLS-1$
- "WHEN (t1.DataType = 'clob' OR t1.DataType = 'blob') THEN 'lo' " +//$NON-NLS-1$
- "WHEN (t1.DataType = 'byte' ) THEN 'short' " + //$NON-NLS-1$
- "WHEN (t1.DataType = 'time' ) THEN 'datetime' " + //$NON-NLS-1$
- "WHEN (t1.DataType = 'biginteger' ) THEN 'decimal' " + //$NON-NLS-1$
- "WHEN (t1.DataType = 'bigdecimal' ) THEN 'decimal' " + //$NON-NLS-1$
- "ELSE t1.DataType END = pt.typname)"; //$NON-NLS-1$
+ "pg_catalog.matpg_datatype pt ON t1.DataType = pt.Name";//$NON-NLS-1$
t.setSelectTransformation(transformation);
t.setMaterialized(true);
return t;
@@ -285,31 +291,49 @@
// Number of input arguments
addColumn("pronargs", DataTypeManager.DefaultDataTypes.SHORT, t); //$NON-NLS-1$
- addColumn("proargtypes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
- addColumn("proargnames", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
- addColumn("proargmodes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
- addColumn("proallargtypes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
+ Column c = addColumn("proargtypes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
+ c.setProperty("pg_type:oid", String.valueOf(PG_TYPE_OIDVECTOR)); //$NON-NLS-1$
+ c = addColumn("proargnames", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
+ c.setProperty("pg_type:oid", String.valueOf(PG_TYPE_TEXTARRAY)); //$NON-NLS-1$
+
+ c = addColumn("proargmodes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
+ c.setProperty("pg_type:oid", String.valueOf(PG_TYPE_CHARARRAY)); //$NON-NLS-1$
+
+ c = addColumn("proallargtypes", DataTypeManager.DefaultDataTypes.OBJECT, t); //$NON-NLS-1$
+ c.setProperty("pg_type:oid", String.valueOf(PG_TYPE_OIDARRAY)); //$NON-NLS-1$
+
// The OID of the namespace that contains this function
addColumn("pronamespace", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
addPrimaryKey("pk_pg_proc", Arrays.asList("oid"), t); //$NON-NLS-1$ //$NON-NLS-2$
- String transformation = "SELECT t1.OID as oid, t1.Name as proname, false as proretset, " + //$NON-NLS-1$
- "(SELECT dt.OID FROM ProcedureParams pp, DataTypes dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type = 'ResultSet' AND pp.Position = 1 AND dt.Name = pp.DataType) as prorettype, " + //$NON-NLS-1$
- "convert((SELECT count(*) FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName ), short) as pronargs, " + //$NON-NLS-1$
- "null as proargtypes, " + //$NON-NLS-1$
- "null as proargnames, " + //$NON-NLS-1$
- "null as proargmodes, " + //$NON-NLS-1$
- "null as proallargtypes, " + //$NON-NLS-1$
- "(SELECT OID FROM SYS.Schemas WHERE Name = t1.SchemaName) as pronamespace " + //$NON-NLS-1$
- "FROM SYS.Procedures as t1"; //$NON-NLS-1$
+
+ String transformation = "SELECT t1.OID as oid, t1.Name as proname, (SELECT (CASE WHEN count(pp.Type)>0 THEN true else false END) as x FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName and pp.Type='ResultSet') as proretset, " + //$NON-NLS-1$
+ "CASE WHEN (SELECT count(dt.oid) FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type IN ('ReturnValue', 'ResultSet') AND dt.Name = pp.DataType) IS NULL THEN (select oid from pg_type WHERE typname = 'void') WHEN (SELECT count(dt.oid) FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type = 'ResultSet' AND dt.Name = pp.DataType) IS NOT NULL THEN (select oid from pg_type WHERE typname = 'record') ELSE (SELECT dt.oid FROM ProcedureParams pp, matpg_datatype dt WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type = 'ReturnValue' AND dt.Name = pp.DataType) END as prorettype, " + //$NON-NLS-1$
+ "convert((SELECT count(*) FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type IN ('In', 'InOut')), short) as pronargs, " + //$NON-NLS-1$
+ "(select "+textAggStmt("y.oid","y.type, y.position" )+" FROM ("+paramTable("'ResultSet','ReturnValue', 'Out'")+") as y) as proargtypes, " +//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "(select "+textAggStmt("y.name", "y.type, y.position")+" FROM (SELECT pp.Name as name, pp.position as position, pp.Type as type FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue' )) as y) as proargnames, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "(select case WHEN count(distinct(y.type)) = 1 THEN null ELSE "+textAggStmt("CASE WHEN (y.type ='In') THEN 'i' WHEN (y.type = 'Out') THEN 'o' WHEN (y.type = 'InOut') THEN 'b' WHEN (y.type = 'ResultSet') THEN 't' END", "y.type,y.position")+" END FROM (SELECT pp.Type as type, pp.Position as position FROM ProcedureParams pp WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ('ReturnValue')) as y) as proargmodes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "(select case WHEN count(distinct(y.oid)) = 1 THEN null ELSE "+textAggStmt("y.oid", "y.type, y.position")+" END FROM ("+paramTable("'ReturnValue'")+") as y) as proallargtypes, " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "(SELECT OID FROM SYS.Schemas WHERE Name = t1.SchemaName) as pronamespace " + //$NON-NLS-1$
+ "FROM SYS.Procedures as t1";//$NON-NLS-1$
+
t.setSelectTransformation(transformation);
t.setMaterialized(true);
return t;
}
+
+ private String paramTable(String notIn) {
+ return "SELECT dt.oid as oid, pp.Position as position, pp.Type as type FROM ProcedureParams pp LEFT JOIN matpg_datatype dt ON pp.DataType=dt.Name " + //$NON-NLS-1$
+ "WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ("+notIn+")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ private String textAggStmt(String select, String orderby) {
+ return "array_agg("+select+" ORDER BY "+orderby+")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
-
// triggers
private Table add_pg_trigger() throws TranslatorException {
Table t = createView("pg_trigger"); //$NON-NLS-1$
@@ -360,44 +384,80 @@
addColumn("typtypmod", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
addColumn("typrelid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
+ addColumn("typelem", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
String transformation =
- "SELECT 16 as oid, 'boolean' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 16 as oid, 'boolean' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- //"SELECT 17 as oid, 'blob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ //"SELECT 17 as oid, 'blob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
//" union " + //$NON-NLS-1$
- "SELECT 1043 as oid, 'string' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1043 as oid, 'string' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 25 as oid, 'text' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 25 as oid, 'text' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 1042 as oid, 'char' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1042 as oid, 'char' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 21 as oid, 'short' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(2, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 21 as oid, 'short' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(2, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 20 as oid, 'long' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 20 as oid, 'long' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 23 as oid, 'integer' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 23 as oid, 'integer' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 26 as oid, 'oid' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typname, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 26 as oid, 'oid' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typname, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 700 as oid, 'float' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 700 as oid, 'float' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 701 as oid, 'double' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 701 as oid, 'double' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- //"SELECT 1009 as oid, 'clob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ //"SELECT 1009 as oid, 'clob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
//" union " + //$NON-NLS-1$
- "SELECT 1082 as oid, 'date' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1082 as oid, 'date' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 1083 as oid, 'datetime' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1083 as oid, 'datetime' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 1114 as oid, 'timestamp' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1114 as oid, 'timestamp' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 1700 as oid, 'decimal' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 1700 as oid, 'decimal' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 142 as oid, 'xml' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 142 as oid, 'xml' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 14939 as oid, 'lo' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X"; //$NON-NLS-1$
-
+ "SELECT 14939 as oid, 'lo' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X"+//$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 2278 as oid, 'void' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('p', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 2249 as oid, 'record' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('p', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 30 as oid, 'oidvector' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 26 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1000 as oid, '_bool' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 16 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1002 as oid, '_char' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 18 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1005 as oid, '_int2' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 21 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1007 as oid, '_int4' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 23 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1009 as oid, '_text' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 25 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1028 as oid, '_oid' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 26 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1014 as oid, '_bpchar' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1042 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1015 as oid, '_varchar' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1043 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1016 as oid, '_int8' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 20 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1021 as oid, '_float4' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 700 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1022 as oid, '_float8' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 701 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1115 as oid, '_timestamp' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1114 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1182 as oid, '_date' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1082 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 1183 as oid, '_time' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1083 as typelem FROM (SELECT 1) X"+ //$NON-NLS-1$
+ " union " + //$NON-NLS-1$
+ "SELECT 2287 as oid, '_record' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 2249 as typelem FROM (SELECT 1) X"; //$NON-NLS-1$
t.setSelectTransformation(transformation);
return t;
}
@@ -451,10 +511,11 @@
addColumn("relname", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
addColumn("nspname", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
addColumn("autoinc", DataTypeManager.DefaultDataTypes.BOOLEAN, t); //$NON-NLS-1$
+ addColumn("typoid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
addPrimaryKey("pk_matpg_relatt_names", Arrays.asList("attname", "relname", "nspname"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
addIndex("idx_matpg_relatt_ids", true, Arrays.asList("attrelid", "attnum"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String transformation = "select pg_class.oid as attrelid, attnum, attname, relname, nspname, IsAutoIncremented as autoinc " + //$NON-NLS-1$
+ String transformation = "select pg_class.oid as attrelid, attnum, attname, relname, nspname, IsAutoIncremented as autoinc, cast((select p.value from SYS.Properties p where p.name = 'pg_type:oid' and p.uid = SYS.Columns.uid) as integer) as typoid " + //$NON-NLS-1$
"from pg_attribute, pg_class, pg_namespace, SYS.Columns " + //$NON-NLS-1$
"where pg_attribute.attrelid = pg_class.oid and pg_namespace.oid = relnamespace" + //$NON-NLS-1$
" and SchemaName = nspname and TableName = relname and Name = attname"; //$NON-NLS-1$
@@ -462,4 +523,48 @@
t.setMaterialized(true);
return t;
}
+
+ private Table add_matpg_datatype() throws TranslatorException {
+ Table t = createView("matpg_datatype"); //$NON-NLS-1$
+ addColumn("oid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
+ addColumn("typname", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
+ addColumn("name", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
+ addColumn("uid", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$
+ addColumn("typlen", DataTypeManager.DefaultDataTypes.SHORT, t); //$NON-NLS-1$
+
+ addPrimaryKey("matpg_datatype_names", Arrays.asList("oid", "name"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ addIndex("matpg_datatype_ids", true, Arrays.asList("typname", "oid"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String transformation = "select pt.oid as oid, pt.typname as typname, t.Name name, t.UID, pt.typlen from pg_catalog.pg_type pt JOIN (select (CASE "+//$NON-NLS-1$
+ "WHEN (Name = 'clob' OR Name = 'blob') THEN 'lo' " +//$NON-NLS-1$
+ "WHEN (Name = 'byte' ) THEN 'short' " +//$NON-NLS-1$
+ "WHEN (Name = 'time' ) THEN 'datetime' " + //$NON-NLS-1$
+ "WHEN (Name = 'biginteger' ) THEN 'decimal' " +//$NON-NLS-1$
+ "WHEN (Name = 'bigdecimal' ) THEN 'decimal' " +//$NON-NLS-1$
+ "ELSE Name END) as pg_name, Name, UID from SYS.DataTypes) as t ON t.pg_name = pt.typname"; //$NON-NLS-1$
+ t.setSelectTransformation(transformation);
+ t.setMaterialized(true);
+ return t;
+ }
+
+ private FunctionMethod addHasFunctionPrivilage() throws TranslatorException {
+ FunctionMethod func = addFunction("has_function_privilege"); //$NON-NLS-1$
+
+ ArrayList<FunctionParameter> inParams = new ArrayList<FunctionParameter>();
+ inParams.add(new FunctionParameter("oid", DataTypeManager.DefaultDataTypes.INTEGER, ""));//$NON-NLS-1$ //$NON-NLS-2$
+ inParams.add(new FunctionParameter("permission", DataTypeManager.DefaultDataTypes.STRING, "")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ func.setInputParameters(inParams);
+ func.setOutputParameter(new FunctionParameter("result", DataTypeManager.DefaultDataTypes.BOOLEAN, "")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ func.setInvocationClass(ReturnTrue.class.getName());
+ func.setInvocationMethod("result"); //$NON-NLS-1$
+ func.setPushdown(PushDown.CANNOT_PUSHDOWN);
+ return func;
+ }
+
+ public static class ReturnTrue{
+ public static boolean result(@SuppressWarnings("unused")int oid, @SuppressWarnings("unused") String permission) {
+ return true;
+ }
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -126,15 +126,7 @@
"\\s+on cn.conrelid = ref.confrelid" + //$NON-NLS-1$
"\\s+and cn.contype = 'p'\\)" + //$NON-NLS-1$
"\\s+order by ref.oid, ref.i"); //$NON-NLS-1$
-
- private static Pattern procParametersPattern = Pattern.compile("select proname, proretset, prorettype, pronargs, proargtypes, " + //$NON-NLS-1$
- "nspname, p.oid, atttypid, attname, proargnames, proargmodes, proallargtypes from ((pg_catalog.pg_namespace n inner join " + //$NON-NLS-1$
- "pg_catalog.pg_proc p on p.pronamespace = n.oid) inner join pg_type t on t.oid = p.prorettype) left outer join " + //$NON-NLS-1$
- "pg_attribute a on a.attrelid = t.typrelid and attnum > 0 and not attisdropped " + //$NON-NLS-1$
- "where has_function_privilege(p.oid, 'EXECUTE') and nspname like (E?(?:'[^']*')+) " + //$NON-NLS-1$
- "and proname like (E?(?:'[^']*')+) " + //$NON-NLS-1$
- "order by nspname, proname, p.oid, attnum"); //$NON-NLS-1$
-
+
private static Pattern preparedAutoIncrement = Pattern.compile("select 1 \\s*from pg_catalog.pg_attrdef \\s*where adrelid = \\$1 AND adnum = \\$2 " + //$NON-NLS-1$
"\\s*and pg_catalog.pg_get_expr\\(adbin, adrelid\\) \\s*like '%nextval\\(%'", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
Modified: trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -35,9 +35,10 @@
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
-import java.sql.SQLXML;
import java.sql.Statement;
import java.sql.Types;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Properties;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -51,6 +52,7 @@
import org.teiid.core.util.ObjectConverterUtil;
import org.teiid.core.util.ReaderInputStream;
import org.teiid.core.util.ReflectionHelper;
+import org.teiid.deployers.PgCatalogMetadataStore;
import org.teiid.jdbc.ResultSetImpl;
import org.teiid.jdbc.TeiidSQLException;
import org.teiid.logging.LogConstants;
@@ -67,16 +69,14 @@
public class PgBackendProtocol implements ChannelDownstreamHandler, ODBCClientRemote {
private final class ResultsWorkItem implements Runnable {
- private final int[] types;
+ private final List<PgColInfo> cols;
private final String sql;
- private final int columns;
private final ResultSetImpl rs;
- private ResultsWorkItem(int[] types, String sql, int columns,
+ private ResultsWorkItem(List<PgColInfo> cols, String sql,
ResultSetImpl rs) {
- this.types = types;
+ this.cols = cols;
this.sql = sql;
- this.columns = columns;
this.rs = rs;
}
@@ -115,7 +115,7 @@
boolean processNext = true;
try {
if (future.get()) {
- sendDataRow(rs, columns, types);
+ sendDataRow(rs, cols);
} else {
sendCommandComplete(sql, 0);
processNext = false;
@@ -145,7 +145,12 @@
private static final int PG_TYPE_FLOAT4 = 700;
private static final int PG_TYPE_FLOAT8 = 701;
private static final int PG_TYPE_UNKNOWN = 705;
- //private static final int PG_TYPE_TEXTARRAY = 1009;
+
+ private static final int PG_TYPE_OIDVECTOR = PgCatalogMetadataStore.PG_TYPE_OIDVECTOR;
+ private static final int PG_TYPE_OIDARRAY = PgCatalogMetadataStore.PG_TYPE_OIDARRAY;
+ private static final int PG_TYPE_CHARARRAY = PgCatalogMetadataStore.PG_TYPE_CHARARRAY;
+ private static final int PG_TYPE_TEXTARRAY = PgCatalogMetadataStore.PG_TYPE_TEXTARRAY;
+
private static final int PG_TYPE_DATE = 1082;
private static final int PG_TYPE_TIME = 1083;
private static final int PG_TYPE_TIMESTAMP_NO_TMZONE = 1114;
@@ -313,7 +318,8 @@
public void sendResultSetDescription(ResultSetMetaData metaData, Statement stmt) {
try {
try {
- sendRowDescription(metaData, stmt);
+ List<PgColInfo> cols = getPgColInfo(metaData, stmt);
+ sendRowDescription(cols);
} catch (SQLException e) {
sendErrorResponse(e);
}
@@ -331,16 +337,12 @@
sendErrorResponse(new IllegalStateException("Pending results have not been sent")); //$NON-NLS-1$
}
try {
+ ResultSetMetaData meta = rs.getMetaData();
+ List<PgColInfo> cols = getPgColInfo(meta, rs.getStatement());
if (describeRows) {
- ResultSetMetaData meta = rs.getMetaData();
- sendRowDescription(meta, rs.getStatement());
+ sendRowDescription(cols);
}
- final int columns = rs.getMetaData().getColumnCount();
- final int[] types = new int[columns];
- for(int i = 0; i < columns; i++) {
- types[i] = rs.getMetaData().getColumnType(i+1);
- }
- Runnable r = new ResultsWorkItem(types, sql, columns, rs);
+ Runnable r = new ResultsWorkItem(cols, sql, rs);
r.run();
} catch (SQLException e) {
sendErrorResponse(e);
@@ -429,11 +431,11 @@
sendMessage();
}
- private void sendDataRow(ResultSet rs, int columns, int[] types) throws SQLException, IOException {
+ private void sendDataRow(ResultSet rs, List<PgColInfo> cols) throws SQLException, IOException {
startMessage('D');
- writeShort(columns);
- for (int i = 0; i < columns; i++) {
- byte[] bytes = getContent(rs, types[i], i+1);
+ writeShort(cols.size());
+ for (int i = 0; i < cols.size(); i++) {
+ byte[] bytes = getContent(rs, cols.get(i), i+1);
if (bytes == null) {
writeInt(-1);
} else {
@@ -444,49 +446,35 @@
sendMessage();
}
- private byte[] getContent(ResultSet rs, int type, int column) throws SQLException, TeiidSQLException, IOException {
+ private byte[] getContent(ResultSet rs, PgColInfo col, int column) throws SQLException, TeiidSQLException, IOException {
byte[] bytes = null;
- switch (type) {
- case Types.BIT:
- case Types.BOOLEAN:
- case Types.VARCHAR:
- case Types.CHAR:
- case Types.SMALLINT:
- case Types.INTEGER:
- case Types.BIGINT:
- case Types.NUMERIC:
- case Types.DECIMAL:
- case Types.FLOAT:
- case Types.REAL:
- case Types.DOUBLE:
- case Types.TIME:
- case Types.DATE:
- case Types.TIMESTAMP:
+ switch (col.type) {
+ case PG_TYPE_BOOL:
+ case PG_TYPE_BPCHAR:
+ case PG_TYPE_DATE:
+ case PG_TYPE_FLOAT4:
+ case PG_TYPE_FLOAT8:
+ case PG_TYPE_INT2:
+ case PG_TYPE_INT4:
+ case PG_TYPE_INT8:
+ case PG_TYPE_NUMERIC:
+ case PG_TYPE_TIME:
+ case PG_TYPE_TIMESTAMP_NO_TMZONE:
+ case PG_TYPE_VARCHAR:
String value = rs.getString(column);
if (value != null) {
bytes = value.getBytes(this.encoding);
}
break;
- case Types.LONGVARCHAR:
- case Types.CLOB:
+ case PG_TYPE_TEXT:
Clob clob = rs.getClob(column);
if (clob != null) {
bytes = ObjectConverterUtil.convertToByteArray(new ReaderInputStream(clob.getCharacterStream(), this.encoding), this.maxLobSize);
}
break;
- case Types.SQLXML:
- SQLXML xml = rs.getSQLXML(column);
- if (xml != null) {
- bytes = ObjectConverterUtil.convertToByteArray(new ReaderInputStream(xml.getCharacterStream(), this.encoding), this.maxLobSize);
- }
- break;
-
- case Types.BINARY:
- case Types.VARBINARY:
- case Types.LONGVARBINARY:
- case Types.BLOB:
+ case PG_TYPE_BYTEA:
Blob blob = rs.getBlob(column);
if (blob != null) {
try {
@@ -496,12 +484,75 @@
}
}
break;
+
+ case PG_TYPE_CHARARRAY:
+ case PG_TYPE_TEXTARRAY:
+ case PG_TYPE_OIDARRAY:
+ {
+ Object[] obj = (Object[])rs.getObject(column);
+ if (obj != null) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("{");
+ boolean first = true;
+ for (Object o:obj) {
+ if (!first) {
+ sb.append(",");
+ }
+ else {
+ first = false;
+ }
+ if (col.type == PG_TYPE_TEXTARRAY) {
+ escapeQuote(sb, o.toString());
+ }
+ else {
+ sb.append(o.toString());
+ }
+ }
+ sb.append("}");
+ bytes = sb.toString().getBytes(this.encoding);
+ }
+ }
+ break;
+
+ case PG_TYPE_OIDVECTOR:
+ {
+ Object[] obj = (Object[])rs.getObject(column);
+ if (obj != null) {
+ StringBuilder sb = new StringBuilder();
+ boolean first = true;
+ for (Object o:obj) {
+ if (!first) {
+ sb.append(" ");
+ }
+ else {
+ first = false;
+ }
+ sb.append(o);
+ }
+ bytes = sb.toString().getBytes(this.encoding);
+ }
+ }
+ break;
+
default:
throw new TeiidSQLException("unknown datatype failed to convert");
}
return bytes;
}
+ public static void escapeQuote(StringBuilder sb, String s) {
+ sb.append('"');
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (c == '"' || c == '\\') {
+ sb.append('\\');
+ }
+
+ sb.append(c);
+ }
+ sb.append('"');
+ }
+
@Override
public void sslDenied() {
ChannelBuffer buffer = ChannelBuffers.directBuffer(1);
@@ -529,57 +580,74 @@
startMessage('n');
sendMessage();
}
+
+ private static class PgColInfo {
+ String name;
+ int reloid;
+ short attnum;
+ int type;
+ int precision;
+ }
- private void sendRowDescription(ResultSetMetaData meta, Statement stmt) throws SQLException, IOException {
- if (meta == null) {
- sendNoData();
- } else {
- int columns = meta.getColumnCount();
- startMessage('T');
- writeShort(columns);
- for (int i = 1; i < columns + 1; i++) {
- writeString(meta.getColumnName(i).toLowerCase());
- int type = meta.getColumnType(i);
- type = convertType(type);
- int precision = meta.getColumnDisplaySize(i);
- String name = meta.getColumnName(i);
- String table = meta.getTableName(i);
- String schema = meta.getSchemaName(i);
- int reloid = 0;
- short attnum = 0;
- if (schema != null) {
- PreparedStatement ps = null;
- try {
- ps = stmt.getConnection().prepareStatement("select attrelid, attnum from matpg_relatt where attname = ? and relname = ? and nspname = ?");
- ps.setString(1, name);
- ps.setString(2, table);
- ps.setString(3, schema);
- ResultSet rs = ps.executeQuery();
- if (rs.next()) {
- reloid = rs.getInt(1);
- attnum = rs.getShort(2);
+ private void sendRowDescription(List<PgColInfo> cols) throws IOException {
+ startMessage('T');
+ writeShort(cols.size());
+ for (PgColInfo info : cols) {
+ writeString(info.name);
+ // rel ID
+ writeInt(info.reloid);
+ // attribute number of the column
+ writeShort(info.attnum);
+ // data type
+ writeInt(info.type);
+ // pg_type.typlen
+ writeShort(getTypeSize(info.type, info.precision));
+ // pg_attribute.atttypmod
+ writeInt(-1);
+ // text
+ writeShort(0);
+ }
+ sendMessage();
+ }
+
+ private List<PgColInfo> getPgColInfo(ResultSetMetaData meta, Statement stmt)
+ throws SQLException {
+ int columns = meta.getColumnCount();
+ ArrayList<PgColInfo> result = new ArrayList<PgColInfo>(columns);
+ for (int i = 1; i < columns + 1; i++) {
+ PgColInfo info = new PgColInfo();
+ info.name = meta.getColumnName(i).toLowerCase();
+ info.type = meta.getColumnType(i);
+ info.type = convertType(info.type);
+ info.precision = meta.getColumnDisplaySize(i);
+ String name = meta.getColumnName(i);
+ String table = meta.getTableName(i);
+ String schema = meta.getSchemaName(i);
+ if (schema != null) {
+ PreparedStatement ps = null;
+ try {
+ ps = stmt.getConnection().prepareStatement("select attrelid, attnum, typoid from matpg_relatt where attname = ? and relname = ? and nspname = ?");
+ ps.setString(1, name);
+ ps.setString(2, table);
+ ps.setString(3, schema);
+ ResultSet rs = ps.executeQuery();
+ if (rs.next()) {
+ info.reloid = rs.getInt(1);
+ info.attnum = rs.getShort(2);
+ int specificType = rs.getInt(3);
+ if (!rs.wasNull()) {
+ info.type = specificType;
}
- } finally {
- if (ps != null) {
- ps.close();
- }
}
+ } finally {
+ if (ps != null) {
+ ps.close();
+ }
}
- // rel ID
- writeInt(reloid);
- // attribute number of the column
- writeShort(attnum);
- // data type
- writeInt(type);
- // pg_type.typlen
- writeShort(getTypeSize(type, precision));
- // pg_attribute.atttypmod
- writeInt(-1);
- // text
- writeShort(0);
}
- sendMessage();
+ result.add(info);
}
+ return result;
}
private int getTypeSize(int pgType, int precision) {
Added: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCProceduresSchema.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCProceduresSchema.java (rev 0)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCProceduresSchema.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -0,0 +1,123 @@
+/*
+ * 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.systemmodel;
+
+import static org.junit.Assert.*;
+
+
+import org.junit.Before;
+import org.junit.Test;
+import org.teiid.core.util.UnitTestUtil;
+import org.teiid.jdbc.AbstractMMQueryTestCase;
+import org.teiid.jdbc.FakeServer;
+
+@SuppressWarnings("nls")
+public class TestODBCProceduresSchema extends AbstractMMQueryTestCase {
+ private static final String VDB = "bqt"; //$NON-NLS-1$
+
+ public TestODBCProceduresSchema() {
+ // this is needed because the result files are generated
+ // with another tool which uses tab as delimiter
+ super.DELIMITER = "\t"; //$NON-NLS-1$
+ }
+
+ @Before public void setUp() throws Exception {
+ FakeServer server = new FakeServer();
+ server.deployVDB(VDB, UnitTestUtil.getTestDataPath() + "/bqt.vdb");
+ this.internalConnection = server.createConnection("jdbc:teiid:" + VDB); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void test_Pg_Proc_alltypes() throws Exception {
+ execute("select oid, proname, proretset,prorettype, pronargs, proargtypes, proargnames, proargmodes, proallargtypes, pronamespace FROM pg_proc where proname='bigProcedure'"); //$NON-NLS-1$
+ if (this.internalResultSet.next()) {
+ assertEquals(1, this.internalResultSet.getInt(1)); //oid
+ assertEquals("bigProcedure", this.internalResultSet.getString(2)); //proname
+ assertEquals(true, this.internalResultSet.getBoolean(3)); //proretset
+ assertEquals(2249, this.internalResultSet.getInt(4)); //prorettype
+ assertEquals(14, this.internalResultSet.getInt(5)); //pronargs
+ assertArrayEquals(new Object[] {1700,1043,700,20,701,21,1082,1083,1114,16,1043,21,1700,1700}, (Object[])this.internalResultSet.getObject(6)); //proargtypes
+ assertArrayEquals(new Object[] {"intNum","stringNum","floatNum","longNum","doubleNum","byteNum","dateValue","timeValue","timestampValue","booValue","charValue","shortNum","bigIntNum","bigdecimalNum","col","col2"}, (Object[])this.internalResultSet.getObject(7)); //proargnames
+ assertArrayEquals(new Object[] {"i","i","i","i","i","i","i","i","i","i","i","i","i","i","t","t"}, (Object[])this.internalResultSet.getObject(8)); //proargmodes
+ assertArrayEquals(new Object[] {1700,1043,700,20,701,21,1082,1083,1114,16,1043,21,1700,1700,1043,1700}, (Object[])this.internalResultSet.getObject(9)); //proallargtypes
+ assertEquals(1, this.internalResultSet.getInt(10)); //pronamespace
+ }
+ else {
+ fail("no results");
+ }
+ }
+
+ @Test public void test_Pg_Proc_void() throws Exception {
+ execute("select oid, proname, proretset,prorettype, pronargs, proargtypes, proargnames, proargmodes, proallargtypes, pronamespace FROM pg_proc where proname='VoidProcedure'"); //$NON-NLS-1$
+ if (this.internalResultSet.next()) {
+ assertEquals(4, this.internalResultSet.getInt(1)); //oid
+ assertEquals("VoidProcedure", this.internalResultSet.getString(2)); //proname
+ assertEquals(false, this.internalResultSet.getBoolean(3)); //proretset
+ assertEquals(2278, this.internalResultSet.getInt(4)); //prorettype
+ assertEquals(2, this.internalResultSet.getInt(5)); //pronargs
+ assertArrayEquals(new Object[] {1700,1043}, (Object[])this.internalResultSet.getObject(6)); //proargtypes
+ assertArrayEquals(new Object[] {"intNum","stringNum"}, (Object[])this.internalResultSet.getObject(7)); //proargnames
+ assertArrayEquals(null, (Object[])this.internalResultSet.getObject(8)); //proargmodes
+ assertArrayEquals(new Object[] {1700,1043}, (Object[])this.internalResultSet.getObject(9)); //proallargtypes
+ assertEquals(1, this.internalResultSet.getInt(10)); //pronamespace
+ }
+ else {
+ fail("no results");
+ }
+ }
+
+ @Test public void test_Pg_Proc_with_return() throws Exception {
+ execute("select oid, proname, proretset,prorettype, pronargs, proargtypes, proargnames, proargmodes, proallargtypes, pronamespace FROM pg_proc where proname='ProcedureWithReturn'"); //$NON-NLS-1$
+ if (this.internalResultSet.next()) {
+ assertEquals(3, this.internalResultSet.getInt(1)); //oid
+ assertEquals("ProcedureWithReturn", this.internalResultSet.getString(2)); //proname
+ assertEquals(false, this.internalResultSet.getBoolean(3)); //proretset
+ assertEquals(20, this.internalResultSet.getInt(4)); //prorettype
+ assertEquals(3, this.internalResultSet.getInt(5)); //pronargs
+ assertArrayEquals(new Object[] {1700,1043,700}, (Object[])this.internalResultSet.getObject(6)); //proargtypes
+ assertArrayEquals(new Object[] {"intNum","stringNum","floatNum"}, (Object[])this.internalResultSet.getObject(7)); //proargnames
+ assertArrayEquals(null, (Object[])this.internalResultSet.getObject(8)); //proargmodes
+ assertArrayEquals(new Object[] {1700,1043,700}, (Object[])this.internalResultSet.getObject(9)); //proallargtypes
+ assertEquals(1, this.internalResultSet.getInt(10)); //pronamespace
+ }
+ else {
+ fail("no results");
+ }
+ }
+ @Test public void test_Pg_Proc_with_return_table() throws Exception {
+ execute("select oid, proname, proretset,prorettype, pronargs, proargtypes, proargnames, proargmodes, proallargtypes, pronamespace FROM pg_proc where proname='ProcedureReturnTable'"); //$NON-NLS-1$
+ if (this.internalResultSet.next()) {
+ assertEquals(2, this.internalResultSet.getInt(1)); //oid
+ assertEquals("ProcedureReturnTable", this.internalResultSet.getString(2)); //proname
+ assertEquals(true, this.internalResultSet.getBoolean(3)); //proretset
+ assertEquals(2249, this.internalResultSet.getInt(4)); //prorettype
+ assertEquals(2, this.internalResultSet.getInt(5)); //pronargs
+ assertArrayEquals(new Object[] {1700,1700}, (Object[])this.internalResultSet.getObject(6)); //proargtypes
+ assertArrayEquals(new Object[] {"intNum","bigDecimalNum","col1","col2"}, (Object[])this.internalResultSet.getObject(7)); //proargnames
+ assertArrayEquals(new Object[] {"i","i","t","t"}, (Object[])this.internalResultSet.getObject(8)); //proargmodes
+ assertArrayEquals(new Object[] {1700,1700,1043,1114}, (Object[])this.internalResultSet.getObject(9)); //proallargtypes
+ assertEquals(1, this.internalResultSet.getInt(10)); //pronamespace
+ }
+ else {
+ fail("no results");
+ }
+ }
+}
Property changes on: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCProceduresSchema.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestODBCSchema.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -55,11 +55,6 @@
TestMMDatabaseMetaData.compareResultSet(this.internalResultSet);
}
- @Test public void test_PG_PROC() throws Exception {
- execute("select * FROM pg_proc"); //$NON-NLS-1$
- TestMMDatabaseMetaData.compareResultSet(this.internalResultSet);
- }
-
@Test public void test_PG_TRIGGER() throws Exception {
execute("select * FROM pg_trigger"); //$NON-NLS-1$
TestMMDatabaseMetaData.compareResultSet(this.internalResultSet);
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -84,7 +84,13 @@
}
@Test public void testProperties() {
- String[] expected = { "Name[string] Value[string] UID[string] OID[integer]", }; //$NON-NLS-1$
+ String[] expected = { "Name[string] Value[string] UID[string] OID[integer]",
+ "pg_type:oid 30 mmuid:ffa4ac73-b549-470e-931f-dc36330cb8c4 1",
+ "pg_type:oid 1009 mmuid:d9f36bdc-7b25-4af0-b9f5-a96aac6d3094 2",
+ "pg_type:oid 1002 mmuid:bcbed548-176c-4116-a5d6-7638cb0206e1 3",
+ "pg_type:oid 1028 mmuid:a385751f-a31a-4d5d-9197-3fbd390b0251 4"
+
+ }; //$NON-NLS-1$
executeAndAssertResults("select* from SYS.Properties", expected); //$NON-NLS-1$
}
@@ -133,6 +139,10 @@
"PK_SUPPLIER_PARTS null", //$NON-NLS-1$
"idx_matpg_relatt_ids null",
"idx_matpg_relatt_ids null",
+ "matpg_datatype_ids null",
+ "matpg_datatype_ids null",
+ "matpg_datatype_names null",
+ "matpg_datatype_names null",
"pk_matpg_relatt_names null",
"pk_matpg_relatt_names null",
"pk_matpg_relatt_names null",
Modified: trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -89,7 +89,11 @@
String[] expected ={
"Name[string] Value[string] UID[string]", //$NON-NLS-1$
"NugentXAttribute Nuuuuuge22222 mmuuid:4789b280-841c-1f15-9526-ebd0cace03e1", //$NON-NLS-1$
- "NugentYAttribute Nuuuuuge44444 mmuuid:4789b280-841c-1f15-9526-ebd0cace03e1" //$NON-NLS-1$
+ "NugentYAttribute Nuuuuuge44444 mmuuid:4789b280-841c-1f15-9526-ebd0cace03e1",
+ "pg_type:oid 30 mmuid:ffa4ac73-b549-470e-931f-dc36330cb8c4" ,
+ "pg_type:oid 1009 mmuid:d9f36bdc-7b25-4af0-b9f5-a96aac6d3094" ,
+ "pg_type:oid 1002 mmuid:bcbed548-176c-4116-a5d6-7638cb0206e1",
+ "pg_type:oid 1028 mmuid:a385751f-a31a-4d5d-9197-3fbd390b0251"
};
executeAndAssertResults(sql, expected);
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/java/org/teiid/transport/TestODBCSocketTransport.java 2011-04-12 23:20:51 UTC (rev 3084)
@@ -139,4 +139,17 @@
assertTrue(rs.next());
assertEquals("\n\thello pg", rs.getString(1));
}
+
+ @Test public void testPgProc() throws Exception {
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery("select * from pg_proc");
+ rs.next();
+ assertEquals("oid", rs.getArray("proargtypes").getBaseTypeName());
+ }
+
+ @Test public void testPgProcedure() throws Exception {
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery("select has_function_privilege(100, 'foo')");
+ rs.next();
+ }
}
Modified: trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestCase3473/testGetTables.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -13,6 +13,7 @@
test SYS VirtualDatabases SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
test SYSADMIN MatViews SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
test SYSADMIN VDBResources SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
+test pg_catalog matpg_datatype SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog matpg_relatt SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_am SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
test pg_catalog pg_attrdef SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
@@ -28,7 +29,7 @@
test test all_databases TABLE <null> <null> <null> <null> <null> <null> false
test test all_models TABLE <null> <null> <null> <null> <null> <null> false
test test all_tables TABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 28
+Row Count : 29
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 test java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 test java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetColumns.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -757,12 +757,18 @@
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor ID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 1 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor code 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 2 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQTRecursiveDoc groupDocument.MappingClasses.supervisor groupID 2 biginteger 19 <null> 0 0 1 <null> <null> <null> <null> 0 3 YES <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_datatype oid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_datatype typname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_datatype name 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_datatype uid 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_datatype typlen 5 short 5 <null> 0 0 2 <null> <null> <null> <null> 0 5 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt attrelid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt attnum 5 short 5 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt attname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt relname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt nspname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 5 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog matpg_relatt autoinc -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 6 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog matpg_relatt typoid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 7 <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3.key3.data3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3.key3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQTDoc mixedContentTestDocument mixedContentTest.wrapper3 12 string 4000 <null> 0 0 1 <null> <null> <null> <null> 0 0 YES <null> <null> <null> !
<null> NO
@@ -851,6 +857,7 @@
QT_Ora9DS pg_catalog pg_type typbasetype 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 6 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog pg_type typtypmod 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 7 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog pg_type typrelid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 8 <null> <null> <null> !
<null> NO
+QT_Ora9DS pg_catalog pg_type typelem 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 9 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog pg_user oid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog pg_user usename 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
QT_Ora9DS pg_catalog pg_user usecreatedb -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
@@ -1074,7 +1081,7 @@
QT_Ora9DS XQT xqtFullData BigIntegerValue 2 biginteger 19 <null> 0 10 1 <null> <null> <null> <null> 28 15 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQT xqtFullData BigDecimalValue 2 bigdecimal 20 <null> 0 10 1 <null> <null> <null> <null> 126 16 YES <null> <null> <null> !
<null> NO
QT_Ora9DS XQT xqtFullData ObjectValue 2000 object 2048 <null> 0 10 1 <null> <null> <null> <null> 2048 17 YES <null> <null> <null> !
<null> NO
-Row Count : 1074
+Row Count : 1081
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Columns 255 255 0 false false false false 0 true true false false
SchemaName 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -31,6 +31,7 @@
QT_Ora9DS SYS VirtualDatabases SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS SYSADMIN MatViews SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS SYSADMIN VDBResources SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS pg_catalog matpg_datatype SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog matpg_relatt SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog pg_am SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog pg_attrdef SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
@@ -135,7 +136,7 @@
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.moveToRootTempTable XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 135
+Row Count : 136
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetTables_allTables.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -31,6 +31,7 @@
QT_Ora9DS SYS VirtualDatabases SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS SYSADMIN MatViews SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
QT_Ora9DS SYSADMIN VDBResources SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
+QT_Ora9DS pg_catalog matpg_datatype SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog matpg_relatt SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog pg_am SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS pg_catalog pg_attrdef SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
@@ -135,7 +136,7 @@
QT_Ora9DS XQTNestedDoc testOptimizableTempTable.MappingClasses.moveToRootTempTable XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTNestedDoc testRootTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
QT_Ora9DS XQTRecursiveDoc testSimpleTempTable.MappingClasses.TemporaryTable1 XMLSTAGINGTABLE <null> <null> <null> <null> <null> <null> false
-Row Count : 135
+Row Count : 136
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 QT_Ora9DS java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -190,59 +190,66 @@
188 22 typbasetype 23 4 6 0 false false false
189 22 typtypmod 23 4 7 0 false false false
190 22 typrelid 23 4 8 0 false false false
-191 23 oid 23 4 1 0 false false false
-192 23 indexrelid 23 4 2 0 false false false
-193 23 indrelid 23 4 3 0 false false false
-194 23 indisclustered 16 1 4 0 false false false
-195 23 indisunique 16 1 5 0 false false false
-196 23 indisprimary 16 1 6 0 false false false
-197 23 indexprs 1043 -1 7 0 false false false
-198 23 indkey 1043 -1 8 0 false false false
-199 24 oid 23 4 1 0 false false false
-200 24 amname 1043 -1 2 0 false false false
-201 25 oid 23 4 1 0 false false false
-202 25 proname 1043 -1 2 0 false false false
-203 25 proretset 16 1 3 0 false false false
-204 25 prorettype 23 4 4 0 false false false
-205 25 pronargs 21 2 5 0 false false false
-206 25 proargtypes <null> <null> 6 0 false false false
-207 25 proargnames <null> <null> 7 0 false false false
-208 25 proargmodes <null> <null> 8 0 false false false
-209 25 proallargtypes <null> <null> 9 0 false false false
-210 25 pronamespace 23 4 10 0 false false false
-211 26 oid 23 4 1 0 false false false
-212 26 tgconstrrelid 23 4 2 0 false false false
-213 26 tgfoid 23 4 3 0 false false false
-214 26 tgargs 23 4 4 0 false false false
-215 26 tgnargs 23 4 5 0 false false false
-216 26 tgdeferrable 16 1 6 0 false false false
-217 26 tginitdeferred 16 1 7 0 false false false
-218 26 tgconstrname 1043 -1 8 0 false false false
-219 26 tgrelid 23 4 9 0 false false false
-220 27 adrelid 23 4 1 0 false false false
-221 27 adnum 23 4 2 0 false false false
-222 27 adbin 1043 -1 3 0 false false false
-223 27 adsrc 1043 -1 4 0 false false false
-224 28 oid 23 4 1 0 false false false
-225 28 datname 1043 -1 2 0 false false false
-226 28 encoding 23 4 3 0 false false false
-227 28 datlastsysoid 23 4 4 0 false false false
-228 28 datallowconn 1042 1 5 0 false false false
-229 28 datconfig <null> <null> 6 0 false false false
-230 28 datacl <null> <null> 7 0 false false false
-231 28 datdba 23 4 8 0 false false false
-232 28 dattablespace 23 4 9 0 false false false
-233 29 oid 23 4 1 0 false false false
-234 29 usename 1043 -1 2 0 false false false
-235 29 usecreatedb 16 1 3 0 false false false
-236 29 usesuper 16 1 4 0 false false false
-237 30 attrelid 23 4 1 0 false false false
-238 30 attnum 21 2 2 0 false false false
-239 30 attname 1043 -1 3 0 false false false
-240 30 relname 1043 -1 4 0 false false false
-241 30 nspname 1043 -1 5 0 false false false
-242 30 autoinc 16 1 6 0 false false false
-Row Count : 242
+191 22 typelem 23 4 9 0 false false false
+192 23 oid 23 4 1 0 false false false
+193 23 indexrelid 23 4 2 0 false false false
+194 23 indrelid 23 4 3 0 false false false
+195 23 indisclustered 16 1 4 0 false false false
+196 23 indisunique 16 1 5 0 false false false
+197 23 indisprimary 16 1 6 0 false false false
+198 23 indexprs 1043 -1 7 0 false false false
+199 23 indkey 1043 -1 8 0 false false false
+200 24 oid 23 4 1 0 false false false
+201 24 amname 1043 -1 2 0 false false false
+202 25 oid 23 4 1 0 false false false
+203 25 proname 1043 -1 2 0 false false false
+204 25 proretset 16 1 3 0 false false false
+205 25 prorettype 23 4 4 0 false false false
+206 25 pronargs 21 2 5 0 false false false
+207 25 proargtypes <null> <null> 6 0 false false false
+208 25 proargnames <null> <null> 7 0 false false false
+209 25 proargmodes <null> <null> 8 0 false false false
+210 25 proallargtypes <null> <null> 9 0 false false false
+211 25 pronamespace 23 4 10 0 false false false
+212 26 oid 23 4 1 0 false false false
+213 26 tgconstrrelid 23 4 2 0 false false false
+214 26 tgfoid 23 4 3 0 false false false
+215 26 tgargs 23 4 4 0 false false false
+216 26 tgnargs 23 4 5 0 false false false
+217 26 tgdeferrable 16 1 6 0 false false false
+218 26 tginitdeferred 16 1 7 0 false false false
+219 26 tgconstrname 1043 -1 8 0 false false false
+220 26 tgrelid 23 4 9 0 false false false
+221 27 adrelid 23 4 1 0 false false false
+222 27 adnum 23 4 2 0 false false false
+223 27 adbin 1043 -1 3 0 false false false
+224 27 adsrc 1043 -1 4 0 false false false
+225 28 oid 23 4 1 0 false false false
+226 28 datname 1043 -1 2 0 false false false
+227 28 encoding 23 4 3 0 false false false
+228 28 datlastsysoid 23 4 4 0 false false false
+229 28 datallowconn 1042 1 5 0 false false false
+230 28 datconfig <null> <null> 6 0 false false false
+231 28 datacl <null> <null> 7 0 false false false
+232 28 datdba 23 4 8 0 false false false
+233 28 dattablespace 23 4 9 0 false false false
+234 29 oid 23 4 1 0 false false false
+235 29 usename 1043 -1 2 0 false false false
+236 29 usecreatedb 16 1 3 0 false false false
+237 29 usesuper 16 1 4 0 false false false
+238 30 attrelid 23 4 1 0 false false false
+239 30 attnum 21 2 2 0 false false false
+240 30 attname 1043 -1 3 0 false false false
+241 30 relname 1043 -1 4 0 false false false
+242 30 nspname 1043 -1 5 0 false false false
+243 30 autoinc 16 1 6 0 false false false
+244 30 typoid 23 4 7 0 false false false
+245 31 oid 23 4 1 0 false false false
+246 31 typname 1043 -1 2 0 false false false
+247 31 name 1043 -1 3 0 false false false
+248 31 uid 1043 -1 4 0 false false false
+249 31 typlen 21 2 5 0 false false false
+Row Count : 249
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_attribute 11 10 0 false false false false 2 true true false false
attrelid 4 PartsSupplier java.lang.Integer attrelid integer pg_catalog pg_attribute 11 10 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_CLASS.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -30,7 +30,8 @@
28 pg_database 4 v 0 0.0 0 false false
29 pg_user 4 v 0 0.0 0 false false
30 matpg_relatt 4 v 0 0.0 0 false false
-Row Count : 30
+31 matpg_datatype 4 v 0 0.0 0 false false
+Row Count : 31
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_class 11 10 0 false false false false 2 true true false false
relname 12 PartsSupplier java.lang.String relname string pg_catalog pg_class 4000 4000 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_INDEX.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_INDEX.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_INDEX.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -18,7 +18,11 @@
16 16 30 false false true 0
17 17 30 false false false 0
18 18 30 false false false 0
-Row Count : 18
+19 19 31 false false true 0
+20 20 31 false false true 0
+21 21 31 false false false 0
+22 22 31 false false false 0
+Row Count : 22
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_index 11 10 0 false false false false 2 true true false false
indexrelid 4 PartsSupplier java.lang.Integer indexrelid integer pg_catalog pg_index 11 10 0 false false false false 2 true true false false
Deleted: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_PROC.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_PROC.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_PROC.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -1,17 +0,0 @@
-integer string boolean integer short object object object object integer
-oid proname proretset prorettype pronargs proargtypes proargnames proargmodes proallargtypes pronamespace
-1 refreshMatViewRow false <null> 3 <null> <null> <null> <null> 2
-2 refreshMatView false <null> 3 <null> <null> <null> <null> 2
-3 getXMLSchemas false <null> 2 <null> <null> <null> <null> 3
-Row Count : 3
-getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
-oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_proc 11 10 0 false false false false 2 true true false false
-proname 12 PartsSupplier java.lang.String proname string pg_catalog pg_proc 4000 4000 0 false false false false 2 true true false false
-proretset -7 PartsSupplier java.lang.Boolean proretset boolean pg_catalog pg_proc 5 1 0 false false false false 2 true true false false
-prorettype 4 PartsSupplier java.lang.Integer prorettype integer pg_catalog pg_proc 11 10 0 false false false false 2 true true false false
-pronargs 5 PartsSupplier java.lang.Short pronargs short pg_catalog pg_proc 6 5 0 false false false false 2 true true false false
-proargtypes 2000 PartsSupplier java.lang.Object proargtypes object pg_catalog pg_proc 2147483647 2147483647 0 false false false false 2 true true false false
-proargnames 2000 PartsSupplier java.lang.Object proargnames object pg_catalog pg_proc 2147483647 2147483647 0 false false false false 2 true true false false
-proargmodes 2000 PartsSupplier java.lang.Object proargmodes object pg_catalog pg_proc 2147483647 2147483647 0 false false false false 2 true true false false
-proallargtypes 2000 PartsSupplier java.lang.Object proallargtypes object pg_catalog pg_proc 2147483647 2147483647 0 false false false false 2 true true false false
-pronamespace 4 PartsSupplier java.lang.Integer pronamespace integer pg_catalog pg_proc 11 10 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -1,22 +1,40 @@
-integer string integer short char integer integer integer
-oid typname typnamespace typlen typtype typbasetype typtypmod typrelid
-16 boolean 3 1 b 0 -1 0
-20 long 3 8 b 0 -1 0
-21 short 3 2 b 0 -1 0
-23 integer 3 4 b 0 -1 0
-25 text 3 -1 b 0 -1 0
-26 oid 3 4 b 0 -1 0
-142 xml 3 -1 b 0 -1 0
-700 float 3 4 b 0 -1 0
-701 double 3 8 b 0 -1 0
-1042 char 3 1 b 0 -1 0
-1043 string 3 -1 b 0 -1 0
-1082 date 3 4 b 0 -1 0
-1083 datetime 3 8 b 0 -1 0
-1114 timestamp 3 8 b 0 -1 0
-1700 decimal 3 -1 b 0 -1 0
-14939 lo 3 -1 b 0 -1 0
-Row Count : 16
+integer string integer short char integer integer integer integer
+oid typname typnamespace typlen typtype typbasetype typtypmod typrelid typelem
+16 boolean 3 1 b 0 -1 0 0
+20 long 3 8 b 0 -1 0 0
+21 short 3 2 b 0 -1 0 0
+23 integer 3 4 b 0 -1 0 0
+25 text 3 -1 b 0 -1 0 0
+26 oid 3 4 b 0 -1 0 0
+30 oidvector 3 -1 b 0 -1 0 26
+142 xml 3 -1 b 0 -1 0 0
+700 float 3 4 b 0 -1 0 0
+701 double 3 8 b 0 -1 0 0
+1000 _bool 3 -1 b 0 -1 0 16
+1002 _char 3 -1 b 0 -1 0 18
+1005 _int2 3 -1 b 0 -1 0 21
+1007 _int4 3 -1 b 0 -1 0 23
+1009 _text 3 -1 b 0 -1 0 25
+1014 _bpchar 3 -1 b 0 -1 0 1042
+1015 _varchar 3 -1 b 0 -1 0 1043
+1016 _int8 3 -1 b 0 -1 0 20
+1021 _float4 3 -1 b 0 -1 0 700
+1022 _float8 3 -1 b 0 -1 0 701
+1028 _oid 3 -1 b 0 -1 0 26
+1042 char 3 1 b 0 -1 0 0
+1043 string 3 -1 b 0 -1 0 0
+1082 date 3 4 b 0 -1 0 0
+1083 datetime 3 8 b 0 -1 0 0
+1114 timestamp 3 8 b 0 -1 0 0
+1115 _timestamp 3 -1 b 0 -1 0 1114
+1182 _date 3 -1 b 0 -1 0 1082
+1183 _time 3 -1 b 0 -1 0 1083
+1700 decimal 3 -1 b 0 -1 0 0
+2249 record 3 -1 p 0 -1 0 0
+2278 void 3 4 p 0 -1 0 0
+2287 _record 3 -1 b 0 -1 0 2249
+14939 lo 3 -1 b 0 -1 0 0
+Row Count : 34
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_type 11 10 0 false false false false 2 true true false false
typname 12 PartsSupplier java.lang.String typname string pg_catalog pg_type 4000 4000 0 false false false false 2 true true false false
@@ -26,3 +44,4 @@
typbasetype 4 PartsSupplier java.lang.Integer typbasetype integer pg_catalog pg_type 11 10 0 false false false false 2 true true false false
typtypmod 4 PartsSupplier java.lang.Integer typtypmod integer pg_catalog pg_type 11 10 0 false false false false 2 true true false false
typrelid 4 PartsSupplier java.lang.Integer typrelid integer pg_catalog pg_type 11 10 0 false false false false 2 true true false false
+typelem 4 PartsSupplier java.lang.Integer typelem integer pg_catalog pg_type 11 10 0 false false false false 2 true true false false
Modified: trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestODBCSocketTransport/testSelect.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -18,19 +18,20 @@
parts SYS Tables Table <null> true false mmuuid:8551b3bd-11cc-4049-9bcf-fe91a0eb7ba7 0 <null> true false 17
parts SYSADMIN VDBResources Table <null> true false mmuuid:1785804d-beaf-4831-9531-e59164fedd49 0 <null> true false 7
parts SYS VirtualDatabases Table <null> true false mmuuid:47297c72-d621-4f4e-af4e-74060ac5f489 0 <null> true false 18
-parts pg_catalog matpg_relatt Table <null> false false mmuid:9bfddc66-af75-4366-8eac-b9fef3421219 0 <null> true true 30
-parts pg_catalog pg_am Table <null> false false mmuid:1462b28e-0bab-436f-9654-013821506337 0 <null> true false 24
-parts pg_catalog pg_attrdef Table <null> false false mmuid:71091853-c65e-46a9-9947-aa024f806e2d 0 <null> true false 27
+parts pg_catalog matpg_datatype Table <null> false false mmuid:17448311-6679-4dfd-aeb6-4aabbd894729 0 <null> true true 31
+parts pg_catalog matpg_relatt Table <null> false false mmuid:8c0714d6-1c72-40b4-8528-3b2c63059107 0 <null> true true 30
+parts pg_catalog pg_am Table <null> false false mmuid:f6517a63-8c14-4b73-a18d-afaa5dfb35d9 0 <null> true false 24
+parts pg_catalog pg_attrdef Table <null> false false mmuid:76a7dd05-9a7d-4243-b561-f3056500dcaf 0 <null> true false 27
parts pg_catalog pg_attribute Table <null> false false mmuid:fa463d98-365f-489a-a707-025193cb51eb 0 <null> true true 21
parts pg_catalog pg_class Table <null> false false mmuid:7e21f2e6-06e3-4bca-9b01-72ea47821560 0 <null> true true 20
-parts pg_catalog pg_database Table <null> false false mmuid:492dd834-907f-429b-aa6e-958ad65204c6 0 <null> true false 28
-parts pg_catalog pg_index Table <null> false false mmuid:22ac431d-e6e6-4eef-9d74-b31795424e97 0 <null> true true 23
+parts pg_catalog pg_database Table <null> false false mmuid:382f9fc9-8c96-4df7-ab5d-04dfb47ee142 0 <null> true false 28
+parts pg_catalog pg_index Table <null> false false mmuid:09daed8d-b0b8-4552-a261-2b6c775b46b0 0 <null> true true 23
parts pg_catalog pg_namespace Table <null> false false mmuid:6609866a-3d7b-4f4b-95fe-ebfac769d699 0 <null> true false 19
-parts pg_catalog pg_proc Table <null> false false mmuid:da4b747e-7d87-403a-8309-2cdf1399031b 0 <null> true true 25
-parts pg_catalog pg_trigger Table <null> false false mmuid:9569efdb-21b2-4b4f-a2db-e7406267b8ed 0 <null> true false 26
+parts pg_catalog pg_proc Table <null> false false mmuid:f20c9489-10ca-4596-8a37-24218b67f764 0 <null> true true 25
+parts pg_catalog pg_trigger Table <null> false false mmuid:2b75f0b1-7475-4ed5-9da3-d37a8a25f26a 0 <null> true false 26
parts pg_catalog pg_type Table <null> false false mmuid:9462e3f8-cd3c-414f-a570-f6f33c40e36a 0 <null> true false 22
-parts pg_catalog pg_user Table <null> false false mmuid:28d034eb-6f39-402f-b642-9c9560e57247 0 <null> true false 29
-Row Count : 30
+parts pg_catalog pg_user Table <null> false false mmuid:e63613cb-01ee-4b37-8b91-99d1aac4dfcb 0 <null> true false 29
+Row Count : 31
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
vdbname 12 java.lang.String vdbname varchar 2147483647 0 0 false true false false 1 false true false true
schemaname 12 java.lang.String schemaname varchar 2147483647 0 0 false true false false 1 false true false true
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testColumns.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -161,12 +161,18 @@
PartsSupplier SYSADMIN VDBResources contents 2004 blob 2147483647 <null> 0 10 1 <null> <null> <null> <null> 0 2 YES <null> <null> <null> !
<null> NO
PartsSupplier SYS VirtualDatabases Name 12 string 255 <null> 0 10 0 <null> <null> <null> <null> 255 1 NO <null> <null> <null> !
<null> NO
PartsSupplier SYS VirtualDatabases Version 12 string 50 <null> 0 10 0 <null> <null> <null> <null> 50 2 NO <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_datatype oid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_datatype typname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_datatype name 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_datatype uid 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_datatype typlen 5 short 5 <null> 0 0 2 <null> <null> <null> <null> 0 5 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt attrelid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt attnum 5 short 5 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt attname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt relname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt nspname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 5 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog matpg_relatt autoinc -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 6 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog matpg_relatt typoid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 7 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_am oid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_am amname 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_attrdef adrelid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
@@ -238,11 +244,12 @@
PartsSupplier pg_catalog pg_type typbasetype 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 6 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_type typtypmod 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 7 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_type typrelid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 8 <null> <null> <null> !
<null> NO
+PartsSupplier pg_catalog pg_type typelem 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 9 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user oid 4 integer 10 <null> 0 0 2 <null> <null> <null> <null> 0 1 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user usename 12 string 4000 <null> 0 0 2 <null> <null> <null> <null> 0 2 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user usecreatedb -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 3 <null> <null> <null> !
<null> NO
PartsSupplier pg_catalog pg_user usesuper -7 boolean 1 <null> 0 0 2 <null> <null> <null> <null> 0 4 <null> <null> <null> !
<null> NO
-Row Count : 242
+Row Count : 249
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String TABLE_CAT string SYS Columns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testIndexInfo.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testIndexInfo.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testIndexInfo.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -2,7 +2,9 @@
VDBName SchemaName TableName NON_UNIQUE INDEX_QUALIFIER KeyName TYPE ORDINAL_POSITION Name ASC_OR_DESC CARDINALITY PAGES FILTER_CONDITION
PartsSupplier pg_catalog matpg_relatt true <null> idx_matpg_relatt_ids 0 1 attrelid <null> 0 1 <null>
PartsSupplier pg_catalog matpg_relatt true <null> idx_matpg_relatt_ids 0 2 attnum <null> 0 1 <null>
-Row Count : 2
+PartsSupplier pg_catalog matpg_datatype true <null> matpg_datatype_ids 0 1 typname <null> 0 1 <null>
+PartsSupplier pg_catalog matpg_datatype true <null> matpg_datatype_ids 0 2 oid <null> 0 1 <null>
+Row Count : 4
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String TABLE_CAT string SYS KeyColumns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS KeyColumns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testPrimaryKeys.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testPrimaryKeys.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testPrimaryKeys.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -7,13 +7,15 @@
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS SUPPLIER_ID 1 PK_SUPPLIER_PARTS
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER SUPPLIER_ID 1 PK_SUPPLIER
PartsSupplier pg_catalog matpg_relatt attname 1 pk_matpg_relatt_names
+PartsSupplier pg_catalog matpg_datatype name 2 matpg_datatype_names
PartsSupplier pg_catalog matpg_relatt nspname 3 pk_matpg_relatt_names
PartsSupplier pg_catalog pg_class oid 1 pk_pg_class
PartsSupplier pg_catalog pg_attribute oid 1 pk_pg_attr
PartsSupplier pg_catalog pg_index oid 1 pk_pg_index
PartsSupplier pg_catalog pg_proc oid 1 pk_pg_proc
+PartsSupplier pg_catalog matpg_datatype oid 1 matpg_datatype_names
PartsSupplier pg_catalog matpg_relatt relname 2 pk_matpg_relatt_names
-Row Count : 13
+Row Count : 15
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String TABLE_CAT string SYS KeyColumns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS KeyColumns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testTables.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -13,6 +13,7 @@
PartsSupplier SYS VirtualDatabases SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier SYSADMIN MatViews SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier SYSADMIN VDBResources SYSTEM TABLE <null> <null> <null> <null> <null> <null> true
+PartsSupplier pg_catalog matpg_datatype SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
PartsSupplier pg_catalog matpg_relatt SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
PartsSupplier pg_catalog pg_am SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
PartsSupplier pg_catalog pg_attrdef SYSTEM TABLE <null> <null> <null> <null> <null> <null> false
@@ -30,7 +31,7 @@
PartsSupplier PartsSupplier PARTSSUPPLIER.STATUS TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER TABLE <null> <null> <null> <null> <null> <null> true
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS TABLE <null> <null> <null> <null> <null> <null> true
-Row Count : 30
+Row Count : 31
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String TABLE_CAT string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 PartsSupplier java.lang.String TABLE_SCHEM string SYS Tables 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testColumns.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -159,90 +159,97 @@
PartsSupplier SYSADMIN MatViews Valid 6 <null> boolean 0 0 false true false true true false false Nullable <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 10 mmuuid:13098912-bce2-4842-9ea9-b162fcd7383e !
<null> 23
PartsSupplier SYS Properties Value 2 <null> string 0 255 true true false true true false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 255 255 10 mmuuid:c917257d-06b7-41dd-a6cb-44c0ff0f897e !
<null> 123
PartsSupplier SYS VirtualDatabases Version 2 <null> string 0 50 true true false true false false false No Nulls <null> <null> Searchable <null> <null> java.lang.String 50 50 10 mmuuid:c876d749-a512-4810-9910-3034ca524c45 !
<null> 161
-PartsSupplier pg_catalog pg_attrdef adbin 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:e9b278d4-49af-442f-9a5a-b699fe3b102b !
<null> 222
-PartsSupplier pg_catalog pg_attrdef adnum 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:4589389f-4abd-42a6-818f-ff1f2a085dfb !
<null> 221
-PartsSupplier pg_catalog pg_attrdef adrelid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:76a7dd05-9a7d-4243-b561-f3056500dcaf !
<null> 220
-PartsSupplier pg_catalog pg_attrdef adsrc 4 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:e22c521a-e208-4181-9dbd-89f5de7014b9 !
<null> 223
-PartsSupplier pg_catalog pg_am amname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:3c67619c-7d8f-4378-b7e9-84a0451ea5e5 !
<null> 200
+PartsSupplier pg_catalog pg_attrdef adbin 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:e22c521a-e208-4181-9dbd-89f5de7014b9 !
<null> 223
+PartsSupplier pg_catalog pg_attrdef adnum 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:e9b278d4-49af-442f-9a5a-b699fe3b102b !
<null> 222
+PartsSupplier pg_catalog pg_attrdef adrelid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:4589389f-4abd-42a6-818f-ff1f2a085dfb !
<null> 221
+PartsSupplier pg_catalog pg_attrdef adsrc 4 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:492dd834-907f-429b-aa6e-958ad65204c6 !
<null> 224
+PartsSupplier pg_catalog pg_am amname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:da4b747e-7d87-403a-8309-2cdf1399031b !
<null> 201
PartsSupplier pg_catalog pg_attribute atthasdef 10 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:5868e549-4bbe-479e-bc7e-632c05cc2329 !
<null> 182
PartsSupplier pg_catalog pg_attribute attisdropped 9 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:7beb42a9-dfe6-43de-98b6-7e8948b1a666 !
<null> 181
PartsSupplier pg_catalog pg_attribute attlen 5 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:d1214249-95cd-426f-b8f6-4bf68c0504c7 !
<null> 177
PartsSupplier pg_catalog pg_attribute attname 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:6064d149-4102-4c2d-9132-582342f25e90 !
<null> 175
-PartsSupplier pg_catalog matpg_relatt attname 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:0b0894ba-e1ea-4eaf-bcd2-ea9ebd05e47d !
<null> 239
+PartsSupplier pg_catalog matpg_relatt attname 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:5cfb2b62-a912-4bfb-bf4f-51e107fe210c !
<null> 240
PartsSupplier pg_catalog pg_attribute attnotnull 8 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:91ce8bde-8570-4867-be17-80acfa9275a6 !
<null> 180
PartsSupplier pg_catalog pg_attribute attnum 6 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:141fd911-f2dd-4edd-8f08-ad8a67ffd0fb !
<null> 178
-PartsSupplier pg_catalog matpg_relatt attnum 2 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:5c7bf056-ecc5-41ea-a122-7a4b1de9908a !
<null> 238
+PartsSupplier pg_catalog matpg_relatt attnum 2 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:0b0894ba-e1ea-4eaf-bcd2-ea9ebd05e47d !
<null> 239
PartsSupplier pg_catalog pg_attribute attrelid 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:3be6b5de-2287-4279-93f3-4f5064799118 !
<null> 174
-PartsSupplier pg_catalog matpg_relatt attrelid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:8c0714d6-1c72-40b4-8528-3b2c63059107 !
<null> 237
+PartsSupplier pg_catalog matpg_relatt attrelid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:5c7bf056-ecc5-41ea-a122-7a4b1de9908a !
<null> 238
PartsSupplier pg_catalog pg_attribute atttypid 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:99782493-1cce-4e14-9c1b-4de7ce50e2c8 !
<null> 176
PartsSupplier pg_catalog pg_attribute atttypmod 7 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:2e2bae3c-ab93-49f5-b96c-7a7b9d66782d !
<null> 179
-PartsSupplier pg_catalog matpg_relatt autoinc 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:f1998229-2c1a-47b7-8f46-9dda81446db6 !
<null> 242
+PartsSupplier pg_catalog matpg_relatt autoinc 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:23454408-0347-40d2-a3f9-3faa664fb5e9 !
<null> 243
PartsSupplier SYSADMIN VDBResources contents 2 <null> blob 0 0 false true false true true false false Nullable <null> <null> Searchable <null> <null> org.teiid.core.types.BlobType 0 0 10 mmuuid:f9421669-3564-451d-9293-96c1e5e72c4f !
<null> 28
-PartsSupplier pg_catalog pg_database datacl 7 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:4b5beb14-03a0-4652-9d6f-5f8cc74d470c !
<null> 230
-PartsSupplier pg_catalog pg_database datallowconn 5 <null> char 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Character 0 0 0 mmuid:c2bdf40c-ec58-439c-a403-7adf604ceadd !
<null> 228
-PartsSupplier pg_catalog pg_database datconfig 6 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:5c9d54b2-433f-443a-85ce-821f42ed109e !
<null> 229
-PartsSupplier pg_catalog pg_database datdba 8 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:8b993c11-de2b-48bc-beb1-3e44c46811b4 !
<null> 231
-PartsSupplier pg_catalog pg_database datlastsysoid 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:3b621b25-171c-405b-8bf9-635cf93f2273 !
<null> 227
-PartsSupplier pg_catalog pg_database datname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:689cde3b-a631-4f25-94b4-ff2ffe022b0f !
<null> 225
-PartsSupplier pg_catalog pg_database dattablespace 9 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:36db343d-e99a-427c-a4e2-763a720ce4a4 !
<null> 232
-PartsSupplier pg_catalog pg_database encoding 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:1aedd02c-5801-41e7-accd-da1f257c26e8 !
<null> 226
-PartsSupplier pg_catalog pg_index indexprs 7 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:9ea3b6d2-b27b-4bb1-a99d-b703c3308384 !
<null> 197
-PartsSupplier pg_catalog pg_index indexrelid 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:83ae2247-7eec-459f-b037-ffd3cdca0627 !
<null> 192
-PartsSupplier pg_catalog pg_index indisclustered 4 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:16998907-e1dd-447e-898d-780994d30619 !
<null> 194
-PartsSupplier pg_catalog pg_index indisprimary 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:a52c714d-dfe9-406c-906b-fadd53ac4e98 !
<null> 196
-PartsSupplier pg_catalog pg_index indisunique 5 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:9f873e0f-903d-4c9d-8c37-1073b5ec4c67 !
<null> 195
-PartsSupplier pg_catalog pg_index indkey 8 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:1e6dbecd-9a2d-4aef-afbe-665de7acb9d6 !
<null> 198
-PartsSupplier pg_catalog pg_index indrelid 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:8709e084-48df-417d-b3f8-f4e9b7d8802b !
<null> 193
+PartsSupplier pg_catalog pg_database datacl 7 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:8b993c11-de2b-48bc-beb1-3e44c46811b4 !
<null> 231
+PartsSupplier pg_catalog pg_database datallowconn 5 <null> char 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Character 0 0 0 mmuid:5c9d54b2-433f-443a-85ce-821f42ed109e !
<null> 229
+PartsSupplier pg_catalog pg_database datconfig 6 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:4b5beb14-03a0-4652-9d6f-5f8cc74d470c !
<null> 230
+PartsSupplier pg_catalog pg_database datdba 8 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:36db343d-e99a-427c-a4e2-763a720ce4a4 !
<null> 232
+PartsSupplier pg_catalog pg_database datlastsysoid 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:c2bdf40c-ec58-439c-a403-7adf604ceadd !
<null> 228
+PartsSupplier pg_catalog pg_database datname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:1aedd02c-5801-41e7-accd-da1f257c26e8 !
<null> 226
+PartsSupplier pg_catalog pg_database dattablespace 9 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:28d034eb-6f39-402f-b642-9c9560e57247 !
<null> 233
+PartsSupplier pg_catalog pg_database encoding 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:3b621b25-171c-405b-8bf9-635cf93f2273 !
<null> 227
+PartsSupplier pg_catalog pg_index indexprs 7 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:1e6dbecd-9a2d-4aef-afbe-665de7acb9d6 !
<null> 198
+PartsSupplier pg_catalog pg_index indexrelid 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:8709e084-48df-417d-b3f8-f4e9b7d8802b !
<null> 193
+PartsSupplier pg_catalog pg_index indisclustered 4 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:9f873e0f-903d-4c9d-8c37-1073b5ec4c67 !
<null> 195
+PartsSupplier pg_catalog pg_index indisprimary 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:9ea3b6d2-b27b-4bb1-a99d-b703c3308384 !
<null> 197
+PartsSupplier pg_catalog pg_index indisunique 5 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:a52c714d-dfe9-406c-906b-fadd53ac4e98 !
<null> 196
+PartsSupplier pg_catalog pg_index indkey 8 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:347ec08c-6b41-41d0-8475-031ce7d99ac0 !
<null> 199
+PartsSupplier pg_catalog pg_index indrelid 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:16998907-e1dd-447e-898d-780994d30619 !
<null> 194
+PartsSupplier pg_catalog matpg_datatype name 3 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:b4e04928-9a59-4718-a7f1-3a60bcae7449 !
<null> 247
PartsSupplier pg_catalog pg_namespace nspname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:0e513513-b35a-48be-975d-5dbed6ace7e9 !
<null> 163
-PartsSupplier pg_catalog matpg_relatt nspname 5 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:ffbf69c1-2e34-4764-a9b3-9a1b61bfd4af !
<null> 241
+PartsSupplier pg_catalog matpg_relatt nspname 5 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:f1998229-2c1a-47b7-8f46-9dda81446db6 !
<null> 242
PartsSupplier pg_catalog pg_namespace oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:688e5112-4083-4b67-b42c-62d9a614c59a !
<null> 162
PartsSupplier pg_catalog pg_class oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:c1e736ac-c9d4-4026-8904-23c90e6eb1c0 !
<null> 164
PartsSupplier pg_catalog pg_attribute oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:f735e545-a81c-4ee2-84d0-3ea35d4083a2 !
<null> 173
PartsSupplier pg_catalog pg_type oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:b6f64d16-b147-459d-8e84-1bd3048fb900 !
<null> 183
-PartsSupplier pg_catalog pg_index oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:09daed8d-b0b8-4552-a261-2b6c775b46b0 !
<null> 191
-PartsSupplier pg_catalog pg_am oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:f6517a63-8c14-4b73-a18d-afaa5dfb35d9 !
<null> 199
-PartsSupplier pg_catalog pg_proc oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:f20c9489-10ca-4596-8a37-24218b67f764 !
<null> 201
-PartsSupplier pg_catalog pg_trigger oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:2b75f0b1-7475-4ed5-9da3-d37a8a25f26a !
<null> 211
-PartsSupplier pg_catalog pg_database oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:382f9fc9-8c96-4df7-ab5d-04dfb47ee142 !
<null> 224
-PartsSupplier pg_catalog pg_user oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:e63613cb-01ee-4b37-8b91-99d1aac4dfcb !
<null> 233
-PartsSupplier pg_catalog pg_proc proallargtypes 9 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:bcbed548-176c-4116-a5d6-7638cb0206e1 !
<null> 209
-PartsSupplier pg_catalog pg_proc proargmodes 8 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:d9f36bdc-7b25-4af0-b9f5-a96aac6d3094 !
<null> 208
-PartsSupplier pg_catalog pg_proc proargnames 7 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:ffa4ac73-b549-470e-931f-dc36330cb8c4 !
<null> 207
-PartsSupplier pg_catalog pg_proc proargtypes 6 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:6796c2e7-48a4-4f9f-bc98-d47913e2491c !
<null> 206
-PartsSupplier pg_catalog pg_proc proname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:bdf3ee1e-b5b7-48ab-b43c-4bbb2c8ae1e2 !
<null> 202
-PartsSupplier pg_catalog pg_proc pronamespace 10 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:a385751f-a31a-4d5d-9197-3fbd390b0251 !
<null> 210
-PartsSupplier pg_catalog pg_proc pronargs 5 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:9fb5a34a-3a7e-4d38-b7cd-239f28a3504e !
<null> 205
-PartsSupplier pg_catalog pg_proc proretset 3 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:b288b3aa-37f2-4a8e-8b1b-e932a2ce3e25 !
<null> 203
-PartsSupplier pg_catalog pg_proc prorettype 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:e0244e1d-431c-41fa-8194-1e357e2b688b !
<null> 204
+PartsSupplier pg_catalog pg_index oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:83ae2247-7eec-459f-b037-ffd3cdca0627 !
<null> 192
+PartsSupplier pg_catalog pg_am oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:3c67619c-7d8f-4378-b7e9-84a0451ea5e5 !
<null> 200
+PartsSupplier pg_catalog pg_proc oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:bdf3ee1e-b5b7-48ab-b43c-4bbb2c8ae1e2 !
<null> 202
+PartsSupplier pg_catalog pg_trigger oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:635b6634-632c-43c9-8cc7-bcaa016133e8 !
<null> 212
+PartsSupplier pg_catalog pg_database oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:689cde3b-a631-4f25-94b4-ff2ffe022b0f !
<null> 225
+PartsSupplier pg_catalog pg_user oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:bb78401d-d10c-43b1-af84-e4fa6b95db42 !
<null> 234
+PartsSupplier pg_catalog matpg_datatype oid 1 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:053375a4-3971-4705-9146-9ecc640022c2 !
<null> 245
+PartsSupplier pg_catalog pg_proc proallargtypes 9 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:a385751f-a31a-4d5d-9197-3fbd390b0251 !
<null> 210
+PartsSupplier pg_catalog pg_proc proargmodes 8 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:bcbed548-176c-4116-a5d6-7638cb0206e1 !
<null> 209
+PartsSupplier pg_catalog pg_proc proargnames 7 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:d9f36bdc-7b25-4af0-b9f5-a96aac6d3094 !
<null> 208
+PartsSupplier pg_catalog pg_proc proargtypes 6 <null> object 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Object 0 0 0 mmuid:ffa4ac73-b549-470e-931f-dc36330cb8c4 !
<null> 207
+PartsSupplier pg_catalog pg_proc proname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:b288b3aa-37f2-4a8e-8b1b-e932a2ce3e25 !
<null> 203
+PartsSupplier pg_catalog pg_proc pronamespace 10 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:e5715456-245f-4846-b90b-01d06d1c3672 !
<null> 211
+PartsSupplier pg_catalog pg_proc pronargs 5 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:6796c2e7-48a4-4f9f-bc98-d47913e2491c !
<null> 206
+PartsSupplier pg_catalog pg_proc proretset 3 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:e0244e1d-431c-41fa-8194-1e357e2b688b !
<null> 204
+PartsSupplier pg_catalog pg_proc prorettype 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:9fb5a34a-3a7e-4d38-b7cd-239f28a3504e !
<null> 205
PartsSupplier pg_catalog pg_class relam 5 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:c2f92b1a-6ba0-4486-8936-f5185d926178 !
<null> 168
PartsSupplier pg_catalog pg_class relhasoids 9 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:3ac5a14a-1f9e-455b-8ea1-cf0878774fd7 !
<null> 172
PartsSupplier pg_catalog pg_class relhasrules 8 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:6c26fd66-2a4a-4ccf-949a-a06a858db7f6 !
<null> 171
PartsSupplier pg_catalog pg_class relkind 4 <null> char 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Character 0 0 0 mmuid:ef4359eb-6d51-4249-bfea-40bc0f407d10 !
<null> 167
PartsSupplier pg_catalog pg_class relname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:5f9b50fa-8188-4048-93c2-3ad1587915df !
<null> 165
-PartsSupplier pg_catalog matpg_relatt relname 4 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:5cfb2b62-a912-4bfb-bf4f-51e107fe210c !
<null> 240
+PartsSupplier pg_catalog matpg_relatt relname 4 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:ffbf69c1-2e34-4764-a9b3-9a1b61bfd4af !
<null> 241
PartsSupplier pg_catalog pg_class relnamespace 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:4591ef08-bff8-4f3b-9de7-420f9c7f9d2b !
<null> 166
PartsSupplier pg_catalog pg_class relpages 7 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:44dee7d6-b6ae-44c7-85f2-e87364d8d059 !
<null> 170
PartsSupplier pg_catalog pg_class reltuples 6 <null> float 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Float 0 0 0 mmuid:b9ed4b49-5a7b-4ba4-863a-37fd95b2a34c !
<null> 169
PartsSupplier SYSADMIN VDBResources resourcePath 1 <null> string 0 255 false true false true true false false Nullable <null> <null> Searchable <null> <null> java.lang.String 0 255 10 mmuuid:b1bc5150-3dcc-452e-9e75-4a506997f612 !
<null> 27
-PartsSupplier pg_catalog pg_trigger tgargs 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:250d7c06-728a-4b2a-b557-91f2a69bb184 !
<null> 214
-PartsSupplier pg_catalog pg_trigger tgconstrname 8 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:da4b59ca-ebff-45a8-ad68-9777bc587813 !
<null> 218
-PartsSupplier pg_catalog pg_trigger tgconstrrelid 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:635b6634-632c-43c9-8cc7-bcaa016133e8 !
<null> 212
-PartsSupplier pg_catalog pg_trigger tgdeferrable 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:d70f020b-658c-4f58-86dc-0fbb12e2d8af !
<null> 216
-PartsSupplier pg_catalog pg_trigger tgfoid 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:64977f3e-f2a0-466e-a5d1-80bb058cbe08 !
<null> 213
-PartsSupplier pg_catalog pg_trigger tginitdeferred 7 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:bfbff036-caf2-4652-80cf-398af17ed7d1 !
<null> 217
-PartsSupplier pg_catalog pg_trigger tgnargs 5 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:0c20dbe7-5d89-411f-a8ab-3d77b999595b !
<null> 215
-PartsSupplier pg_catalog pg_trigger tgrelid 9 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:c010d12f-2074-45db-8e18-979cee2c45da !
<null> 219
+PartsSupplier pg_catalog pg_trigger tgargs 4 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:0c20dbe7-5d89-411f-a8ab-3d77b999595b !
<null> 215
+PartsSupplier pg_catalog pg_trigger tgconstrname 8 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:c010d12f-2074-45db-8e18-979cee2c45da !
<null> 219
+PartsSupplier pg_catalog pg_trigger tgconstrrelid 2 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:64977f3e-f2a0-466e-a5d1-80bb058cbe08 !
<null> 213
+PartsSupplier pg_catalog pg_trigger tgdeferrable 6 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:bfbff036-caf2-4652-80cf-398af17ed7d1 !
<null> 217
+PartsSupplier pg_catalog pg_trigger tgfoid 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:250d7c06-728a-4b2a-b557-91f2a69bb184 !
<null> 214
+PartsSupplier pg_catalog pg_trigger tginitdeferred 7 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:da4b59ca-ebff-45a8-ad68-9777bc587813 !
<null> 218
+PartsSupplier pg_catalog pg_trigger tgnargs 5 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:d70f020b-658c-4f58-86dc-0fbb12e2d8af !
<null> 216
+PartsSupplier pg_catalog pg_trigger tgrelid 9 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:71091853-c65e-46a9-9947-aa024f806e2d !
<null> 220
PartsSupplier pg_catalog pg_type typbasetype 6 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:a17d2f61-cd68-4c0d-8d25-132f68eb3b67 !
<null> 188
+PartsSupplier pg_catalog pg_type typelem 9 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:22ac431d-e6e6-4eef-9d74-b31795424e97 !
<null> 191
PartsSupplier pg_catalog pg_type typlen 4 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:931c09e1-937a-437e-aab2-2360f8d90e2b !
<null> 186
+PartsSupplier pg_catalog matpg_datatype typlen 5 <null> short 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Short 0 0 0 mmuid:0e9c4439-48d0-4115-a343-5baab7a236b6 !
<null> 249
PartsSupplier pg_catalog pg_type typname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:d600d818-2aad-4c92-9343-267d044dd97d !
<null> 184
+PartsSupplier pg_catalog matpg_datatype typname 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:0f312b3c-98ca-4a09-81fa-f1ff83f0a6c1 !
<null> 246
PartsSupplier pg_catalog pg_type typnamespace 3 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:e47217d2-2b07-4353-bfbd-d7c883a5e7e0 !
<null> 185
+PartsSupplier pg_catalog matpg_relatt typoid 7 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:595a823f-cec1-42dc-b8b2-c95c8b4e4e66 !
<null> 244
PartsSupplier pg_catalog pg_type typrelid 8 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:bec25882-b292-4ed1-a610-cad5d504837d !
<null> 190
PartsSupplier pg_catalog pg_type typtype 5 <null> char 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Character 0 0 0 mmuid:83199eba-7af4-44a9-822f-006677b1b895 !
<null> 187
PartsSupplier pg_catalog pg_type typtypmod 7 <null> integer 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Integer 0 0 0 mmuid:cee3559d-1ce6-4b17-ad57-2ecb79a9e1d2 !
<null> 189
-PartsSupplier pg_catalog pg_user usecreatedb 3 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:236445e1-408c-40a1-a61c-40e96fb5dc9f !
<null> 235
-PartsSupplier pg_catalog pg_user usename 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:bb78401d-d10c-43b1-af84-e4fa6b95db42 !
<null> 234
-PartsSupplier pg_catalog pg_user usesuper 4 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:6da98878-b46e-4ed1-b032-1bc72da595f4 !
<null> 236
-Row Count : 242
+PartsSupplier pg_catalog matpg_datatype uid 4 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:87826ebc-98a5-4f19-a6d8-6b7b96cbed48 !
<null> 248
+PartsSupplier pg_catalog pg_user usecreatedb 3 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:6da98878-b46e-4ed1-b032-1bc72da595f4 !
<null> 236
+PartsSupplier pg_catalog pg_user usename 2 <null> string 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.String 0 0 0 mmuid:236445e1-408c-40a1-a61c-40e96fb5dc9f !
<null> 235
+PartsSupplier pg_catalog pg_user usesuper 4 <null> boolean 0 0 false true false false false false false Unknown <null> <null> Searchable <null> <null> java.lang.Boolean 0 0 0 mmuid:9bfddc66-af75-4366-8eac-b9fef3421219 !
<null> 237
+Row Count : 249
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Columns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Columns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeyColumns.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -9,16 +9,20 @@
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER SUPPLIER_ID PK_SUPPLIER Primary <null> mmuuid:375c8380-73ff-1edc-a81c-ecf397b10590 1 8
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS SUPPLIER_ID PK_SUPPLIER_PARTS Primary <null> mmuuid:455e5440-73ff-1edc-a81c-ecf397b10590 1 4
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER SUPPLIER_STATUS FK_SPLIER_STATS Foreign mmuuid:25a8a740-73ff-1edc-a81c-ecf397b10590 mmuuid:5ac43c00-73ff-1edc-a81c-ecf397b10590 1 9
-PartsSupplier pg_catalog matpg_relatt attname pk_matpg_relatt_names Primary <null> mmuid:23454408-0347-40d2-a3f9-3faa664fb5e9 1 14
-PartsSupplier pg_catalog matpg_relatt attnum idx_matpg_relatt_ids Index <null> mmuid:595a823f-cec1-42dc-b8b2-c95c8b4e4e66 2 18
-PartsSupplier pg_catalog matpg_relatt attrelid idx_matpg_relatt_ids Index <null> mmuid:595a823f-cec1-42dc-b8b2-c95c8b4e4e66 1 17
-PartsSupplier pg_catalog matpg_relatt nspname pk_matpg_relatt_names Primary <null> mmuid:23454408-0347-40d2-a3f9-3faa664fb5e9 3 16
+PartsSupplier pg_catalog matpg_relatt attname pk_matpg_relatt_names Primary <null> mmuid:559efade-b320-49bd-8524-1d325ae11c82 1 14
+PartsSupplier pg_catalog matpg_relatt attnum idx_matpg_relatt_ids Index <null> mmuid:349f0c8c-7c64-4e0a-a84a-aee3deaf83af 2 18
+PartsSupplier pg_catalog matpg_relatt attrelid idx_matpg_relatt_ids Index <null> mmuid:349f0c8c-7c64-4e0a-a84a-aee3deaf83af 1 17
+PartsSupplier pg_catalog matpg_datatype name matpg_datatype_names Primary <null> mmuid:eda814fb-0a5a-4fbf-87bc-b57952292038 2 20
+PartsSupplier pg_catalog matpg_relatt nspname pk_matpg_relatt_names Primary <null> mmuid:559efade-b320-49bd-8524-1d325ae11c82 3 16
+PartsSupplier pg_catalog matpg_datatype oid matpg_datatype_ids Index <null> mmuid:443a2ab3-8257-4c4c-838e-9a47deaf4cf9 2 22
+PartsSupplier pg_catalog matpg_datatype oid matpg_datatype_names Primary <null> mmuid:eda814fb-0a5a-4fbf-87bc-b57952292038 1 19
PartsSupplier pg_catalog pg_attribute oid pk_pg_attr Primary <null> mmuid:649c1635-60ad-4c28-9b20-035c562bb1be 1 11
PartsSupplier pg_catalog pg_class oid pk_pg_class Primary <null> mmuid:59f7dc95-95fe-4d90-9813-1a097188e768 1 10
-PartsSupplier pg_catalog pg_index oid pk_pg_index Primary <null> mmuid:347ec08c-6b41-41d0-8475-031ce7d99ac0 1 12
-PartsSupplier pg_catalog pg_proc oid pk_pg_proc Primary <null> mmuid:e5715456-245f-4846-b90b-01d06d1c3672 1 13
-PartsSupplier pg_catalog matpg_relatt relname pk_matpg_relatt_names Primary <null> mmuid:23454408-0347-40d2-a3f9-3faa664fb5e9 2 15
-Row Count : 18
+PartsSupplier pg_catalog pg_index oid pk_pg_index Primary <null> mmuid:1462b28e-0bab-436f-9654-013821506337 1 12
+PartsSupplier pg_catalog pg_proc oid pk_pg_proc Primary <null> mmuid:9569efdb-21b2-4b4f-a2db-e7406267b8ed 1 13
+PartsSupplier pg_catalog matpg_relatt relname pk_matpg_relatt_names Primary <null> mmuid:559efade-b320-49bd-8524-1d325ae11c82 2 15
+PartsSupplier pg_catalog matpg_datatype typname matpg_datatype_ids Index <null> mmuid:443a2ab3-8257-4c4c-838e-9a47deaf4cf9 1 21
+Row Count : 22
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS KeyColumns 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS KeyColumns 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testKeys.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -8,13 +8,15 @@
PartsSupplier PartsSupplier PARTSSUPPLIER.STATUS PK_STATUS <null> <null> Primary false <null> mmuuid:25a8a740-73ff-1edc-a81c-ecf397b10590 3
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER PK_SUPPLIER <null> <null> Primary false <null> mmuuid:375c8380-73ff-1edc-a81c-ecf397b10590 7
PartsSupplier PartsSupplier PARTSSUPPLIER.SUPPLIER_PARTS PK_SUPPLIER_PARTS <null> <null> Primary false <null> mmuuid:455e5440-73ff-1edc-a81c-ecf397b10590 4
-PartsSupplier pg_catalog matpg_relatt idx_matpg_relatt_ids <null> <null> Index false <null> mmuid:595a823f-cec1-42dc-b8b2-c95c8b4e4e66 14
-PartsSupplier pg_catalog matpg_relatt pk_matpg_relatt_names <null> <null> Primary false <null> mmuid:23454408-0347-40d2-a3f9-3faa664fb5e9 13
+PartsSupplier pg_catalog matpg_relatt idx_matpg_relatt_ids <null> <null> Index false <null> mmuid:349f0c8c-7c64-4e0a-a84a-aee3deaf83af 14
+PartsSupplier pg_catalog matpg_datatype matpg_datatype_ids <null> <null> Index false <null> mmuid:443a2ab3-8257-4c4c-838e-9a47deaf4cf9 16
+PartsSupplier pg_catalog matpg_datatype matpg_datatype_names <null> <null> Primary false <null> mmuid:eda814fb-0a5a-4fbf-87bc-b57952292038 15
+PartsSupplier pg_catalog matpg_relatt pk_matpg_relatt_names <null> <null> Primary false <null> mmuid:559efade-b320-49bd-8524-1d325ae11c82 13
PartsSupplier pg_catalog pg_attribute pk_pg_attr <null> <null> Primary false <null> mmuid:649c1635-60ad-4c28-9b20-035c562bb1be 10
PartsSupplier pg_catalog pg_class pk_pg_class <null> <null> Primary false <null> mmuid:59f7dc95-95fe-4d90-9813-1a097188e768 9
-PartsSupplier pg_catalog pg_index pk_pg_index <null> <null> Primary false <null> mmuid:347ec08c-6b41-41d0-8475-031ce7d99ac0 11
-PartsSupplier pg_catalog pg_proc pk_pg_proc <null> <null> Primary false <null> mmuid:e5715456-245f-4846-b90b-01d06d1c3672 12
-Row Count : 14
+PartsSupplier pg_catalog pg_index pk_pg_index <null> <null> Primary false <null> mmuid:1462b28e-0bab-436f-9654-013821506337 11
+PartsSupplier pg_catalog pg_proc pk_pg_proc <null> <null> Primary false <null> mmuid:9569efdb-21b2-4b4f-a2db-e7406267b8ed 12
+Row Count : 16
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Keys 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Keys 255 255 0 false true false true 1 false true true true
Modified: trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected
===================================================================
--- trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected 2011-04-12 19:35:57 UTC (rev 3083)
+++ trunk/test-integration/common/src/test/resources/TestSystemVirtualModel/testTables.expected 2011-04-12 23:20:51 UTC (rev 3084)
@@ -18,19 +18,20 @@
PartsSupplier SYS Tables Table <null> true false mmuuid:8551b3bd-11cc-4049-9bcf-fe91a0eb7ba7 0 <null> true false 17
PartsSupplier SYSADMIN VDBResources Table <null> true false mmuuid:1785804d-beaf-4831-9531-e59164fedd49 0 <null> true false 7
PartsSupplier SYS VirtualDatabases Table <null> true false mmuuid:47297c72-d621-4f4e-af4e-74060ac5f489 0 <null> true false 18
-PartsSupplier pg_catalog matpg_relatt Table <null> false false mmuid:9bfddc66-af75-4366-8eac-b9fef3421219 0 <null> true true 30
-PartsSupplier pg_catalog pg_am Table <null> false false mmuid:1462b28e-0bab-436f-9654-013821506337 0 <null> true false 24
-PartsSupplier pg_catalog pg_attrdef Table <null> false false mmuid:71091853-c65e-46a9-9947-aa024f806e2d 0 <null> true false 27
+PartsSupplier pg_catalog matpg_datatype Table <null> false false mmuid:17448311-6679-4dfd-aeb6-4aabbd894729 0 <null> true true 31
+PartsSupplier pg_catalog matpg_relatt Table <null> false false mmuid:8c0714d6-1c72-40b4-8528-3b2c63059107 0 <null> true true 30
+PartsSupplier pg_catalog pg_am Table <null> false false mmuid:f6517a63-8c14-4b73-a18d-afaa5dfb35d9 0 <null> true false 24
+PartsSupplier pg_catalog pg_attrdef Table <null> false false mmuid:76a7dd05-9a7d-4243-b561-f3056500dcaf 0 <null> true false 27
PartsSupplier pg_catalog pg_attribute Table <null> false false mmuid:fa463d98-365f-489a-a707-025193cb51eb 0 <null> true true 21
PartsSupplier pg_catalog pg_class Table <null> false false mmuid:7e21f2e6-06e3-4bca-9b01-72ea47821560 0 <null> true true 20
-PartsSupplier pg_catalog pg_database Table <null> false false mmuid:492dd834-907f-429b-aa6e-958ad65204c6 0 <null> true false 28
-PartsSupplier pg_catalog pg_index Table <null> false false mmuid:22ac431d-e6e6-4eef-9d74-b31795424e97 0 <null> true true 23
+PartsSupplier pg_catalog pg_database Table <null> false false mmuid:382f9fc9-8c96-4df7-ab5d-04dfb47ee142 0 <null> true false 28
+PartsSupplier pg_catalog pg_index Table <null> false false mmuid:09daed8d-b0b8-4552-a261-2b6c775b46b0 0 <null> true true 23
PartsSupplier pg_catalog pg_namespace Table <null> false false mmuid:6609866a-3d7b-4f4b-95fe-ebfac769d699 0 <null> true false 19
-PartsSupplier pg_catalog pg_proc Table <null> false false mmuid:da4b747e-7d87-403a-8309-2cdf1399031b 0 <null> true true 25
-PartsSupplier pg_catalog pg_trigger Table <null> false false mmuid:9569efdb-21b2-4b4f-a2db-e7406267b8ed 0 <null> true false 26
+PartsSupplier pg_catalog pg_proc Table <null> false false mmuid:f20c9489-10ca-4596-8a37-24218b67f764 0 <null> true true 25
+PartsSupplier pg_catalog pg_trigger Table <null> false false mmuid:2b75f0b1-7475-4ed5-9da3-d37a8a25f26a 0 <null> true false 26
PartsSupplier pg_catalog pg_type Table <null> false false mmuid:9462e3f8-cd3c-414f-a570-f6f33c40e36a 0 <null> true false 22
-PartsSupplier pg_catalog pg_user Table <null> false false mmuid:28d034eb-6f39-402f-b642-9c9560e57247 0 <null> true false 29
-Row Count : 30
+PartsSupplier pg_catalog pg_user Table <null> false false mmuid:e63613cb-01ee-4b37-8b91-99d1aac4dfcb 0 <null> true false 29
+Row Count : 31
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Tables 255 255 0 false true false true 1 false true true true
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Tables 255 255 0 false true false true 1 false true true true
Added: trunk/test-integration/common/src/test/resources/bqt.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/test-integration/common/src/test/resources/bqt.vdb
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 9 months
teiid SVN: r3083 - in trunk: api/src/main/java/org/teiid/metadata and 26 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-12 15:35:57 -0400 (Tue, 12 Apr 2011)
New Revision: 3083
Added:
trunk/cache-jbosscache/src/main/java/org/teiid/events/
trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/
trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
trunk/engine/src/main/java/org/teiid/events/
trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
Modified:
trunk/api/src/main/java/org/teiid/metadata/Table.java
trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/console/src/main/resources/META-INF/rhq-plugin.xml
trunk/engine/src/main/java/org/teiid/cache/Cachable.java
trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/pom.xml
Log:
TEIID-1507 initial support for cache invalidation based upon events
Modified: trunk/api/src/main/java/org/teiid/metadata/Table.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/Table.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/api/src/main/java/org/teiid/metadata/Table.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -66,6 +66,9 @@
private List<String> schemaPaths;
private String resourcePath;
+ private transient long lastModified;
+ private transient long lastDataModification;
+
public List<String> getBindings() {
return bindings;
}
@@ -270,4 +273,20 @@
column.setParent(this);
}
+ public long getLastDataModification() {
+ return lastDataModification;
+ }
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public void setLastDataModification(long lastDataModification) {
+ this.lastDataModification = lastDataModification;
+ }
+
+ public void setLastModified(long lastModified) {
+ this.lastModified = lastModified;
+ }
+
}
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-cache-manager-jboss-beans-rename-me.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -137,5 +137,15 @@
</map>
</property>
</bean>
+
+ <bean name="EventDistributorFactory" class="org.teiid.events.jboss.JGroupsEventDistributor">
+ <property name="jndiName">teiid/event-distributor</property>
+ <property name="channelFactory">
+ <inject bean="JChannelFactory" />
+ </property>
+ <property name="clusterName">${jboss.partition.name:DefaultPartition}-teiid-events</property>
+ <property name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="localEventDistributorName">teiid/runtime-engine</property>
+ </bean>
</deployment>
\ No newline at end of file
Modified: trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -57,15 +57,31 @@
<bean name="ResultsetCacheConfig" class="org.teiid.cache.CacheConfiguration">
<property name="name">ResultSetCacheConfig</property>
<property name="enabled">true</property>
- <!-- Max Entries allowed for ResultSet Cache (default 1024) -->
+ <!-- Max Entries allowed (default 1024) -->
<property name="maxEntries">1024</property>
<!-- Max age in seconds (default 7200 - 2 hours) -->
<property name="maxAgeInSeconds">7200</property>
+ <!-- Max staleness in seconds. Modifications are based upon data updates
+ -1 indicates no max. (default 60 - 1 minute) -->
+ <property name="maxStaleness">60</property>
<!-- Allowed values are LRU, EXPIRATION.
Setting this value to LRU will cause cache hint TTL values
to be ignored. (default EXPIRATION) -->
<property name="type">EXPIRATION</property>
<property name="location">resultset</property>
+ </bean>
+
+ <!-- Configuration for prepared plan caching. (local memory only)
+ -->
+ <bean name="PreparedPlanCacheConfig" class="org.teiid.cache.CacheConfiguration">
+ <property name="name">PreparedPlanCacheConfig</property>
+ <!-- Max Entries allowed (default 512) -->
+ <property name="maxEntries">512</property>
+ <!-- Max age in seconds (default 28800 - 8 hours) -->
+ <property name="maxAgeInSeconds">28800</property>
+ <!-- Max staleness in seconds. Modifications are based upon costing updates
+ -1 indicates no max. (default 300 - 5 minutes) -->
+ <property name="maxStaleness">300</property>
</bean>
<bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">
@@ -84,6 +100,7 @@
<property name="VDBStatusChecker"><inject bean="VDBStatusChecker"/></property>
<property name="cacheFactory"><inject bean="CacheFactory"/></property>
<property name="resultsetCacheConfig"><inject bean="ResultsetCacheConfig"/></property>
+ <property name="preparedPlanCacheConfig"><inject bean="PreparedPlanCacheConfig"/></property>
<!-- Process pool maximum thread count. (default 64) -->
<property name="maxThreads">64</property>
@@ -100,10 +117,6 @@
<property name="maxRowsFetchSize">20480</property>
<!-- The max lob chunk size in KB transferred each time when processing blobs, clobs (100KB default) -->
<property name="lobChunkSizeInKB">100</property>
- <!-- The maximum number of query plans that are cached.
- This includes both user plans and internal prepared plans.
- Note: this is a memory based cache. (default 512) -->
- <property name="preparedPlanCacheMaxCount">512</property>
<!-- Turn on role checking based upon the data roles defined in VDBs. (default true) -->
<property name="useDataRoles">true</property>
<!-- Sets whether temporary table usage is enabled by default (default true) -->
@@ -116,6 +129,8 @@
<property name="exceptionOnMaxSourceRows">true</property>
<!-- Maximum size of lob allowed through ODBC connection in bytes (default 5MB) -->
<property name="maxODBCLobSizeAllowed">5242880</property>
+ <!-- The JNDI name of the Teiid Event Distributor -->
+ <property name="eventDistributorName">teiid/event-distributor</property>
</bean>
<!-- JDBC Socket connection properties (SSL see below) -->
Added: trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java (rev 0)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+ package org.teiid.events.jboss;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.Vector;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.util.naming.Util;
+import org.jgroups.Address;
+import org.jgroups.Channel;
+import org.jgroups.JChannelFactory;
+import org.jgroups.ReceiverAdapter;
+import org.jgroups.View;
+import org.jgroups.blocks.GroupRequest;
+import org.jgroups.blocks.MethodCall;
+import org.jgroups.blocks.RpcDispatcher;
+import org.teiid.events.EventDistributor;
+
+public class JGroupsEventDistributor extends ReceiverAdapter implements Serializable {
+
+ private static final long serialVersionUID = -1140683411842561358L;
+
+ private transient JChannelFactory channelFactory;
+ private String multiplexerStack;
+ private String clusterName;
+ private String jndiName;
+ private String localEventDistributorName;
+
+ private transient EventDistributor proxyEventDistributor;
+ private transient EventDistributor localEventDistributor;
+
+ private transient Channel channel;
+ private transient RpcDispatcher rpcDispatcher;
+ private transient Vector<Address> members;
+
+ public JChannelFactory getChannelFactory() {
+ return channelFactory;
+ }
+
+ public void setJndiName(String jndiName) {
+ this.jndiName = jndiName;
+ }
+
+ public String getJndiName() {
+ return jndiName;
+ }
+
+ public String getLocalEventDistributorName() {
+ return localEventDistributorName;
+ }
+
+ public void setLocalEventDistributorName(String localEventDistributorName) {
+ this.localEventDistributorName = localEventDistributorName;
+ }
+
+ public String getMultiplexerStack() {
+ return multiplexerStack;
+ }
+
+ public String getClusterName() {
+ return clusterName;
+ }
+
+ public void setChannelFactory(JChannelFactory channelFactory) {
+ this.channelFactory = channelFactory;
+ }
+
+ public void setClusterName(String clusterName) {
+ this.clusterName = clusterName;
+ }
+
+ public void setMultiplexerStack(String multiplexerStack) {
+ this.multiplexerStack = multiplexerStack;
+ }
+
+ public void start() throws Exception {
+ if (this.channelFactory == null) {
+ return; //no need to distribute events
+ }
+ channel = this.channelFactory.createMultiplexerChannel(this.multiplexerStack, null);
+ channel.connect(this.clusterName);
+
+ proxyEventDistributor = (EventDistributor) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ rpcDispatcher.callRemoteMethods(members, new MethodCall(method, args), GroupRequest.GET_NONE, 0);
+ return null;
+ }
+ });
+ //wrap the local in a proxy to prevent unintended methods from being called
+ rpcDispatcher = new RpcDispatcher(channel, this, this, Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ EventDistributor local = getLocalEventDistributor();
+ if (local == null) {
+ return null;
+ }
+ return method.invoke(local, args);
+ }
+ }));
+ rpcDispatcher.setDeadlockDetection(false);
+ if (jndiName != null) {
+ final InitialContext ic = new InitialContext();
+ Util.bind(ic, jndiName, proxyEventDistributor);
+ }
+ }
+
+ private EventDistributor getLocalEventDistributor() {
+ if (localEventDistributor == null && this.localEventDistributorName != null) {
+ try {
+ Context ctx = new InitialContext();
+ return (EventDistributor) ctx.lookup(this.localEventDistributorName);
+ } catch (NamingException e) {
+ return null;
+ }
+ }
+ return localEventDistributor;
+ }
+
+ @Override
+ public void viewAccepted(View newView) {
+ Vector<Address> new_members = new Vector<Address>(newView.getMembers());
+ new_members.remove(this.channel.getLocalAddress());
+ this.members = new_members;
+ }
+
+ public void stop() {
+ if (jndiName != null) {
+ final InitialContext ic ;
+ try {
+ ic = new InitialContext() ;
+ Util.unbind(ic, jndiName) ;
+ } catch (final NamingException ne) {
+ }
+ }
+ if (this.channel != null) {
+ this.channel.close();
+ this.rpcDispatcher.stop();
+ }
+ }
+
+}
Property changes on: trunk/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -323,10 +323,6 @@
displayName="Lob Chunk Size In KB"
description="The max lob chunk size in KB transferred to the client for xml, blobs, clobs (default 100KB)"
required="false" readOnly="false" />
- <c:simple-property name="RuntimeEngineDeployer.preparedPlanCacheMaxCount"
- displayName="Prepared Plan Cache Max Count"
- description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 512)"
- required="false" readOnly="false" />
<c:simple-property name="RuntimeEngineDeployer.queryThresholdInSecs"
displayName="Long Running Query Threshold"
description="Length of time in seconds before a query is considered long running"
@@ -350,9 +346,29 @@
<c:simple-property name="ResultSetCacheConfig.maxAgeInSeconds"
displayName="Max Entry Age"
description="The maximum age of a result set cache entry in seconds. -1 indicates no max. (default 7200)"
+ required="false" readOnly="false" />
+ <c:simple-property name="ResultSetCacheConfig.maxStaleness"
+ displayName="Max Entry Staleness"
+ description="The maximum staleness of a result set cache entry in seconds based upon data modifications. -1 indicates no max. (default 60)"
required="false" readOnly="false" />
</c:group>
+ <c:group name="PreparedPlanCacheConfig" displayName="Prepared Plan Cache Properties" hiddenByDefault="false">
+ <!-- the below property on RuntimeEngineDeployer -->
+ <c:simple-property name="PreparedPlanCacheConfig.maxEntries"
+ displayName="Max Entries"
+ description="The maximum number of prepared plan cache entries. -1 indicates no limit. (default 512"
+ required="false" readOnly="false" />
+ <c:simple-property name="PreparedPlanCacheConfig.maxAgeInSeconds"
+ displayName="Max Entry Age"
+ description="The maximum age of a prepared plan cache entry in seconds. -1 indicates no max. (default 28800)"
+ required="false" readOnly="false" />
+ <c:simple-property name="PreparedPlanCacheConfig.maxStaleness"
+ displayName="Max Entry Staleness"
+ description="The maximum staleness of a prepared plan cache entry in seconds based upon costing modifications. -1 indicates no max. (default 300)"
+ required="false" readOnly="false" />
+ </c:group>
+
<c:group name="BufferService" displayName="Buffer Service Properties"
hiddenByDefault="false">
<c:simple-property name="BufferService.maxBufferSpace"
Modified: trunk/engine/src/main/java/org/teiid/cache/Cachable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/Cachable.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/cache/Cachable.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,10 +22,13 @@
package org.teiid.cache;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.dqp.internal.process.AccessInfo;
public interface Cachable {
-
+
boolean prepare(Cache cache, BufferManager bufferManager);
boolean restore(Cache cache, BufferManager bufferManager);
+
+ AccessInfo getAccessInfo();
}
Modified: trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -27,6 +27,7 @@
import org.jboss.managed.api.annotation.ManagementObjectID;
import org.jboss.managed.api.annotation.ManagementProperties;
import org.jboss.managed.api.annotation.ManagementProperty;
+import org.teiid.dqp.internal.process.SessionAwareCache;
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class CacheConfiguration {
@@ -37,12 +38,14 @@
}
private Policy policy;
- private int maxage;
- private int maxEntries;
+ private int maxage = -1;
+ private int maxEntries = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
private boolean enabled = true;
private String name;
private String location;
-
+
+ private int maxStaleness = -1;
+
public CacheConfiguration() {
}
@@ -57,7 +60,7 @@
return this.policy;
}
- @ManagementProperty(description="The maximum age of a result set cache entry in seconds. -1 indicates no max. (default 7200)")
+ @ManagementProperty(description="The maximum age of an entry in seconds. -1 indicates no max.")
public int getMaxAgeInSeconds(){
return maxage;
}
@@ -66,7 +69,16 @@
this.maxage = maxage;
}
- @ManagementProperty(description="The maximum number of result set cache entries. -1 indicates no limit. (default 1024)")
+ @ManagementProperty(description="The maximum staleness in seconds of an entry based upon modifications. -1 indicates no max.")
+ public int getMaxStaleness() {
+ return maxStaleness;
+ }
+
+ public void setMaxStaleness(int maxStaleDataModification) {
+ this.maxStaleness = maxStaleDataModification;
+ }
+
+ @ManagementProperty(description="The maximum number of cache entries. -1 indicates no limit. (default 1024)")
public int getMaxEntries() {
return this.maxEntries;
}
@@ -98,37 +110,6 @@
this.location = location;
}
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + maxage;
- result = prime * result + maxEntries;
- result = prime * result + ((policy == null) ? 0 : policy.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CacheConfiguration other = (CacheConfiguration) obj;
- if (maxage != other.maxage)
- return false;
- if (maxEntries != other.maxEntries)
- return false;
- if (policy == null) {
- if (other.policy != null)
- return false;
- } else if (!policy.equals(other.policy))
- return false;
- return true;
- }
-
public boolean isEnabled() {
return enabled;
}
Added: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.dqp.internal.process;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.api.exception.query.QueryValidatorException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.metadata.Table;
+import org.teiid.query.metadata.TempMetadataID;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
+import org.teiid.query.processor.ProcessorPlan;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.tempdata.TempTableStore;
+import org.teiid.query.util.CommandContext;
+
+/**
+ * Tracks what views were used and what tables are accessed
+ */
+public class AccessInfo implements Serializable {
+
+ private static final long serialVersionUID = -2608267960584191359L;
+
+ private transient Set<Table> viewsAccessed;
+ private transient Set<Object> tablesAccessed;
+
+ private List<List<String>> externalTableNames;
+ private List<List<String>> externalViewNames;
+
+ private transient long creationTime = System.currentTimeMillis();
+
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ externalTableNames = initExternalList(externalTableNames, tablesAccessed);
+ externalViewNames = initExternalList(externalViewNames, viewsAccessed);
+ out.defaultWriteObject();
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
+ in.defaultReadObject();
+ this.creationTime = System.currentTimeMillis();
+ }
+
+ private List<List<String>> initExternalList(List<List<String>> externalNames, Set<? extends Object> accessed) {
+ if (externalNames == null) {
+ externalNames = new ArrayList<List<String>>(accessed.size());
+ for (Object object : accessed) {
+ if (object instanceof Table) {
+ Table t = (Table)object;
+ externalNames.add(Arrays.asList(t.getParent().getName(), t.getName()));
+ } else if (object instanceof TempMetadataID) {
+ TempMetadataID t = (TempMetadataID)object;
+ externalNames.add(Arrays.asList(t.getID()));
+ }
+ }
+ }
+ return externalNames;
+ }
+
+ public Set<Table> getViewsAccessed() {
+ return viewsAccessed;
+ }
+
+ public Set<Object> getTablesAccessed() {
+ return tablesAccessed;
+ }
+
+ public long getCreationTime() {
+ return creationTime;
+ }
+
+ void populate(ProcessorPlan plan, CommandContext context) {
+ List<GroupSymbol> groups = new ArrayList<GroupSymbol>();
+ plan.getAccessedGroups(groups);
+ if (!groups.isEmpty()) {
+ tablesAccessed = new HashSet<Object>();
+ for (GroupSymbol groupSymbol : groups) {
+ tablesAccessed.add(groupSymbol.getMetadataID());
+ }
+ } else {
+ tablesAccessed = Collections.emptySet();
+ }
+ if (!context.getViewsAccessed().isEmpty()) {
+ this.viewsAccessed = new HashSet<Table>(context.getViewsAccessed());
+ } else {
+ this.viewsAccessed = Collections.emptySet();
+ }
+ }
+
+ void restore() throws QueryResolverException, QueryValidatorException, TeiidComponentException {
+ if (this.viewsAccessed != null) {
+ return;
+ }
+ VDBMetaData vdb = DQPWorkContext.getWorkContext().getVDB();
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (!externalViewNames.isEmpty()) {
+ this.viewsAccessed = new HashSet<Table>();
+ for (List<String> key : this.externalViewNames) {
+ this.viewsAccessed.add(tm.getMetadataStore().getSchema(key.get(0).toUpperCase()).getTables().get(key.get(1).toUpperCase()));
+ }
+ } else {
+ this.viewsAccessed = Collections.emptySet();
+ }
+ this.externalViewNames = null;
+ if (!externalTableNames.isEmpty()) {
+ for (List<String> key : this.externalTableNames) {
+ if (key.size() == 1) {
+ String matTableName = key.get(0);
+ TempMetadataID id = globalStore.getMetadataStore().getTempGroupID(matTableName);
+ if (id == null) {
+ //if the id is null, then create a local instance
+ String viewFullName = matTableName.substring(RelationalPlanner.MAT_PREFIX.length());
+ id = globalStore.getGlobalTempTableMetadataId(tm.getGroupID(viewFullName), tm);
+ }
+ this.tablesAccessed.add(id);
+ } else {
+ this.tablesAccessed.add(tm.getMetadataStore().getSchema(key.get(0).toUpperCase()).getTables().get(key.get(1).toUpperCase()));
+ }
+ }
+ } else {
+ this.tablesAccessed = Collections.emptySet();
+ }
+ this.externalTableNames = null;
+ }
+
+ boolean validate(boolean data, long modTime) {
+ if (this.tablesAccessed == null || modTime < 0) {
+ return true;
+ }
+ if (!data) {
+ for (Table t : getViewsAccessed()) {
+ if (t.getLastModified() - modTime > this.creationTime) {
+ return false;
+ }
+ }
+ }
+ for (Object o : getTablesAccessed()) {
+ if (o instanceof Table) {
+ Table t = (Table)o;
+ if ((data?t.getLastDataModification():t.getLastModified()) - modTime > this.creationTime) {
+ return false;
+ }
+ } else if (o instanceof TempMetadataID) {
+ TempMetadataID tid = (TempMetadataID)o;
+ if (tid.getTableData().getLastModified() - modTime > this.creationTime) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/dqp/internal/process/AccessInfo.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -35,6 +35,7 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
import org.teiid.logging.LogConstants;
@@ -44,6 +45,7 @@
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.parser.ParseInfo;
import org.teiid.query.parser.QueryParser;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.Command;
@@ -65,6 +67,8 @@
private int rowCount;
private boolean hasLobs;
+ private AccessInfo accessInfo = new AccessInfo();
+
public String getId() {
return this.uuid;
}
@@ -81,13 +85,14 @@
return results;
}
- public void setResults(TupleBuffer results) {
+ public void setResults(TupleBuffer results, ProcessorPlan plan) {
this.results = results;
this.batchSize = results.getBatchSize();
this.types = TupleBuffer.getTypeNames(results.getSchema());
this.rowCount = results.getRowCount();
this.uuid = results.getId();
this.hasLobs = results.isLobs();
+ this.accessInfo.populate(plan, plan.getContext());
}
public void setCommand(Command command) {
@@ -146,10 +151,17 @@
this.results = buffer;
bufferManager.addTupleBuffer(this.results);
}
+ this.accessInfo.restore();
return true;
- } catch (TeiidComponentException e) {
- LogManager.logDetail(LogConstants.CTX_DQP, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
+ } catch (TeiidException e) {
+ LogManager.logDetail(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
}
return false;
}
+
+ @Override
+ public AccessInfo getAccessInfo() {
+ return accessInfo;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -45,7 +45,6 @@
private int timeSliceInMilli = DEFAULT_PROCESSOR_TIMESLICE;
private int maxRowsFetchSize = DEFAULT_FETCH_SIZE;
private int lobChunkSizeInKB = 100;
- private int preparedPlanCacheMaxCount = SessionAwareCache.DEFAULT_MAX_SIZE_TOTAL;
private boolean useDataRoles = true;
private boolean allowCreateTemporaryTablesByDefault = true;
private int queryThresholdInSecs = DEFAULT_QUERY_THRESHOLD;
@@ -53,11 +52,12 @@
private int maxSourceRows = -1;
private int maxActivePlans = DEFAULT_MAX_ACTIVE_PLANS;
private CacheConfiguration resultsetCacheConfig;
+ private CacheConfiguration preparedPlanCacheConfig = new CacheConfiguration();
private int maxODBCLobSizeAllowed = 5*1024*1024; // 5 MB
private int userRequestSourceConcurrency = DEFAULT_USER_REQUEST_SOURCE_CONCURRENCY;
- private AuthorizationValidator authorizationValidator;
- private MetadataProvider metadataProvider;
+ private transient AuthorizationValidator authorizationValidator;
+ private transient MetadataProvider metadataProvider;
@ManagementProperty(description="Max active plans (default 20). Increase this value, and max threads, on highly concurrent systems - but ensure that the underlying pools can handle the increased load without timeouts.")
public int getMaxActivePlans() {
@@ -116,15 +116,6 @@
this.lobChunkSizeInKB = lobChunkSizeInKB;
}
- @ManagementProperty(description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 512)")
- public int getPreparedPlanCacheMaxCount() {
- return this.preparedPlanCacheMaxCount;
- }
-
- public void setPreparedPlanCacheMaxCount(int preparedPlanCacheMaxCount) {
- this.preparedPlanCacheMaxCount = preparedPlanCacheMaxCount;
- }
-
public CacheConfiguration getResultsetCacheConfig() {
return this.resultsetCacheConfig;
}
@@ -230,4 +221,14 @@
public void setMetadataProvider(MetadataProvider metadataProvider) {
this.metadataProvider = metadataProvider;
}
+
+ public CacheConfiguration getPreparedPlanCacheConfig() {
+ return preparedPlanCacheConfig;
+ }
+
+ public void setPreparedPlanCacheConfig(
+ CacheConfiguration preparedPlanCacheConfig) {
+ this.preparedPlanCacheConfig = preparedPlanCacheConfig;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -73,7 +73,6 @@
import org.teiid.logging.MessageLevel;
import org.teiid.logging.CommandLogMessage.Event;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.tempdata.TempTableDataManager;
import org.teiid.query.tempdata.TempTableStore;
@@ -171,7 +170,7 @@
// Resources
private BufferManager bufferManager;
- private ProcessorDataManager dataTierMgr;
+ private TempTableDataManager dataTierMgr;
private SessionAwareCache<PreparedPlan> prepPlanCache;
private SessionAwareCache<CachedResults> rsCache;
private TransactionService transactionService;
@@ -643,7 +642,7 @@
LogManager.log(MessageLevel.DETAIL, LogConstants.CTX_COMMANDLOGGING, message);
}
- ProcessorDataManager getDataTierManager() {
+ public TempTableDataManager getDataTierManager() {
return this.dataTierMgr;
}
@@ -686,7 +685,8 @@
}
//prepared plan cache
- prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration(Policy.LRU, 60*60*8, config.getPreparedPlanCacheMaxCount(), "PreparedCache")); //$NON-NLS-1$
+ CacheConfiguration ppCacheConfig = config.getPreparedPlanCacheConfig();
+ prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN, ppCacheConfig);
prepPlanCache.setBufferManager(this.bufferManager);
this.processWorkerPool = new ThreadReuseExecutor(DQPConfiguration.PROCESS_PLAN_QUEUE_NAME, config.getMaxThreads());
@@ -898,4 +898,8 @@
return maxActivePlans;
}
+ SessionAwareCache<PreparedPlan> getPrepPlanCache() {
+ return prepPlanCache;
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,18 +24,24 @@
import java.util.List;
+import org.teiid.cache.Cachable;
+import org.teiid.cache.Cache;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.util.CommandContext;
-public class PreparedPlan{
+public class PreparedPlan implements Cachable {
private ProcessorPlan plan;
private Command command;
private List<Reference> refs;
private AnalysisRecord analysisRecord;
+ private AccessInfo accessInfo = new AccessInfo();
+
/**
* Return the ProcessorPlan.
*/
@@ -66,9 +72,11 @@
/**
* Set the ProcessorPlan.
+ * @param context
*/
- public void setPlan(ProcessorPlan planValue){
+ public void setPlan(ProcessorPlan planValue, CommandContext context){
plan = planValue;
+ this.accessInfo.populate(planValue, context);
}
/**
@@ -92,4 +100,19 @@
refs = refsValue;
}
+ @Override
+ public AccessInfo getAccessInfo() {
+ return accessInfo;
+ }
+
+ @Override
+ public boolean prepare(Cache cache, BufferManager bufferManager) {
+ return true; //no remotable actions
+ }
+
+ @Override
+ public boolean restore(Cache cache, BufferManager bufferManager) {
+ return true; //no remotable actions
+ }
+
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedStatementRequest.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -139,7 +139,7 @@
if (!this.addedLimit) { //TODO: this is a little problematic
prepPlan.setCommand(this.userCommand);
// Defect 13751: Clone the plan in its current state (i.e. before processing) so that it can be used for later queries
- prepPlan.setPlan(processPlan.clone());
+ prepPlan.setPlan(processPlan.clone(), this.context);
prepPlan.setAnalysisRecord(analysisRecord);
Determinism determinismLevel = this.context.getDeterminismLevel();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/QueryProcessorFactoryImpl.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -88,7 +88,7 @@
AnalysisRecord record = new AnalysisRecord(false, false);
ProcessorPlan plan = QueryOptimizer.optimizePlan(newCommand, metadata, idGenerator, finder, record, copy);
pp = new PreparedPlan();
- pp.setPlan(plan);
+ pp.setPlan(plan, copy);
pp.setReferences(references);
pp.setAnalysisRecord(record);
pp.setCommand(newCommand);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,7 +24,6 @@
import java.sql.Connection;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -110,7 +109,7 @@
private final class ViewDefinitionMetadataWrapper extends
BasicQueryMetadataWrapper {
- private Map<List<String>, QueryNode> qnodes = new HashMap<List<String>, QueryNode>();
+ private Map<Object, QueryNode> qnodes = new HashMap<Object, QueryNode>();
private ViewDefinitionMetadataWrapper(
QueryMetadataInterface actualMetadata) {
@@ -125,9 +124,8 @@
String schema = getName(getModelID(groupID));
String viewName = getName(groupID);
- List<String> key = Arrays.asList(schema, viewName);
- QueryNode cached = qnodes.get(key);
+ QueryNode cached = qnodes.get(groupID);
if (cached != null) {
return cached;
}
@@ -135,14 +133,14 @@
//TODO: could just consider moving up when the context is created
throw new AssertionError("Should not attempt to resolve a view before the context has been set."); //$NON-NLS-1$
}
- ViewDefinition vd = metadataProvider.getViewDefinition(getName(getModelID(groupID)), getName(groupID), context);
+ ViewDefinition vd = metadataProvider.getViewDefinition(schema, viewName, context);
if (vd != null) {
result = new QueryNode(DataTypeManager.getCanonicalString(vd.getSql()));
if (vd.getScope() == MetadataProvider.Scope.USER) {
result.setUser(context.getUserName());
}
}
- qnodes.put(key, result);
+ qnodes.put(groupID, result);
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -480,7 +480,7 @@
CachedResults cr = new CachedResults();
cr.setCommand(originalCommand);
cr.setAnalysisRecord(analysisRecord);
- cr.setResults(resultsBuffer);
+ cr.setResults(resultsBuffer, processor.getProcessorPlan());
if (originalCommand.getCacheHint() != null) {
LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Using cache hint", originalCommand.getCacheHint()); //$NON-NLS-1$
resultsBuffer.setPrefersMemory(originalCommand.getCacheHint().getPrefersMemory());
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -61,6 +61,8 @@
private Cache tupleBatchCache;
private int maxSize = DEFAULT_MAX_SIZE_TOTAL;
+ private long modTime;
+ private Type type;
private AtomicInteger cacheHit = new AtomicInteger();
private AtomicInteger totalRequests = new AtomicInteger();
@@ -95,6 +97,8 @@
this.tupleBatchCache = this.distributedCache;
}
}
+ this.modTime = config.getMaxStaleness()*1000;
+ this.type = type;
}
public T get(CacheID id){
@@ -115,7 +119,7 @@
result = distributedCache.get(id);
}
- if (result != null && result instanceof Cachable) {
+ if (result instanceof Cachable) {
Cachable c = (Cachable)result;
if (!c.restore(this.tupleBatchCache, this.bufferManager)) {
result = null;
@@ -124,6 +128,19 @@
}
if (result != null) {
+ if (result instanceof Cachable) {
+ Cachable c = (Cachable)result;
+ AccessInfo info = c.getAccessInfo();
+ if (info != null && !info.validate(type == Type.RESULTSET, modTime)) {
+ LogManager.logTrace(LogConstants.CTX_DQP, "Invalidating cache entry", id); //$NON-NLS-1$
+ if (id.getSessionId() == null) {
+ this.distributedCache.remove(id);
+ } else {
+ this.localCache.remove(id);
+ }
+ return null;
+ }
+ }
LogManager.logTrace(LogConstants.CTX_DQP, "Cache hit for", id); //$NON-NLS-1$
cacheHit.getAndIncrement();
} else {
@@ -307,4 +324,8 @@
public void setBufferManager(BufferManager bufferManager) {
this.bufferManager = bufferManager;
}
+
+ public void setModTime(long modTime) {
+ this.modTime = modTime;
+ }
}
Added: trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/events/EventDistributor.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/events/EventDistributor.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.events;
+
+import java.util.List;
+
+public interface EventDistributor {
+ void updateMatViewRow(String vdbName, int vdbVersion, String matViewFqn, List<?> tuple, boolean delete);
+ void schemaModification(String vdbName, int vdbVersion, String fqn);
+ void dataModification(String vdbName, int vdbVersion, String tableFqn);
+}
Property changes on: trunk/engine/src/main/java/org/teiid/events/EventDistributor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataID.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -48,7 +48,7 @@
private static final long serialVersionUID = -1879211827339120135L;
private static final int LOCAL_CACHE_SIZE = 8;
- static class TableData {
+ public static class TableData {
Collection<TempMetadataID> accessPatterns;
List<TempMetadataID> elements;
int cardinality = QueryMetadataInterface.UNKNOWN_CARDINALITY;
@@ -58,6 +58,15 @@
CacheHint cacheHint;
List<List<TempMetadataID>> keys;
List<List<TempMetadataID>> indexes;
+ long lastModified;
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public void setLastModified(long lastModified) {
+ this.lastModified = lastModified;
+ }
}
private static TableData DUMMY_DATA = new TableData();
@@ -336,7 +345,7 @@
this.getTableData().keys.add(key);
}
- private TableData getTableData() {
+ public TableData getTableData() {
if (data == null) {
return DUMMY_DATA;
}
@@ -373,5 +382,5 @@
}
return this.name;
}
-
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataStore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -43,7 +43,8 @@
*/
public class TempMetadataStore implements Serializable {
- // UPPER CASE TEMP GROUP NAME --> TempMetadataID for group
+ private static final long serialVersionUID = 4055072385672022478L;
+ // UPPER CASE TEMP GROUP NAME --> TempMetadataID for group
private Map<String, TempMetadataID> tempGroups;
/**
@@ -216,7 +217,7 @@
* @return Metadata ID or null if not found
*/
public List<TempMetadataID> getTempElementElementIDs(String tempGroup) {
- TempMetadataID groupID = tempGroups.get(tempGroup.toUpperCase());
+ TempMetadataID groupID = getTempGroupID(tempGroup);
if(groupID != null) {
return groupID.getElements();
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/QueryOptimizer.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -36,6 +36,7 @@
import org.teiid.core.id.IDGenerator;
import org.teiid.core.id.IntegerIDFactory;
import org.teiid.dqp.internal.process.PreparedPlan;
+import org.teiid.metadata.Table;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -116,14 +117,18 @@
PreparedPlan pp = context.getPlan(fullName);
if (pp == null) {
Determinism determinismLevel = context.resetDeterminismLevel();
- ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, context);
+ CommandContext clone = context.clone();
+ ProcessorPlan plan = planProcedure(command, metadata, idGenerator, capFinder, analysisRecord, clone);
//note that this is not a full prepared plan. It is not usable by user queries.
pp = new PreparedPlan();
- pp.setPlan(plan);
+ pp.setPlan(plan, clone);
context.putPlan(fullName, pp, context.getDeterminismLevel());
context.setDeterminismLevel(determinismLevel);
}
result = pp.getPlan().clone();
+ for (Table t : pp.getAccessInfo().getViewsAccessed()) {
+ context.accessedView(t);
+ }
}
// propagate procedure parameters to the plan to allow runtime type checking
ProcedureContainer container = (ProcedureContainer)cupc.getUserCommand();
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/RelationalPlanner.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -33,8 +33,6 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
-import org.teiid.api.exception.query.QueryResolverException;
-import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.client.plan.Annotation;
import org.teiid.client.plan.Annotation.Priority;
import org.teiid.common.buffer.LobManager;
@@ -43,13 +41,13 @@
import org.teiid.core.id.IDGenerator;
import org.teiid.dqp.internal.process.Request;
import org.teiid.language.SQLConstants;
+import org.teiid.metadata.Table;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TempMetadataID;
-import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.optimizer.QueryOptimizer;
import org.teiid.query.optimizer.TriggerActionPlanner;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -1089,9 +1087,13 @@
CacheHint hint = null;
boolean isImplicitGlobal = matMetadataId == null;
if (isImplicitGlobal) {
- matTableName = MAT_PREFIX + metadata.getFullName(metadataID);
- matMetadataId = getGlobalTempTableMetadataId(virtualGroup, matTableName, context, metadata, analysisRecord);
- hint = ((TempMetadataID)matMetadataId).getCacheHint();
+ TempMetadataID tid = context.getGlobalTableStore().getGlobalTempTableMetadataId(metadataID, metadata);
+ matTableName = tid.getID();
+ hint = tid.getCacheHint();
+ if (hint != null) {
+ recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", virtualGroup, matTableName, tid); //$NON-NLS-1$
+ }
+ matMetadataId = tid;
} else {
matTableName = metadata.getFullName(matMetadataId);
}
@@ -1111,7 +1113,10 @@
}
} else {
// Not a materialized view - query the primary transformation
- qnode = metadata.getVirtualPlan(metadataID);
+ qnode = metadata.getVirtualPlan(metadataID);
+ if (metadataID instanceof Table) {
+ this.context.accessedView((Table)metadataID);
+ }
}
Command result = (Command)QueryResolver.resolveView(virtualGroup, qnode, cacheString, metadata).getCommand().clone();
@@ -1128,59 +1133,6 @@
return query;
}
- public static Object getGlobalTempTableMetadataId(GroupSymbol table, String matTableName, CommandContext context, QueryMetadataInterface metadata, AnalysisRecord analysisRecord)
- throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
- TempMetadataStore store = context.getGlobalTableStore().getMetadataStore();
- TempMetadataID id = store.getTempGroupID(matTableName);
- //define the table preserving the primary key
- if (id == null) {
- synchronized (table.getMetadataID()) {
- id = store.getTempGroupID(matTableName);
- if (id == null) {
- //this is really just temporary and will be replaced by the real table
- id = store.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(table, metadata), false, true);
- id.setQueryNode(metadata.getVirtualPlan(table.getMetadataID()));
- id.setCardinality(metadata.getCardinality(table.getMetadataID()));
-
- Object pk = metadata.getPrimaryKey(table.getMetadataID());
- if (pk != null) {
- ArrayList<TempMetadataID> primaryKey = resolveIndex(metadata, id, pk);
- id.setPrimaryKey(primaryKey);
- }
- Collection keys = metadata.getUniqueKeysInGroup(table.getMetadataID());
- for (Object key : keys) {
- id.addUniqueKey(resolveIndex(metadata, id, key));
- }
- Collection indexes = metadata.getIndexesInGroup(table.getMetadataID());
- for (Object index : indexes) {
- id.addIndex(resolveIndex(metadata, id, index));
- }
- Command c = (Command)QueryResolver.resolveView(table, metadata.getVirtualPlan(table.getMetadataID()), SQLConstants.Reserved.SELECT, metadata).getCommand().clone();
- CacheHint hint = c.getCacheHint();
- if (hint != null) {
- recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint()); //$NON-NLS-1$
- }
- id.setCacheHint(hint);
- }
- }
- } else if (id.getCacheHint() != null) {
- recordAnnotation(analysisRecord, Annotation.MATERIALIZED_VIEW, Priority.LOW, "SimpleQueryResolver.cache_hint_used", table, matTableName, id.getCacheHint()); //$NON-NLS-1$
- }
- return id;
- }
-
- private static ArrayList<TempMetadataID> resolveIndex(
- QueryMetadataInterface metadata, TempMetadataID id, Object pk)
- throws TeiidComponentException, QueryMetadataException {
- List cols = metadata.getElementIDsInKey(pk);
- ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
- for (Object coldId : cols) {
- int pos = metadata.getPosition(coldId) - 1;
- primaryKey.add(id.getElements().get(pos));
- }
- return primaryKey;
- }
-
public static boolean isNoCacheGroup(QueryMetadataInterface metadata,
Object metadataID,
Option option) throws QueryMetadataException,
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -299,7 +299,7 @@
//NOTE: we could tap into the relationalplanner at a lower level to get this in a plan node form,
//the major benefit would be to reuse the dependent join planning logic if possible.
if (analysisRecord != null && analysisRecord.recordDebug()) {
- analysisRecord.println("Attempting to plan " + crit + " as a mege join"); //$NON-NLS-1$ //$NON-NLS-2$
+ analysisRecord.println("Attempting to plan " + crit + " as a merge join"); //$NON-NLS-1$ //$NON-NLS-2$
}
RelationalPlan subPlan = (RelationalPlan)QueryOptimizer.optimizePlan(plannedResult.query, metadata, idGenerator, capFinder, analysisRecord, context);
Number planCardinality = subPlan.getRootNode().getEstimateNodeCardinality();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/BatchedUpdatePlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -33,6 +33,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.util.CommandContext;
@@ -237,5 +238,12 @@
}
return true;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ for (int i = 0; i < getPlanCount(); i++) {
+ updatePlans[i].getAccessedGroups(groups);
+ }
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/ProcessorPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -37,6 +37,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.processor.BatchCollector.BatchProducer;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
@@ -176,4 +177,6 @@
return false;
}
+ public abstract void getAccessedGroups(List<GroupSymbol> groups);
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/CreateCursorResultSetInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,6 +26,7 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
import java.util.Map;
import org.teiid.client.plan.PlanNode;
@@ -102,5 +103,10 @@
public ProcessorPlan getCommand() { //Defect 13291 - added method to support changes to ProcedurePlan
return plan;
}
+
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ plans.add(this.plan);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ForEachRowPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -39,6 +39,7 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.util.CommandContext;
@@ -161,5 +162,11 @@
public boolean requiresTransaction(boolean transactionalReads) {
return true;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ this.queryPlan.getAccessedGroups(groups);
+ this.rowProcedure.getAccessedGroups(groups);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/IfInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -24,11 +24,14 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
+
import org.teiid.client.plan.PlanNode;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.logging.LogManager;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Criteria;
@@ -138,4 +141,12 @@
return props;
}
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ ifProgram.getChildPlans(plans);
+ if (elseProgram != null) {
+ elseProgram.getChildPlans(plans);
+ }
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -107,5 +107,11 @@
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
procEnv.removeResults(rsName);
}
+
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ super.getChildPlans(plans);
+ this.loopProgram.getChildPlans(plans);
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -65,6 +65,7 @@
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.ElementSymbol;
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.sql.util.VariableContext;
import org.teiid.query.tempdata.TempTableStore;
@@ -713,4 +714,20 @@
return requiresTransaction || transactionalReads;
}
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ ArrayList<ProcessorPlan> plans = new ArrayList<ProcessorPlan>();
+ this.originalProgram.getChildPlans(plans);
+ LinkedList<GroupSymbol> tempGroups = new LinkedList<GroupSymbol>();
+ for (ProcessorPlan processorPlan : plans) {
+ processorPlan.getAccessedGroups(tempGroups);
+ }
+ for (GroupSymbol groupSymbol : tempGroups) {
+ if (groupSymbol.isTempTable() && !groupSymbol.isGlobalTable()) {
+ continue;
+ }
+ groups.add(groupSymbol);
+ }
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,6 +26,7 @@
import java.util.List;
import org.teiid.client.plan.PlanNode;
+import org.teiid.query.processor.ProcessorPlan;
/**
@@ -212,5 +213,11 @@
buffer.append(counterStr + line + "\n"); //$NON-NLS-1$
}
+
+ void getChildPlans(List<ProcessorPlan> plans) {
+ for (ProgramInstruction instruction : programInstructions) {
+ instruction.getChildPlans(plans);
+ }
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProgramInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -59,8 +59,7 @@
* @return List of ProcessorPlan
* @since 4.2
*/
- public List<ProcessorPlan> getChildPlans() {
- return null;
+ public void getChildPlans(List<ProcessorPlan> plans) {
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -26,9 +26,12 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.util.List;
+
import org.teiid.client.plan.PlanNode;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Criteria;
@@ -89,4 +92,9 @@
public void postInstruction(ProcedurePlan procEnv) throws TeiidComponentException {
}
+ @Override
+ public void getChildPlans(List<ProcessorPlan> plans) {
+ whileProgram.getChildPlans(plans);
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -41,10 +41,13 @@
import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.processor.relational.ProjectIntoNode.Mode;
import org.teiid.query.sql.LanguageObject;
+import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.WithQueryCommand;
+import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.visitor.GroupCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
import org.teiid.query.util.CommandContext;
@@ -287,7 +290,29 @@
return false;
}
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ getAccessedGroups(groups, this.root);
+ }
+ void getAccessedGroups(List<GroupSymbol> groups, RelationalNode node) {
+ if (node instanceof AccessNode) {
+ Command c = ((AccessNode)node).getCommand();
+ if (c instanceof QueryCommand) {
+ QueryCommand qc = (QueryCommand)c;
+ groups.addAll(GroupCollectorVisitor.getGroupsIgnoreInlineViews(qc, true));
+ }
+ } else if (node instanceof PlanExecutionNode) {
+ PlanExecutionNode pen = (PlanExecutionNode)node;
+ pen.getProcessorPlan().getAccessedGroups(groups);
+ }
+ for (RelationalNode child : node.getChildren()) {
+ if (child != null) {
+ getAccessedGroups(groups, child);
+ }
+ }
+ }
+
@Override
public TupleBuffer getFinalBuffer() throws BlockedException, TeiidComponentException, TeiidProcessingException {
return root.getFinalBuffer();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.xml;
-import static org.teiid.query.analysis.AnalysisRecord.PROP_OUTPUT_COLS;
+import static org.teiid.query.analysis.AnalysisRecord.*;
import java.io.IOException;
import java.io.InputStream;
@@ -478,4 +478,9 @@
public Program getOriginalProgram() {
return this.originalProgram;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ //TODO: add support
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTable.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -482,6 +482,7 @@
}
public int truncate() {
+ this.tid.getTableData().setLastModified(System.currentTimeMillis());
return tree.truncate();
}
@@ -512,6 +513,7 @@
UpdateProcessor up = new InsertUpdateProcessor(tuples, rowId != null, shouldProject?indexes:null);
int updateCount = up.process();
tid.setCardinality(tree.getRowCount());
+ tid.getTableData().setLastModified(System.currentTimeMillis());
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -577,6 +579,9 @@
};
int updateCount = up.process();
+ if (updateCount > 0) {
+ tid.getTableData().setLastModified(System.currentTimeMillis());
+ }
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -609,6 +614,9 @@
};
int updateCount = up.process();
tid.setCardinality(tree.getRowCount());
+ if (updateCount > 0) {
+ tid.getTableData().setLastModified(System.currentTimeMillis());
+ }
return CollectionTupleSource.createUpdateCountTupleSource(updateCount);
}
@@ -638,6 +646,7 @@
index.tree.remove(tuple);
}
}
+ tid.getTableData().setLastModified(System.currentTimeMillis());
return result;
}
List<?> result = tree.insert(tuple, InsertMode.UPDATE, -1);
@@ -647,6 +656,7 @@
index.tree.insert(tuple, InsertMode.UPDATE, -1);
}
}
+ tid.getTableData().setLastModified(System.currentTimeMillis());
return result;
} finally {
lock.writeLock().unlock();
@@ -699,5 +709,9 @@
STree getTree() {
return tree;
}
+
+ public TempMetadataID getMetadataId() {
+ return tid;
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -54,12 +54,12 @@
import org.teiid.dqp.internal.process.CachedResults;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
+import org.teiid.events.EventDistributor;
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -144,6 +144,7 @@
private Cache<MatTableKey, MatTableEntry> tables;
private SessionAwareCache<CachedResults> distributedCache;
+ private EventDistributor eventDistributor;
public TempTableDataManager(ProcessorDataManager processorDataManager, BufferManager bufferManager,
Executor executor, SessionAwareCache<CachedResults> cache, SessionAwareCache<CachedResults> distibutedCache, CacheFactory cacheFactory){
@@ -158,6 +159,10 @@
}
}
+ public void setEventDistributor(EventDistributor eventDistributor) {
+ this.eventDistributor = eventDistributor;
+ }
+
public TupleSource registerRequest(
CommandContext context,
Command command,
@@ -283,7 +288,7 @@
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
CachedResults cr = new CachedResults();
- cr.setResults(tb);
+ cr.setResults(tb, qp.getProcessorPlan());
cr.setHint(hint);
if (hint != null && hint.getDeterminism() != null) {
LogManager.logTrace(LogConstants.CTX_DQP, new Object[] { "Cache hint modified the query determinism from ",determinismLevel, " to ", hint.getDeterminism() }); //$NON-NLS-1$ //$NON-NLS-2$
@@ -303,8 +308,9 @@
TempTableStore globalStore = context.getGlobalTableStore();
if (StringUtil.endsWithIgnoreCase(proc.getProcedureCallableName(), REFRESHMATVIEW)) {
Object groupID = validateMatView(metadata, proc);
+ Object matTableId = context.getGlobalTableStore().getGlobalTempTableMetadataId(groupID, metadata);
String matViewName = metadata.getFullName(groupID);
- String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase();
+ String matTableName = metadata.getFullName(matTableId);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$
MatTableInfo info = globalStore.getMatTableInfo(matTableName);
boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(1).getExpression()).getValue());
@@ -315,9 +321,6 @@
if (oldState == MatState.LOADING) {
return CollectionTupleSource.createUpdateCountTupleSource(-1);
}
- GroupSymbol group = new GroupSymbol(matViewName);
- group.setMetadataID(groupID);
- Object matTableId = RelationalPlanner.getGlobalTempTableMetadataId(group, matTableName, context, metadata, AnalysisRecord.createNonRecordingRecord());
GroupSymbol matTable = new GroupSymbol(matTableName);
matTable.setMetadataID(matTableId);
int rowCount = loadGlobalTable(context, matTable, matTableName, globalStore, info, null);
@@ -349,20 +352,28 @@
QueryProcessor qp = context.getQueryProcessorFactory().createQueryProcessor(queryString, matViewName.toUpperCase(), context, key.getValue());
qp.setNonBlocking(true);
TupleSource ts = new BatchCollector.BatchProducerTupleSource(qp);
- tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
List<?> tuple = ts.nextTuple();
boolean delete = false;
if (tuple == null) {
delete = true;
tuple = Arrays.asList(key.getValue());
}
- List<?> result = tempTable.updateTuple(tuple, delete);
- //TODO: maintain a table log and distribute the events
+ List<?> result = updateMatViewRow(globalStore, matTableName, tuple, delete);
+ if (result != null && eventDistributor != null) {
+ this.eventDistributor.updateMatViewRow(context.getVdbName(), context.getVdbVersion(), matTableName, tuple, delete);
+ }
return CollectionTupleSource.createUpdateCountTupleSource(result != null ? 1 : 0);
}
return null;
}
+ public List<?> updateMatViewRow(TempTableStore globalStore,
+ String matTableName, List<?> tuple, boolean delete)
+ throws QueryProcessingException, TeiidComponentException {
+ TempTable tempTable = globalStore.getOrCreateTempTable(matTableName, new Query(), bufferManager, false);
+ return tempTable.updateTuple(tuple, delete);
+ }
+
private Object validateMatView(QueryMetadataInterface metadata,
StoredProcedure proc) throws TeiidComponentException,
TeiidProcessingException {
@@ -508,7 +519,7 @@
CachedResults cr = new CachedResults();
BatchCollector bc = qp.createBatchCollector();
TupleBuffer tb = bc.collectTuples();
- cr.setResults(tb);
+ cr.setResults(tb, qp.getProcessorPlan());
touchTable(context, fullName, true);
this.distributedCache.put(cid, Determinism.VDB_DETERMINISTIC, cr, info.getTtl());
ts = tb.createIndexedTupleSource();
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,19 +23,29 @@
package org.teiid.query.tempdata;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryProcessingException;
+import org.teiid.api.exception.query.QueryResolverException;
+import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
+import org.teiid.language.SQLConstants;
import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TempMetadataStore;
+import org.teiid.query.optimizer.relational.RelationalPlanner;
+import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.resolver.command.TempTableResolver;
+import org.teiid.query.resolver.util.ResolverUtil;
+import org.teiid.query.sql.lang.CacheHint;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.Insert;
@@ -235,5 +245,55 @@
public Set<String> getAllTempTables() {
return new HashSet<String>(this.groupToTupleSourceID.keySet());
}
+
+ public TempMetadataID getGlobalTempTableMetadataId(Object viewId, QueryMetadataInterface metadata)
+ throws QueryMetadataException, TeiidComponentException, QueryResolverException, QueryValidatorException {
+ String matViewName = metadata.getFullName(viewId);
+ String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase();
+ GroupSymbol group = new GroupSymbol(matViewName);
+ group.setMetadataID(viewId);
+ TempMetadataID id = tempMetadataStore.getTempGroupID(matTableName);
+ //define the table preserving the key/index information and ensure that only a single instance exists
+ if (id == null) {
+ synchronized (viewId) {
+ id = tempMetadataStore.getTempGroupID(matTableName);
+ if (id == null) {
+ id = tempMetadataStore.addTempGroup(matTableName, ResolverUtil.resolveElementsInGroup(group, metadata), false, true);
+ id.setQueryNode(metadata.getVirtualPlan(viewId));
+ id.setCardinality(metadata.getCardinality(viewId));
+
+ Object pk = metadata.getPrimaryKey(viewId);
+ if (pk != null) {
+ ArrayList<TempMetadataID> primaryKey = resolveIndex(metadata, id, pk);
+ id.setPrimaryKey(primaryKey);
+ }
+ Collection keys = metadata.getUniqueKeysInGroup(viewId);
+ for (Object key : keys) {
+ id.addUniqueKey(resolveIndex(metadata, id, key));
+ }
+ Collection indexes = metadata.getIndexesInGroup(viewId);
+ for (Object index : indexes) {
+ id.addIndex(resolveIndex(metadata, id, index));
+ }
+ Command c = (Command)QueryResolver.resolveView(group, metadata.getVirtualPlan(viewId), SQLConstants.Reserved.SELECT, metadata).getCommand().clone();
+ CacheHint hint = c.getCacheHint();
+ id.setCacheHint(hint);
+ }
+ }
+ }
+ return id;
+ }
+
+ static ArrayList<TempMetadataID> resolveIndex(
+ QueryMetadataInterface metadata, TempMetadataID id, Object pk)
+ throws TeiidComponentException, QueryMetadataException {
+ List cols = metadata.getElementIDsInKey(pk);
+ ArrayList<TempMetadataID> primaryKey = new ArrayList<TempMetadataID>(cols.size());
+ for (Object coldId : cols) {
+ int pos = metadata.getPosition(coldId) - 1;
+ primaryKey.add(id.getElements().get(pos));
+ }
+ return primaryKey;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,6 +23,8 @@
package org.teiid.query.util;
import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.Properties;
import java.util.Random;
@@ -38,6 +40,7 @@
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
+import org.teiid.metadata.Table;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.SecurityFunctionEvaluator;
@@ -122,6 +125,7 @@
private TempTableStore tempTableStore;
private LinkedList<String> recursionStack;
private boolean nonBlocking;
+ private HashSet<Table> viewsAccessed;
/**
* Construct a new context.
@@ -533,4 +537,18 @@
this.globalState.subject = subject;
}
+ public void accessedView(Table id) {
+ if (this.viewsAccessed == null) {
+ this.viewsAccessed = new HashSet<Table>();
+ }
+ this.viewsAccessed.add(id);
+ }
+
+ public Set<Table> getViewsAccessed() {
+ if (this.viewsAccessed == null) {
+ return Collections.emptySet();
+ }
+ return viewsAccessed;
+ }
+
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-04-12 19:35:57 UTC (rev 3083)
@@ -894,7 +894,7 @@
datasource_not_found=Data Source {0} not accessible.
RequestWorkItem.cache_nondeterministic=Caching command "{0}" at a session level, but less deterministic functions were evaluated.
-not_found_cache=Results not found in cache
+not_found_cache=Failed to restore results
failed_to_cache=Failed to store the result set contents to disk.
failed_to_unwrap_connection=Failed to unwrap the source connection.
connection_factory_not_found=Failed to find the Connection Factory with JNDI name {0}. Please check the name or deploy the Connection Factory with specified name.
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -23,10 +23,6 @@
import static org.junit.Assert.*;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
import java.util.Arrays;
import java.util.List;
@@ -37,13 +33,19 @@
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.TestTupleBuffer.FakeBatchManager;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.UnitTestUtil;
import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.metadata.Table;
+import org.teiid.query.processor.FakeProcessorPlan;
+import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.unittest.FakeMetadataFactory;
+import org.teiid.query.unittest.RealMetadataFactory;
+import org.teiid.query.util.CommandContext;
-
+@SuppressWarnings({"nls", "unchecked"})
public class TestCachedResults {
-
@Test
public void testCaching() throws Exception {
@@ -70,10 +72,15 @@
BufferManager bm = fbs.getBufferManager();
CachedResults results = new CachedResults();
- results.setResults(tb);
+ ProcessorPlan plan = new FakeProcessorPlan(0);
+ CommandContext cc = new CommandContext();
+ Table t = RealMetadataFactory.exampleBQT().getGroupID("bqt1.smalla");
+ cc.accessedView(t);
+ plan.setContext(cc);
+ results.setResults(tb, plan);
results.setCommand(new Query());
Cache cache = new DefaultCache("dummy"); //$NON-NLS-1$
-
+ long ts = results.getAccessInfo().getCreationTime();
// simulate the jboss-cache remote transport, where the batches are remotely looked up
// in cache
for (int row=1; row<=tb.getRowCount();row+=4) {
@@ -82,14 +89,9 @@
results.prepare(cache, bm);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(results);
- oos.close();
+ CachedResults cachedResults = UnitTestUtil.helpSerialize(results);
- ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
- CachedResults cachedResults = (CachedResults)ois.readObject();
- ois.close();
+ FakeMetadataFactory.buildWorkContext(RealMetadataFactory.exampleBQT());
cachedResults.restore(cache, bm);
@@ -103,5 +105,6 @@
assertArrayEquals(tb.getBatch(1).getAllTuples(), cachedTb.getBatch(1).getAllTuples());
assertArrayEquals(tb.getBatch(9).getAllTuples(), cachedTb.getBatch(9).getAllTuples());
+ assertTrue(ts - cachedResults.getAccessInfo().getCreationTime() <= 5000);
}
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -28,6 +28,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import org.junit.After;
import org.junit.Before;
@@ -39,12 +40,15 @@
import org.teiid.cache.DefaultCacheFactory;
import org.teiid.client.RequestMessage;
import org.teiid.client.ResultsMessage;
+import org.teiid.client.RequestMessage.StatementType;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.datamgr.FakeTransactionService;
import org.teiid.dqp.internal.process.AbstractWorkItem.ThreadState;
import org.teiid.dqp.service.AutoGenDataService;
-import org.teiid.dqp.service.FakeBufferService;
+import org.teiid.dqp.service.BufferService;
import org.teiid.metadata.MetadataProvider;
import org.teiid.query.optimizer.TestOptimizer;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
@@ -70,7 +74,13 @@
Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
core = new DQPCore();
- core.setBufferService(new FakeBufferService());
+ core.setBufferService(new BufferService() {
+
+ @Override
+ public BufferManager getBufferManager() {
+ return BufferManagerFactory.createBufferManager();
+ }
+ });
core.setCacheFactory(new DefaultCacheFactory());
core.setTransactionService(new FakeTransactionService());
@@ -78,6 +88,7 @@
config.setMaxActivePlans(1);
config.setUserRequestSourceConcurrency(2);
core.start(config);
+ core.getPrepPlanCache().setModTime(1);
}
@After public void tearDown() throws Exception {
@@ -239,13 +250,13 @@
DQPWorkContext.getWorkContext().getSession().setUserName(userName);
((BufferManagerImpl)core.getBufferManager()).setProcessorBatchSize(2);
Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- ResultsMessage rm = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
RequestWorkItem item = core.getRequestWorkItem(DQPWorkContext.getWorkContext().getRequestID(reqMsg.getExecutionId()));
message = core.processCursorRequest(reqMsg.getExecutionId(), 3, 2);
- rm = message.get(5000, TimeUnit.MILLISECONDS);
+ rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
//ensure that we are idle
@@ -277,7 +288,7 @@
DQPWorkContext.getWorkContext().getSession().setUserName(userName);
((BufferManagerImpl)core.getBufferManager()).setProcessorBatchSize(2);
Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- ResultsMessage rm = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage rm = message.get(500000, TimeUnit.MILLISECONDS);
assertNull(rm.getException());
assertEquals(2, rm.getResults().length);
RequestWorkItem item = core.getRequestWorkItem(DQPWorkContext.getWorkContext().getRequestID(reqMsg.getExecutionId()));
@@ -341,6 +352,44 @@
assertEquals("something else", rm.getResults()[0].get(0)); //$NON-NLS-1$
}
+ @Test public void testPreparedPlanInvalidation() throws Exception {
+ String sql = "insert into #temp select * FROM vqt.SmallB"; //$NON-NLS-1$
+ String userName = "1"; //$NON-NLS-1$
+ int sessionid = 1; //$NON-NLS-1$
+ RequestMessage reqMsg = exampleRequestMessage(sql);
+ ResultsMessage rm = execute(userName, sessionid, reqMsg);
+ assertEquals(1, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * from #temp"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setStatementType(StatementType.PREPARED);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * from #temp"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setStatementType(StatementType.PREPARED);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(10, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(1, this.core.getPrepPlanCache().getCacheHitCount());
+
+ Thread.sleep(100);
+
+ sql = "delete from #temp"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(1, rm.getResults().length); //$NON-NLS-1$
+
+ sql = "select * from #temp"; //$NON-NLS-1$
+ reqMsg = exampleRequestMessage(sql);
+ reqMsg.setStatementType(StatementType.PREPARED);
+ rm = execute(userName, sessionid, reqMsg);
+ assertEquals(0, rm.getResults().length); //$NON-NLS-1$
+
+ assertEquals(1, this.core.getPrepPlanCache().getCacheHitCount());
+ }
+
public void helpTestVisibilityFails(String sql) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_OFF);
@@ -356,15 +405,10 @@
private ResultsMessage helpExecute(String sql, String userName, int sessionid, boolean txnAutoWrap) throws Exception {
RequestMessage reqMsg = exampleRequestMessage(sql);
- DQPWorkContext.getWorkContext().getSession().setSessionId(String.valueOf(sessionid));
- DQPWorkContext.getWorkContext().getSession().setUserName(userName);
if (txnAutoWrap) {
reqMsg.setTxnAutoWrapMode(RequestMessage.TXN_WRAP_ON);
}
-
- Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
- assertNotNull(core.getClientState(String.valueOf(sessionid), false));
- ResultsMessage results = message.get(5000, TimeUnit.MILLISECONDS);
+ ResultsMessage results = execute(userName, sessionid, reqMsg);
core.terminateSession(String.valueOf(sessionid));
assertNull(core.getClientState(String.valueOf(sessionid), false));
if (results.getException() != null) {
@@ -372,4 +416,15 @@
}
return results;
}
+
+ private ResultsMessage execute(String userName, int sessionid, RequestMessage reqMsg)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ DQPWorkContext.getWorkContext().getSession().setSessionId(String.valueOf(sessionid));
+ DQPWorkContext.getWorkContext().getSession().setUserName(userName);
+
+ Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
+ assertNotNull(core.getClientState(String.valueOf(sessionid), false));
+ ResultsMessage results = message.get(500000, TimeUnit.MILLISECONDS);
+ return results;
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedPlanCache.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -22,10 +22,7 @@
package org.teiid.dqp.internal.process;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.util.ArrayList;
@@ -40,6 +37,8 @@
import org.teiid.query.processor.relational.ProjectNode;
import org.teiid.query.processor.relational.RelationalPlan;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.util.CommandContext;
public class TestPreparedPlanCache {
@@ -70,7 +69,7 @@
assertNotNull("Unable to get prepared plan from cache", cache.get(id)); //$NON-NLS-1$
}
- @Test public void testget(){
+ @Test public void testGet(){
SessionAwareCache<PreparedPlan> cache = new SessionAwareCache<PreparedPlan>();
helpPutPreparedPlans(cache, token, 0, 10);
helpPutPreparedPlans(cache, token2, 0, 15);
@@ -81,7 +80,7 @@
assertEquals("Error getting plan from cache", new RelationalPlan(new ProjectNode(12)).toString(), pPlan.getPlan().toString()); //$NON-NLS-1$
assertEquals("Error getting command from cache", EXAMPLE_QUERY + 12, pPlan.getCommand().toString()); //$NON-NLS-1$
assertNotNull("Error getting plan description from cache", pPlan.getAnalysisRecord()); //$NON-NLS-1$
- assertEquals("Error gettting reference from cache", "ref12", pPlan.getReferences().get(0)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Error gettting reference from cache", new Reference(1), pPlan.getReferences().get(0)); //$NON-NLS-1$
}
@Test public void testClearAll(){
@@ -152,11 +151,11 @@
PreparedPlan pPlan = new PreparedPlan();
cache.put(id, Determinism.SESSION_DETERMINISTIC, pPlan, null);
pPlan.setCommand(dummy);
- pPlan.setPlan(new RelationalPlan(new ProjectNode(i)));
+ pPlan.setPlan(new RelationalPlan(new ProjectNode(i)), new CommandContext());
AnalysisRecord analysisRecord = new AnalysisRecord(true, false);
pPlan.setAnalysisRecord(analysisRecord);
- ArrayList refs = new ArrayList();
- refs.add("ref"+i); //$NON-NLS-1$
+ ArrayList<Reference> refs = new ArrayList<Reference>();
+ refs.add(new Reference(1));
pPlan.setReferences(refs);
}
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -55,7 +55,7 @@
import org.teiid.query.unittest.FakeMetadataFacade;
import org.teiid.query.unittest.FakeMetadataFactory;
-@SuppressWarnings("nls")
+@SuppressWarnings({"nls", "unchecked"})
public class TestPreparedStatement {
private static final int SESSION_ID = 6;
@@ -148,8 +148,7 @@
Arrays.asList(new Object[] { "a", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
};
- List values = new ArrayList();
- values.add(new Short((short)0));
+ List<?> values = Arrays.asList((short)0);
FakeDataManager dataManager = new FakeDataManager();
TestProcessor.sampleData1(dataManager);
helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false, FakeMetadataFactory.example1VDB());
@@ -166,8 +165,7 @@
Arrays.asList(new Object[] { "foo", new Integer(0), Boolean.FALSE, new Double(2.0) }) //$NON-NLS-1$
};
- List values = new ArrayList();
- values.add(new Short((short)0));
+ List<?> values = Arrays.asList((short)0);
FakeDataManager dataManager = new FakeDataManager();
TestProcessor.sampleData1(dataManager);
helpTestProcessing(preparedSql, values, expected, dataManager, FakeMetadataFactory.example1Cached(), false, true, FakeMetadataFactory.example1VDB());
@@ -256,8 +254,7 @@
// Create query
String preparedSql = "SELECT pm1.g1.e1, e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1 WHERE pm1.g1.e1=?"; //$NON-NLS-1$
- List values = new ArrayList();
- values.add("a"); //$NON-NLS-1$
+ List values = Arrays.asList("a"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, new SessionAwareCache<PreparedPlan>());
@@ -291,8 +288,7 @@
String preparedSql = "SELECT X.e1 FROM (SELECT pm1.g2.e1 FROM pm1.g2 WHERE pm1.g2.e1 = ?) as X"; //$NON-NLS-1$
//Create Request
- List values = new ArrayList();
- values.add("d"); //$NON-NLS-1$
+ List values = Arrays.asList("d"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, new SessionAwareCache<PreparedPlan>());
@@ -305,8 +301,7 @@
//wrong type
try{
- List values = new ArrayList();
- values.add("x"); //$NON-NLS-1$
+ List values = Arrays.asList("x"); //$NON-NLS-1$
//Create plan
helpGetProcessorPlan(preparedSql, values, prepCache, SESSION_ID);
Modified: trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/optimizer/relational/TestMaterialization.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -153,7 +153,7 @@
CommandContext cc = new CommandContext();
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
ProcessorPlan plan = TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup2.x FROM #MAT_MatView.VGroup2"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP2.x FROM #MAT_MATVIEW.VGROUP2"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 1, annotations.size()); //$NON-NLS-1$
@@ -171,7 +171,7 @@
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
RelationalPlan plan = (RelationalPlan)TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
assertEquals(1f, plan.getRootNode().getEstimateNodeCardinality());
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup3.x, #MAT_MatView.VGroup3.y FROM #MAT_MatView.VGroup3 WHERE #MAT_MatView.VGroup3.x = 'foo'"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP3.x, #MAT_MATVIEW.VGROUP3.y FROM #MAT_MATVIEW.VGROUP3 WHERE #MAT_MATVIEW.VGROUP3.x = 'foo'"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 1, annotations.size()); //$NON-NLS-1$
@@ -188,7 +188,7 @@
CommandContext cc = new CommandContext();
cc.setGlobalTableStore(new TempTableStore("SYSTEM"));
ProcessorPlan plan = TestOptimizer.getPlan(command, metadata, getGenericFinder(), analysis, true, cc);
- TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MatView.VGroup4.x FROM #MAT_MatView.VGroup4"}, plan);
+ TestOptimizer.checkAtomicQueries(new String[] {"SELECT #MAT_MATVIEW.VGROUP4.x FROM #MAT_MATVIEW.VGROUP4"}, plan);
Collection<Annotation> annotations = analysis.getAnnotations();
assertNotNull("Expected annotations but got none", annotations); //$NON-NLS-1$
assertEquals("Expected one annotation", 2, annotations.size()); //$NON-NLS-1$
Modified: trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/processor/FakeProcessorPlan.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -32,9 +32,8 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBatch;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.util.CommandContext;
@@ -141,5 +140,9 @@
public List getSchema() {
return this.outputElements;
}
+
+ @Override
+ public void getAccessedGroups(List<GroupSymbol> groups) {
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -97,6 +97,9 @@
session.setUserName("foo"); //$NON-NLS-1$
session.setVdb(vdb);
workContext.getVDB().addAttchment(QueryMetadataInterface.class, metadata);
+ if (metadata instanceof TransformationMetadata) {
+ workContext.getVDB().addAttchment(TransformationMetadata.class, (TransformationMetadata)metadata);
+ }
DQPWorkContext.setWorkContext(workContext);
return workContext;
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-04-12 19:35:57 UTC (rev 3083)
@@ -67,6 +67,7 @@
import org.teiid.adminapi.impl.DQPManagement;
import org.teiid.adminapi.impl.RequestMetadata;
import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
import org.teiid.adminapi.jboss.AdminProvider;
import org.teiid.cache.CacheFactory;
@@ -79,6 +80,7 @@
import org.teiid.client.util.ResultsFuture;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
import org.teiid.deployers.VDBLifeCycleListener;
@@ -92,12 +94,17 @@
import org.teiid.dqp.service.SessionService;
import org.teiid.dqp.service.SessionServiceException;
import org.teiid.dqp.service.TransactionService;
+import org.teiid.events.EventDistributor;
import org.teiid.jboss.IntegrationPlugin;
import org.teiid.logging.Log4jListener;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
+import org.teiid.metadata.Table;
import org.teiid.net.TeiidURL;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.tempdata.TempTableStore;
import org.teiid.security.SecurityHelper;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -109,7 +116,7 @@
@ManagementObject(name="RuntimeEngineDeployer", isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
-public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry {
+public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry, EventDistributor {
private static final long serialVersionUID = -4676205340262775388L;
private transient SocketConfiguration jdbcSocketConfiguration;
@@ -130,6 +137,9 @@
private transient ProfileService profileService;
private transient String jndiName;
+
+ private String eventDistributorName;
+ private transient EventDistributor eventDistributor;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -150,6 +160,17 @@
public void start() {
dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL));
+ if (this.eventDistributorName != null) {
+ try {
+ InitialContext ic = new InitialContext();
+ this.eventDistributor = (EventDistributor) ic.lookup(this.eventDistributorName);
+ } catch (NamingException ne) {
+ //log at a detail level since we may not be in the all profile
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
+ }
+ }
+ this.dqpCore.start(this);
+ this.dqpCore.getDataTierManager().setEventDistributor(this.eventDistributor);
// create the necessary services
createClientServices();
@@ -285,9 +306,6 @@
}
private void createClientServices() {
-
- this.dqpCore.start(this);
-
this.logon = new LogonImpl(this.sessionService, "teiid-cluster"); //$NON-NLS-1$
if (profileService != null) {
this.admin = AdminProvider.getLocal(profileService, vdbStatusChecker);
@@ -585,7 +603,7 @@
for(int i = 0; i < rows.length; i++) {
List row = rows[i];
- ArrayList newRow = new ArrayList();
+ ArrayList<Object> newRow = new ArrayList<Object>();
for (Object col:row) {
if (col == null) {
newRow.add("null"); //$NON-NLS-1$
@@ -613,4 +631,66 @@
}
return newResults;
}
+
+ public String getEventDistributorName() {
+ return eventDistributorName;
+ }
+
+ public void setEventDistributorName(String eventDistributorName) {
+ this.eventDistributorName = eventDistributorName;
+ }
+
+ @Override
+ public void updateMatViewRow(String vdbName, int vdbVersion, String matViewFqn, List<?> tuple,
+ boolean delete) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TempTableStore globalStore = vdb.getAttachment(TempTableStore.class);
+ if (globalStore == null) {
+ return;
+ }
+ try {
+ this.dqpCore.getDataTierManager().updateMatViewRow(globalStore, matViewFqn, tuple, delete);
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void dataModification(String vdbName, int vdbVersion, String tableFqn) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ if (tm == null) {
+ return;
+ }
+ try {
+ Table table = tm.getGroupID(tableFqn);
+ table.setLastDataModification(System.currentTimeMillis());
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ public void schemaModification(String vdbName, int vdbVersion, String fqn) {
+ VDBMetaData vdb = this.vdbRepository.getVDB(vdbName, vdbVersion);
+ if (vdb == null) {
+ return;
+ }
+ TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
+ if (tm == null) {
+ return;
+ }
+ try {
+ Table table = tm.getGroupID(fqn);
+ table.setLastModified(System.currentTimeMillis());
+ } catch (TeiidException e) {
+ LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("DQPCore.unable_to_process_event")); //$NON-NLS-1$
+ }
+ }
}
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2011-04-12 19:35:57 UTC (rev 3083)
@@ -46,3 +46,5 @@
distribute_failed=Deploy of the archive failed {0}
template_not_found=Template not found for {0}
admin_executing=JOPR admin {0} is executing command {1}
+
+DQPCore.unable_to_process_event=Unable to process event.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-11 15:36:29 UTC (rev 3082)
+++ trunk/pom.xml 2011-04-12 19:35:57 UTC (rev 3083)
@@ -360,12 +360,13 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.10.GA</version>
+ <version>2.6.15.GA</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>3.1.0.GA</version>
+ <version>3.2.5.GA</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
@@ -379,7 +380,8 @@
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</exclusion>
- </exclusions>
+ </exclusions>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.man</groupId>
14 years, 9 months
teiid SVN: r3082 - in trunk/documentation/quick-start-example/src/main/docbook/en-US: content and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2011-04-11 11:36:29 -0400 (Mon, 11 Apr 2011)
New Revision: 3082
Added:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
Modified:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml
Log:
TEIID-1519 - updated the quick-start and how it uses the dynamicvdb-portfolio and the HSQL database, instead of Derby.
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,36 +1,45 @@
<?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">
-<chapter id="step-3">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="buildVDB">
<title>Building a VDB</title>
- <para>A VDB can be built with either the <ulink url="http://www.jboss.org/teiiddesigner.html">Designer</ulink> tool or through a
- simple XML file called a dynamic VDB. See the "dyanmicvdb-portolio" for an example dynamic VDB.
- for this example purpose we will use the a dynamic VDB. If you would like to use the
- Designer to build your VDB, check out the Designer examples. If you need to build any view layers using your source,
- you must use Designer based approach to building the VDB. A sample Designer based VDB is
- available in the "teiid-examples/dynamicvdb-portfolio/PortfolioModel" directory.</para>
-
+
+ <para>A VDB can be built with either the <ulink
+ url="http://www.jboss.org/teiiddesigner.html">Designer</ulink> tool or
+ through a simple XML file called a dynamic VDB. See the
+ "dyanmicvdb-portolio" for an example dynamic VDB. For this example we will
+ use the dynamic VDB. If you would like to use the Designer to build your
+ VDB, check out the Designer examples. If you need to build any view layers
+ using your source, you must use the Designer based approach to building the
+ VDB. A sample Designer based VDB is available in the
+ "teiid-examples/dynamicvdb-portfolio/PortfolioModel" directory.</para>
+
<section id="dynamic_vdb">
- <title>Building Dynamic VDB</title>
- <para>This XML file is defines a set of sources that need to treated as single source by the client application.
- Dynamic VDB does not yet allow for the creation of view layers. Below XML file defines "dynamicvdb-portfolio" example
- vdb.</para>
- <para>portfolio-vdb.xml (copy available in "teiid-examples/dynamicvdb-portfolio" directory)</para>
- <programlisting><![CDATA[
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<vdb name="DynamicPortfolio" version="1">
+ <title>Building Dynamic VDB</title>
- <description>A Dynamic VDB</description>
+ <para>This XML file defines a set of sources that can be accessed by the
+ client application. A dynamic VDB does not yet allow for the creation of
+ view layers. Below is the "dynamicvdb-portfolio" example vdb.</para>
+
+ <para>portfolio-vdb.xml (copy available in
+ "teiid-examples/dynamicvdb-portfolio" directory)</para>
+
+ <programlisting>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vdb name="DynamicPortfolio" version="1">
+
+ <description>A Dynamic VDB</description>
- <!--
+ <!--
Setting to use connector supplied metadata. Can be "true" or "cached".
"true" will obtain metadata once for every launch of Teiid.
"cached" will save a file containing the metadata into
- the deploy/<vdb name>/<vdb version/META-INF directory
- -->
- <property name="UseConnectorMetadata" value="cached" />
+ the deploy/<vdb name>/<vdb version/META-INF directory
+ -->
+ <property name="UseConnectorMetadata" value="true" />
- <!--
+ <!--
Each model represents a access to one or more sources.
The name of the model will be used as a top level schema name
for all of the metadata imported from the connector.
@@ -38,50 +47,74 @@
NOTE: Multiple model, with different import settings, can be bound to
the same connector binding and will be treated as the same source at
runtime.
- -->
- <model name="MarketData">
- <!--
+ -->
+ <model name="MarketData">
+ <!--
Each source represents a translator and data source. There are
pre-defined translators, or you can create one. ConnectionFactories
or DataSources in JBoss AS they are typically defined using "xxx-ds.xml" files.
- -->
- <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
- </model>
+ -->
+ <source name="text-connector" translator-name="file" connection-jndi-name="java:marketdata-file"/>
+ </model>
- <model name="Accounts">
- <!--
+ <model name="Accounts">
+ <!--
JDBC Import settings
importer.useFullSchemaName directs the importer to drop the source
schema from the Teiid object name, so that the Teiid fully qualified name
- will be in the form of <model name>.<table name>
- -->
- <property name="importer.useFullSchemaName" value="false"/>
+ will be in the form of <model name>.<table name>
+ -->
+ <property name="importer.useFullSchemaName" value="false"/>
- <!--
- This connector is defined in the "derby-connector-ds.xml"
- -->
- <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
- </model>
+ <!--
+ This connector is defined in the "portfoio-ds.xml"
+ -->
+ <source name="hsql-connector" translator-name="hsql" connection-jndi-name="java:PortfolioDS"/>
+ </model>
-</vdb>
- ]]></programlisting>
-
- <para>The XML file is explained below.</para>
+</vdb>
+ </programlisting>
+ </section>
+
+ <section>
+ <title>Dynamic VDB XML Structure</title>
+
+ <para>The above vdb XML structure is explained.</para>
+
<orderedlist>
- <listitem><para>The above XML file defines a "vdb" with name "DynamicPortfolio" with version "1"</para></listitem>
- <listitem><para>A "model" XML element represents a schema that being integrated. This sample
- defines two sources, "MarketData" that represents the schema for the text file that has the
- stock price information and "Accounts" that represents the "portfolio" schema in the Derby database.
- </para></listitem>
- <listitem><para>The "source" element inside the "model" element defines name of the source (can be any name), and
- name of the translator (defines the type of the source like oracle, db2, mysql, h2, file, ws etc..) and the
- "connection-jndi-name" defines the source's JNDI name in the JBoss AS container.</para></listitem>
- <listitem><para>Also note that inside the "model" elements, some "property" elements are used to define how
- metadata can be imported from source. For more information check out the Reference Guide's Dynamic VDB section.</para></listitem>
- <listitem><para>Note that you need to also create the necessary deployment
- files for the data sources (Connection Factories) too.</para></listitem>
+ <listitem>
+ <para>The "vdb" element defines the virtualdatase that has a name of
+ "DynamicPortfolio" with version "1"</para>
+ </listitem>
+
+ <listitem>
+ <para>A "model" element represents a schema that being integrated.
+ This sample defines two sources, "MarketData" that represents the
+ schema for the text file that has the stock price information and
+ "Accounts" that represents the "portfolio" schema in the HSQL
+ database.</para>
+ </listitem>
+
+ <listitem>
+ <para>The "source" element inside the "model" element defines name of
+ the source (can be any name), and name of the translator (defines the
+ type of the source like oracle, db2, mysql, h2, file, ws etc..) and
+ the "connection-jndi-name" defines the source's JNDI name in the JBoss
+ AS container.</para>
+ </listitem>
+
+ <listitem>
+ <para>Also note that inside the "model" elements, some "property"
+ elements are used to define how metadata can be imported from source.
+ For more information check out the Reference Guide's Dynamic VDB
+ section.</para>
+ </listitem>
+
+ <listitem>
+ <para>Note that you need to also create the necessary deployment files
+ for the data sources (Connection Factories) too.</para>
+ </listitem>
</orderedlist>
-
</section>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -83,7 +83,6 @@
<para>The Teiid installation includes a simple Java class which demonstrates JDBC access of the deployed VDB.
To execute this demonstration, follow these steps:</para>
<orderedlist numeration="arabic">
- <listitem><para>Ensure Derby is running</para></listitem>
<listitem><para>Change to the ${jboss-install}/server/profile/teiid-examples/simpleclient directory</para></listitem>
<listitem><para>Execute the run script (either for Linux or Windows)</para></listitem>
</orderedlist>
@@ -92,7 +91,7 @@
VDB, but also the SYS schema tables.
</para>
- <para>If your application is Web based, you can create data source for your VDB using the above and treat it as any other JDBC source using
+ <para>If your application is Web based, you can create data source for your VDB using the above and treat it as any other JDBC source using
<code>org.teiid.jdbc.TeiidDataSource</code> and assigning it a JNDI name.
Refer to Client Developer's Guide deployment for more information on creating a DataSource.
</para>
Added: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml (rev 0)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -0,0 +1,101 @@
+<?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="setupDS">
+ <title>Setup Data Sources / Connection Factories</title>
+
+ <section id="setup-1">
+ <title>Install Data Sources / Connection Factories</title>
+
+ <para>This examples uses two data sources, a relational database and a
+ text file. An HSQL database is used here since it is Open Source, comes
+ with JBoss AS and is light-weight. This section will describe how to setup
+ the data sources in order to run the example.</para>
+
+ <para>We need to create and deploy the required Connection Factories for
+ HSQL database and File sources. Connection Factories are sources that
+ provide the data when their data is integrated through Teiid. If you are
+ familiar with creating data sources or connection factories in JBoss AS,
+ then this is exactly the same operation</para>
+
+ <para>Perform the following steps to install and setup the data
+ sources:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Copy the following files from
+ "teiid-examples/dynamicvdb-portfolio" directory to the
+ "<jboss-install>/server/default/deploy" directory</para>
+
+ <para>(1) portfolio-ds.xml</para>
+
+ <para>(2) marketdata-file-ds.xml</para>
+ </listitem>
+
+ <listitem>
+ <para>If the server has not been started, start it</para>
+ </listitem>
+
+ <listitem>
+ <para>Using a web browser, goto the JMX console
+ (http://localhost:8080/jmx-console/) and select:
+ <emphasis>database-portfolioDB,service=PortfolioService</emphasis> to
+ present the bean options.</para>
+ </listitem>
+
+ <listitem>
+ <para>Now click invoke "startDatabaseManager" to bring up HSQL
+ Database Manager</para>
+ </listitem>
+
+ <listitem>
+ <para>Use the File/Open Script menu option to load the
+ customer-schema.sql script located in
+ "teiid-examples/dynamicvdb-portfolio"</para>
+ </listitem>
+
+ <listitem>
+ <para>Click the Execute SQL button to create the required tables and
+ insert the example data</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Make sure you did not have any issues when creating the schema as it
+ is needed for going forward in this example.</para>
+ </section>
+
+ <section id="setup-2">
+ <title>Describe the CSV file and its contents</title>
+
+ <para>In order to use a Text file as the source, we need a data file which
+ defines the data in the table</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Data File: Each data file contains column information for the
+ table. The column information is typically defined on line 1 as header
+ line in the file, and all the following lines contain the actual rows
+ of data. Each single line corresponds to single row. A portion of the
+ sample file is shown below. The complete sample file is
+ "teiid-examples/dynamicvdb-portfolio/data/marketdata-price.txt".</para>
+
+ <programlisting>
+ SYMBOL,PRICE
+ IBM,83.46
+ RHT,11.84
+ BA, 44.58
+ ORCL,17.37
+
+ </programlisting>
+ </listitem>
+ </orderedlist>
+
+ <para>You can use the provide data files or create your own data
+ files.</para>
+
+ <para>At this point, both data sources are ready to access.</para>
+ </section>
+</chapter>
Property changes on: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/datasources.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Id Revision
Added: svn:eol-style
+ LF
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/deployment.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,43 +1,32 @@
<?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">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="deployment">
- <title>Deployment</title>
- <para> Having built the VDB, it must be deployed into Teiid server, so it can be accessed through a JDBC connection.</para>
+ <title>VDB Deployment</title>
- <para />
- <para>This example deploys Teiid within a JBoss AS. The sample deployment is shown below.
- You can find more details about deploying to application servers on the Teiid web-site</para>
- <para />
- <section id="teiid-runtime">
- <title>JBoss AS Application Deployment</title>
-
- <orderedlist>
- <listitem>
- <para>
- Before we can deploy the VDB to the server, we need to create and deploy the required Connection Factories for Derby
- and File sources. Connection Factories are sources that provide the data then their data is integrated through Teiid. If you are
- familiar with creating data sources or connection factories in JBoss AS, then this is exactly the same operation.
- </para>
-
- <para>Access to Derby first requires that the the Derby client jar (${derby-install}/lib/derbyclient.jar) be placed in the ${jboss-install}/server/{profile}/lib directory.</para>
-
- <para>See or copy the following:</para>
- <programlisting><![CDATA[${teiid-examples}/dynamicvdb-portfolio/portfolio-ds.xml
-${teiid-examples}/dynamicvdb-portfolio/marketdata-file-ds.xml]]> </programlisting>
- <para>files into "${jboss-install}/server/{profile}/deploy" directory to create the Derby and File data sources respectively.</para>
- </listitem>
- <listitem>
- <para>The above data sources provide the data to your VDB. Now to deploy your VDBl place your VDB file (either the dynamicvdb-portfolio/portfolio-vdb.xml file or the full .vdb file) in a the "${jboss-install}/server/{profile}/deploy" directory.
- If the JBoss AS is not already started, start by running the "${jboss-install}/bin/run.sh" or "${jboss-install}/bin/run.bat" scripts.
- Check the logs or the console to make sure there were no errors during the deployment of the VDB.
- </para>
- </listitem>
- <listitem>
- <para>
- Now, go to the next section to learn how to
- <link linkend="OpenConnection">connect to the VDB</link>
- </para>
- </listitem>
- </orderedlist>
- </section>
-</chapter>
\ No newline at end of file
+ <para>Having built the VDB or using the example dynamic vdb, it must be
+ deployed into the JBoss AS server so it can be accessed using a Teiid JDBC
+ connection.</para>
+
+ <para></para>
+
+ <para>This example is using the dynamic vdb and requires that it be deployed
+ into the JBoss AS server. To deploy the vdb, copy the following file into
+ "<emphasis><jboss-install>/server/default/deploy</emphasis>"
+ directory:</para>
+
+ <para></para>
+
+ <itemizedlist>
+ <listitem>
+ <para>teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml</para>
+ </listitem>
+ </itemizedlist>
+
+ <para></para>
+
+ <para>Now, go to the next section to learn how to <link
+ linkend="OpenConnection">connect to the VDB.</link></para>
+
+ <para></para>
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/download.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,41 +1,52 @@
<?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" [
+<!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="download">
<title>Download</title>
- <para>
- You need to download the binaries for
- <ulink url="http://www.jboss.org/teiid/downloads.html">Teiid</ulink>
- . Note that there are three different artifacts are available for download.
- </para>
+
+ <para>You need to download the binaries for <ulink
+ url="http://www.jboss.org/teiid/downloads.html">Teiid</ulink> . Note that
+ there are three different artifacts are available for download.</para>
+
<orderedlist>
<listitem>
<para>Teiid Source - contains all of the source code</para>
</listitem>
+
<listitem>
<para>Teiid AdminShell - contains the admin client</para>
</listitem>
+
<listitem>
<para>Teiid Runtime - contains the Teiid engine and required 3rd party
- dependencies</para>
+ dependencies</para>
</listitem>
</orderedlist>
- <para>
- For this Quick Start, download and install <ulink url="http://www.jboss.org/jbossas/downloads.html">JBoss AS 5.1.0</ulink>.
- Then download the Teiid runtime and unzip the contents under any of the JBoss AS profiles, such as "default" or "all".
- The default profile is the typical installation location, for example "<jboss-install>/server/default". The Teiid runtime directory structure matches JBoss profiles directly - it is just an overlay.
- </para>
- <para>In the "<jboss-install>/server/<profile>/lib" directory, you will find "teiid-&versionNumber;-client.jar", which
- is the main client binary jar file for Teiid. This jar file contains the Teiid's JDBC driver and data source classes. </para>
+
+ <para>For this Quick Start, download and install <ulink
+ url="http://www.jboss.org/jbossas/downloads.html">JBoss AS 5.1.0</ulink>.
+ Then download the Teiid runtime and unzip the contents under any of the
+ JBoss AS profiles, such as "default" or "all". The default profile is the
+ typical installation location, for example
+ "<jboss-install>/server/default". The Teiid runtime directory
+ structure matches JBoss profiles directly - it is just an overlay.</para>
+
+ <para>In the "<jboss-install>/server/<profile>/lib" directory,
+ you will find "teiid-&versionNumber;-client.jar", which is the main client
+ binary jar file for Teiid. This jar file contains the Teiid's JDBC driver
+ and data source driver jar's.</para>
+
<note>
- <para>JBoss AS 5.1 requires <ulink url="http://java.sun.com/javase/downloads">Java 6</ulink> to run.
- </para>
- <para>
- Access to physical data sources such as Oracle, MS-SQL Server, DB2, and Sybase through Teiid relies upon
- the user supplying their own JDBC drivers in the deployment. Copy the JDBC driver files into
- "<jboss-install>/server/<profile>/lib" before you create any data sources.
- </para>
+ <para>JBoss AS 5.1 requires <ulink
+ url="http://java.sun.com/javase/downloads">Java 6</ulink> to run.</para>
+
+ <para>Access to physical data sources such as Oracle, MS-SQL Server, DB2,
+ and Sybase through Teiid relies upon the user supplying their own JDBC
+ drivers in the deployment. Copy the JDBC driver files into
+ "<jboss-install>/server/<profile>/lib" before you create any
+ data sources.</para>
</note>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/example-explained.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,123 +1,57 @@
<?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">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="example-explained">
- <title>Example Explained</title>
+ <title>Portfolio Example Explained</title>
+
<section>
- <title>Portfolio Application Explained</title>
- <para>
- The investor's portfolio information is stored in a Derby database and
- "current" stock prices are stored in a delimited text file. When the VDB is completed, a single query will cause
- Teiid to access the relational and non-relational sources, calculate the portfolio values, and
- return the results.
- </para>
+ <para>The investor's portfolio example information is stored in a HSQL
+ database and "current" stock prices are stored in a delimited text file.
+ When the VDB is completed, a single query will cause Teiid to access the
+ relational and non-relational sources, calculate the portfolio values, and
+ return the results.</para>
+
<figure id="steps">
<title>Various Steps involved in creating the example</title>
- <graphic align="center" scale="100" fileref="../images/steps-defined.png" />
+
+ <graphic align="center" fileref="../images/steps-defined.png"
+ scale="100" />
</figure>
+
<itemizedlist>
<listitem>
<para>
- <link linkend="step-1">Step-1: Create the Relational Database's schema and load the sample data</link>
+ <link linkend="setupDS">Step-1: Setup Data Sources /
+ ConnectionFactories</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="step-2">Step-2: Describe the CSV file and its contents</link>
+ <link linkend="buildVDB">Step-3: Build a VDB</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="step-3">Step-3: Build a VDB</link>
+ <link linkend="deployment">Step-4: Deploy the VDB in JBoss AS</link>
</para>
</listitem>
+
<listitem>
<para>
- <link linkend="deployment">Step-4: Deploy the VDB in Teiid</link>
+ <link linkend="OpenConnection">Step-5: Access the VDB using the JDBC
+ API</link>
</para>
</listitem>
- <listitem>
- <para>
- <link linkend="OpenConnection">Step-5: Access the VDB using the JDBC API</link>
- </para>
- </listitem>
</itemizedlist>
</section>
+
<note>
- <para>
- <ulink url="http://db.apache.org/derby/">Derby</ulink>
- is used here since it is Open Source, easily obtained, and light-weight. You can substitute any other relational
- database, as long as you have a suitable JDBC driver. The schema file provided, and described below, is
- specific to Derby, but can be easily converted for use with other databases.
- </para>
+ <para>HSQL database is used here since it is Open Source and comes with
+ JBoss AS and is light-weight. You can substitute any other relational
+ database, as long as you have a suitable JDBC driver. The schema file
+ provided, and described below, is specific to HSQL, but can be easily
+ converted for use with other databases.</para>
</note>
- <section id="step-1">
- <title>Create the Relational Database's schema and load the sample data</title>
- <para>
- This example is written using
- <ulink url="http://db.apache.org/derby/">"Derby"</ulink>
- as the relational database.
- <ulink url="http://db.apache.org/derby/derby_downloads.html">Download</ulink>
- and install Derby on your machine. An existing local or remote instance can be used if it exists.
- </para>
- <para>We need to start the Derby RDBMS and create the "accounts" database with the below schema. These
- commands are intended for a Linux environment. For starting the Derby instance on another platform, you will need to use
- commands appropriate to that platform.</para>
- <para>Start a terminal session, and change directory to where
- Derby is installed and execute following commands</para>
- <programlisting><![CDATA[export DERBY_HOME=`pwd`
-./bin/startNetworkServer]]>
- </programlisting>
- <para>This starts the Derby in network mode. Now, start another terminal and we will use Derby''s 'ij' tool
- (like SQL*PLus for Oracle) to create the schema, using the "customer-schema.sql" file in
- "examples/dynamicvdb-portfolio" directory</para>
- <programlisting><![CDATA[export DERBY_HOME=`pwd`
-./bin/ij /path/to/customer-schema.sql]]>
- </programlisting>
- <para>This will create the accounts schema. It's abbreviated ddl is shown below. </para>
- <programlisting><![CDATA[--Contains the name and address of a Customer who owns portfolio account
-CREATE TABLE CUSTOMER
-...
-
---Contains Customer's account number and its current status
-CREATE TABLE ACCOUNT
-...
-
---Contains information about stock symbol, company name etc.
-CREATE TABLE PRODUCT
-...
-
---Contains each Account's holdings of Stocks
-CREATE TABLE HOLDINGS
-...]]></programlisting>
-
- <para>
- Make sure you did not have any issues when creating the schema as it is needed for going forward in this example.
- You can use 'ij' tool to verify the tables were created. As an alternative, you may use other tools like
- <ulink url="http://www.squirrelsql.org/">SQuirreL</ulink>
- , or
- <ulink url="http://www.eclipse.org/datatools/">Eclipse's Data Tools</ulink>
- plugin to connect to the Derby instance to check the schema and sample data.
- </para>
- </section>
- <section id="step-2">
- <title>Describe the CSV file and its contents</title>
- <para>In order to use a Text file as the source, we need a data file defines data inside a table</para>
- <orderedlist>
- <listitem>
- <para>Data File: Each data file contains column information for the table. The
- column information is typically defined on line 1 as header line in the file, and all the following lines
- contain the actual rows of data. Each single line corresponds to single row. A portion of the sample file
- is shown below. The complete sample file is "examples/dynamicvdb-portfolio/marketdata-price.txt".</para>
- <programlisting><![CDATA[
- SYMBOL,PRICE
- IBM,83.46
- RHT,11.84
- BA, 44.58
- ORCL,17.37
- ]]>
- </programlisting>
- </listitem>
- </orderedlist>
- <para>Just locate the sample data files provided or create your own data files. Now, both our sources are ready.</para>
- </section>
-</chapter>
\ No newline at end of file
+</chapter>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/content/preface.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -1,47 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<preface>
<title>Preface</title>
- <section>
+
+ <section>
<title>What is Teiid?</title>
- <para>Teiid is runtime for executing queries against a Virtual Database or VDB. Before you can access your data in a federated
- manner, use can use Teiid Designer or the Dynamic VDB feature to build a VDB. This picture shows the relationship between the tools
- involved.</para>
+
+ <para>Teiid is runtime for executing queries against a Virtual Database or
+ VDB. Before you can access your data in a federated manner, user can use
+ Teiid Designer or the Dynamic VDB feature to build a VDB. This picture
+ shows the relationship between the tools involved.</para>
+
<figure id="lifecycle">
<title>Lifecycle of Events</title>
- <graphic align="center" scale="100" fileref="../images/steps.png" />
+
+ <graphic align="center" fileref="../images/steps.png" scale="100" />
</figure>
+
<section>
- <title>What is a Virtual Database?</title>
- <para> A Virtual Database (VDB) is an artifact that combines one or more
- physical data sources to provide for easy data integration. Integration is encapsulated through view and procedures that Teiid will process in an optimized way against their respective sources.
- The physical sources can be JDBC sources, delimited text files, spreadsheets, or even Web services.</para>
- </section>
-
- <para>The Teiid Designer tool lets you define physical data sources by importing the required metadata
- (schema) from these sources. Once the metadata is imported, Designer can assist in building additional view layers.
- The collection of physical and view models will form a VDB.</para>
+ <title>What is a Virtual Database?</title>
+
+ <para>A Virtual Database (VDB) is an artifact that combines one or more
+ physical data sources to provide for easy data integration. Integration
+ is encapsulated through view and procedures that Teiid will process in
+ an optimized way against their respective sources. The physical sources
+ can be JDBC sources, delimited text files, spreadsheets, or even Web
+ services.</para>
+ </section>
+
+ <para>The Teiid Designer tool lets you define physical data sources by
+ importing the required metadata (schema) from these sources. Once the
+ metadata is imported, Designer can assist in building additional view
+ layers. The collection of physical and view models will form a VDB.</para>
</section>
-
+
<section>
<title>What is This Guide About?</title>
- <para>This guide takes you through an introduction to the concepts important to Teiid,
- downloading the software, and building and deploying a virtual database in 60 minutes.
- There is a lot to cover, so let's begin!</para>
+
+ <para>This guide takes you through an introduction to the concepts
+ important to Teiid, downloading the software, and building and deploying a
+ virtual database in 60 minutes. There is a lot to cover, so let's
+ begin!</para>
</section>
-
+
<note>
- <para>
- Please read
- <ulink url="http://www.jboss.org/teiid/basics.html">Federation Basics</ulink>
- to understand different terminologies used, resources needed, and artifacts to be generated before
- developing a successful application. This example takes advantage of only a minimal set of features from
- Teiid for the sake of simplicity and time.
- </para>
+ <para>Please read <ulink
+ url="http://www.jboss.org/teiid/basics.html">Federation Basics</ulink> to
+ understand different terminologies used, resources needed, and artifacts
+ to be generated before developing a successful application. This example
+ takes advantage of only a minimal set of features from Teiid for the sake
+ of simplicity and time.</para>
</note>
-
- <para>Commercial development support, production support, and training for Teiid is available through JBoss.
- Teiid is a Professional Open Source project and a critical component of the JBoss Enterprise Data Services
- Platform.</para>
-
-</preface>
\ No newline at end of file
+
+ <para>Commercial development support, production support, and training for
+ Teiid is available through JBoss. Teiid is a Professional Open Source
+ project and a critical component of the JBoss Enterprise Data Services
+ Platform.</para>
+</preface>
Modified: trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml
===================================================================
--- trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml 2011-04-11 15:34:06 UTC (rev 3081)
+++ trunk/documentation/quick-start-example/src/main/docbook/en-US/quick_start_example.xml 2011-04-11 15:36:29 UTC (rev 3082)
@@ -49,6 +49,7 @@
<xi:include href="content/preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/download.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/example-explained.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="content/datasources.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/buildvdb.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/deployment.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="content/connect-vdb.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
14 years, 9 months
teiid SVN: r3081 - trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2011-04-11 11:34:06 -0400 (Mon, 11 Apr 2011)
New Revision: 3081
Added:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql
Removed:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml
Modified:
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql
trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml
Log:
TEIID-1519 - changed the dynamicvdb-portfolio example to use the HSQL database provided by jboss as.
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/README.txt 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,27 +1,50 @@
-Demonstrates how to use the File Translator to integrate text resources with
-a database. This example assumes the use of Derby, but the creation SQL could be
-adapted to another database if you choose.
+Dynamicvdb-portfolio demonstrates how to federate data from a relational data source with a
+text file-based data source. This example uses the HSQL database which is referenced as
+the PortfolioDS data source in the server, but the creation SQL could be adapted to another
+database if you choose.
-Install a recent version of Derby - see http://db.apache.org/derby/derby_downloads.html
-Create the example dataset in Derby by running <derby home>/bin/ij customer-schema.sql
+Data Source(s) setup:
-Put the <derby home>/lib/derbyclient.jar to the "<jboss home>/server/default/lib" directory.
+- Start the server (if not already started)
+- go to the JMX console (http://localhost:8080/jmx-console/) and select: database=localDB,service=Hypersonic
+to present bean options. Now invoke "startDatabaseManager" to bring up HSQL Database Manager.
+- Use the File/Open Script menu option to load the teiid-examples/dynamicvdb-portfolio/customer-schema.sql script and and then click Execute SQL to create the required tables and insert the example data.
+
+Teiid Deployment:
+
+
Copy the following files to the <jboss.home>/server/default/deploy directory.
- - portfolio-vdb.xml
- - marketdata-file-ds.xml
- - portfolio-ds.xml
-Start the JBoss Container
+ (1) portfolio-vdb.xml
+ (2) marketdata-file-ds.xml
+
+
+Query Demonstrations:
-Use the simple client example run script, or another client, to execute a query, e.g.
+==== Using the simpleclient example ====
-$./run.sh localhost 31000 dynamicportfolio "select stock.* from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol"
+1) Change your working directory to teiid-examples/simpleclient
-This example will execute the query against both Derby and the text files. The
-files returned from the getTextFiles procedure are passed to the TEXTTABLE table
-function (via the nested table correlated reference f.file). The TEXTTABLE
-function expects a text file with a HEADER containing entries for at least symbol
-and price columns.
+2) Use the simpleclient example run script, using the following format
+$./run.sh localhost 31000 dynamicportfolio "example query"
+
+
+example queries:
+
+1 select * from product
+2 select stock.* from (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock
+3. select product.symbol, stock.price, company_name from product, (call MarketData.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS symbol string, price bigdecimal HEADER) stock where product.symbol=stock.symbol
+
+Example 1 queries the relational source
+
+Example 2 queries the text file-based
+ source
+
+Example 3 queries both the relational and the text file-based sources. The files returned from the getTextFiles procedure are
+passed to the TEXTTABLE table function (via the nested table correlated reference f.file). The TEXTTABLE function expects a
+text file with a HEADER containing entries for at least symbol and price columns.
+
+
Added: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql (rev 0)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema-drop.sql 2011-04-11 15:34:06 UTC (rev 3081)
@@ -0,0 +1,21 @@
+
+DROP TABLE HOLDINGS
+;
+
+DROP TABLE PRODUCT
+;
+
+DROP TABLE ACCOUNT
+;
+
+DROP TABLE CUSTOMER
+;
+
+
+
+
+
+
+
+
+
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/customer-schema.sql 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,6 +1,6 @@
-CONNECT 'jdbc:derby://localhost:1527/teiid/accounts;create=true;';
-DROP TABLE CUSTOMER;
+
+
CREATE TABLE CUSTOMER
(
SSN char(10),
@@ -15,7 +15,7 @@
CONSTRAINT CUSTOMER_PK PRIMARY KEY(SSN)
);
-DROP TABLE ACCOUNT;
+
CREATE TABLE ACCOUNT
(
ACCOUNT_ID integer,
@@ -28,7 +28,7 @@
CONSTRAINT CUSTOMER_FK FOREIGN KEY (SSN) REFERENCES CUSTOMER (SSN)
);
-DROP TABLE PRODUCT;
+
CREATE TABLE PRODUCT (
ID integer,
SYMBOL varchar(16),
@@ -36,10 +36,10 @@
CONSTRAINT PRODUCT_PK PRIMARY KEY(ID)
);
-DROP TABLE HOLDINGS;
+
CREATE TABLE HOLDINGS
(
- TRANSACTION_ID integer GENERATED ALWAYS AS IDENTITY (start with 2000, increment by 1),
+ TRANSACTION_ID integer IDENTITY,
ACCOUNT_ID integer,
PRODUCT_ID integer,
PURCHASE_DATE timestamp,
@@ -49,6 +49,8 @@
CONSTRAINT PRODUCT_FK FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT (ID)
);
+
+
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01002','Joseph','Smith','1234 Main Street','Apartment 56','New York','New York','10174','(646)555-1776');
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01003','Nicholas','Ferguson','202 Palomino Drive',null,'Pittsburgh','Pennsylvania','15071','(412)555-4327');
INSERT INTO CUSTOMER (SSN,FIRSTNAME,LASTNAME,ST_ADDRESS,APT_NUMBER,CITY,STATE,ZIPCODE,PHONE) VALUES ('CST01004','Jane','Aire','15 State Street',null,'Philadelphia','Pennsylvania','19154','(814)555-6789');
@@ -125,6 +127,7 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990007,1008,{ts '1999-05-11 00:00:00.000'},85);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1005,{ts '1999-05-21 00:00:00.000'},105);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1004,{ts '1999-06-25 00:00:00.000'},120);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1024,{ts '1999-07-22 00:00:00.000'},150);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000015,1018,{ts '2000-04-20 00:00:00.000'},135);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980006,1030,{ts '2000-06-12 00:00:00.000'},91);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000019,1029,{ts '2000-10-08 00:00:00.000'},351);
@@ -135,12 +138,13 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010022,1006,{ts '2001-01-05 00:00:00.000'},237);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990008,1015,{ts '2001-01-23 00:00:00.000'},180);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1025,{ts '2001-03-23 00:00:00.000'},125);
-INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1020,{ts '2001-08-22 00:00:00.000'},70);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1024,{ts '2001-08-22 00:00:00.000'},70);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000020,1006,{ts '2001-11-14 00:00:00.000'},125);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980003,1029,{ts '2001-11-15 00:00:00.000'},100);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20000021,1011,{ts '2001-12-18 00:00:00.000'},44);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20010027,1028,{ts '2001-12-19 00:00:00.000'},115);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1024,{ts '2002-01-22 00:00:00.000'},189);
-INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1022,{ts '2002-01-24 00:00:00.000'},30);
+INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19990009,1029,{ts '2002-01-24 00:00:00.000'},30);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1013,{ts '2002-02-12 00:00:00.000'},110);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020035,1034,{ts '2002-02-13 00:00:00.000'},70);
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (20020034,1003,{ts '2002-02-22 00:00:00.000'},25);
@@ -153,7 +157,4 @@
INSERT INTO HOLDINGS (ACCOUNT_ID,PRODUCT_ID,PURCHASE_DATE,SHARES_COUNT) VALUES (19980005,1010,{ts '2002-04-01 00:00:00.000'},26);
-COMMIT;
-DISCONNECT CURRENT;
-
Deleted: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-ds.xml 2011-04-11 15:34:06 UTC (rev 3081)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources>
- <xa-datasource>
- <jndi-name>PortfolioDS</jndi-name>
- <isSameRM-override-value>false</isSameRM-override-value>
- <xa-datasource-class>org.apache.derby.jdbc.ClientXADataSource</xa-datasource-class>
- <xa-datasource-property name="DatabaseName">teiid/accounts</xa-datasource-property>
- <xa-datasource-property name="PortNumber">1527</xa-datasource-property>
- <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
-
- <track-connection-by-tx>true</track-connection-by-tx>
- <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
-
- <max-pool-size>5</max-pool-size>
- <min-pool-size>1</min-pool-size>
- <metadata>
- <type-mapping>Derby</type-mapping>
- </metadata>
- </xa-datasource>
-</datasources>
-
Modified: trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml 2011-04-08 19:27:28 UTC (rev 3080)
+++ trunk/build/kits/jboss-container/teiid-examples/dynamicvdb-portfolio/portfolio-vdb.xml 2011-04-11 15:34:06 UTC (rev 3081)
@@ -9,7 +9,7 @@
"cached" will save a file containing the metadata into
the deploy/<vdb name>/<vdb version/META-INF directory
-->
- <property name="UseConnectorMetadata" value="cached" />
+ <property name="UseConnectorMetadata" value="true" />
<!--
@@ -41,9 +41,9 @@
<property name="importer.useFullSchemaName" value="false"/>
<!--
- This connector is defined in the "derby-connector-ds.xml"
+ This connector is defined to reference the HSQL localDS"
-->
- <source name="derby-connector" translator-name="derby" connection-jndi-name="java:PortfolioDS"/>
+ <source name="hsql-connector" translator-name="hsql" connection-jndi-name="java:DefaultDS"/>
</model>
</vdb>
\ No newline at end of file
14 years, 9 months
teiid SVN: r3080 - in trunk: build and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-08 15:27:28 -0400 (Fri, 08 Apr 2011)
New Revision: 3080
Removed:
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
Modified:
trunk/build/pom.xml
trunk/client-jdk15/
trunk/pom.xml
Log:
TEIID-1491: removing the usage of the retrotranslator from the build. It is proven to be not embedding the runtime jar, and was in alpha state for for 3 years and very poor docs and unusable. I replaced with java execute process that directly uses the Retrotranslator library.
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
+++ trunk/build/pom.xml 2011-04-08 19:27:28 UTC (rev 3080)
@@ -8,6 +8,24 @@
<artifactId>teiid</artifactId>
<name>Build</name>
<description>Teiid Build</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-client-jdk15</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-runtime</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sf.retrotranslator</groupId>
+ <artifactId>retrotranslator-transformer</artifactId>
+ <version>1.2.9</version>
+ </dependency>
+ </dependencies>
<build>
<outputDirectory>target/kits</outputDirectory>
<resources>
@@ -86,32 +104,31 @@
</descriptors>
</configuration>
</plugin>
+
<plugin>
<groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
- <goal>translate</goal>
+ <goal>java</goal>
</goals>
<configuration>
- <attach>true</attach>
- <target>1.5</target>
- <embed>org.teiid.retroruntime</embed>
- <destjar>target/teiid-${pom.version}-client-jdk15.jar</destjar>
- <verify>false</verify>
- <failonwarning>true</failonwarning>
- <includes>
- <include>
- <directory>target</directory>
- <pattern>teiid-${pom.version}-client.jar</pattern>
- </include>
- </includes>
+ <mainClass>net.sf.retrotranslator.transformer.Retrotranslator</mainClass>
+ <arguments>
+ <argument>-srcjar</argument>
+ <argument>${pom.basedir}/target/teiid-${pom.version}-client.jar</argument>
+ <argument>-destjar</argument>
+ <argument>${pom.basedir}/target/teiid-${pom.version}-client-jdk15.jar</argument>
+ <argument>-embed</argument>
+ <argument>org.teiid.retroruntime</argument>
+ </arguments>
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
</profile>
Property changes on: trunk/client-jdk15
___________________________________________________________________
Added: svn:ignore
+ target
.classpath
.settings
.project
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
+++ trunk/pom.xml 2011-04-08 19:27:28 UTC (rev 3080)
@@ -477,6 +477,7 @@
<module>hibernate-dialect</module>
<module>jboss-integration</module>
<module>test-integration</module>
+ <module>client-jdk15</module>
</modules>
<distributionManagement>
<repository>
14 years, 9 months
teiid SVN: r3079 - in trunk: client-jdk15 and 19 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-08 15:21:21 -0400 (Fri, 08 Apr 2011)
New Revision: 3079
Added:
trunk/client-jdk15/
trunk/client-jdk15/pom.xml
trunk/client-jdk15/src/
trunk/client-jdk15/src/main/
trunk/client-jdk15/src/main/java/
trunk/client-jdk15/src/main/java/net/
trunk/client-jdk15/src/main/java/net/sf/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
Log:
TEIID_1491: adding retrotranslator classes as separate module to escape the processing of it by retrotranslator
Added: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml (rev 0)
+++ trunk/client-jdk15/pom.xml 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>teiid-parent</artifactId>
+ <groupId>org.jboss.teiid</groupId>
+ <version>7.4.0.Beta3-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>teiid-client-jdk15</artifactId>
+ <name>Client JDK15</name>
+ <description>Contains the packages related retrotranslator that will convert 1.6 to 1.5</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.teiid</groupId>
+ <artifactId>teiid-common-core</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.IOException;
+
+public class _IOException {
+ public static IOException createNewInstance(Throwable t){
+ IOException io = new IOException();
+ io.initCause(t);
+ return io;
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.ObjectStreamClass;
+import java.lang.reflect.Method;
+
+public class _ObjectStreamClass {
+ public static ObjectStreamClass lookupAny(Class<?> cl) {
+ try {
+ Method m = ObjectStreamClass.class.getDeclaredMethod("lookup",new Class[] { Class.class, Boolean.TYPE }); //$NON-NLS-1$
+ m.setAccessible(true);
+ return (ObjectStreamClass) m.invoke(null, new Object[] { cl,Boolean.valueOf(true) });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.Clob;
+
+public abstract interface NClob_ extends Clob
+{
+}
\ No newline at end of file
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public interface RowId_ {
+ boolean equals(Object obj);
+ byte[] getBytes();
+ String toString();
+ int hashCode();
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLClientInfoException_ extends SQLException {
+
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLFeatureNotSupportedException_ extends SQLException {
+
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.sql.SQLException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+public abstract interface SQLXML_
+{
+ public abstract void free()
+ throws SQLException;
+
+ public abstract InputStream getBinaryStream()
+ throws SQLException;
+
+ public abstract OutputStream setBinaryStream()
+ throws SQLException;
+
+ public abstract Reader getCharacterStream()
+ throws SQLException;
+
+ public abstract Writer setCharacterStream()
+ throws SQLException;
+
+ public abstract String getString()
+ throws SQLException;
+
+ public abstract void setString(String paramString)
+ throws SQLException;
+
+ public abstract <T extends Source> T getSource(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract <T extends Result> T setResult(Class<T> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public abstract interface Wrapper_
+{
+ public abstract <T> T unwrap(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract boolean isWrapperFor(Class<?> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class _SQLException {
+ public static SQLException createNewInstance(Throwable t){
+ SQLException sql = new SQLException();
+ sql.initCause(t);
+ return sql;
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLWarning;
+
+public class _SQLWarning {
+ public static SQLWarning createNewInstance(Throwable t){
+ SQLWarning sql = new SQLWarning();
+ sql.initCause(t);
+ return sql;
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public class _Types {
+ public final static int ROWID = -8;
+ public static final int NCHAR = -15;
+ public static final int NVARCHAR = -9;
+ public static final int LONGNVARCHAR = -16;
+ public static final int NCLOB = 2011;
+ public static final int SQLXML = 2009;
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.util;
+
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+public class _Properties {
+
+ public static Set<String> stringPropertyNames(Properties props) {
+ return new HashSet<String>(Collections.list((Enumeration<String>)props.propertyNames()));
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.javax.net.ssl;
+
+import java.security.NoSuchAlgorithmException;
+
+import javax.net.ssl.SSLContext;
+
+public class _SSLContext {
+ public static SSLContext getDefault() throws NoSuchAlgorithmException {
+ return SSLContext.getInstance("TLSv1"); //$NON-NLS-1$
+ }
+}
Added: trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
===================================================================
--- trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java (rev 0)
+++ trunk/client-jdk15/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java 2011-04-08 19:21:21 UTC (rev 3079)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.org.teiid.core.types.basic;
+
+import java.io.Reader;
+
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.Transform;
+import org.teiid.core.types.TransformationException;
+import org.teiid.core.types.XMLType.Type;
+
+public class StringToSQLXMLTransform_ extends Transform {
+
+ public static Type isXml(Reader reader) throws TransformationException {
+ return Type.UNKNOWN;
+ }
+
+ /**
+ * This method transforms a value of the source type into a value
+ * of the target type.
+ * @param value Incoming value of source type
+ * @return Outgoing value of target type
+ * @throws TransformationException if value is an incorrect input type or
+ * the transformation fails
+ */
+ public Object transformDirect(Object value) throws TransformationException {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+ /**
+ * Type of the incoming value.
+ * @return Source type
+ */
+ public Class<?> getSourceType() {
+ return DataTypeManager.DefaultDataClasses.STRING;
+ }
+
+ /**
+ * Type of the outgoing value.
+ * @return Target type
+ */
+ public Class<?> getTargetType() {
+ return DataTypeManager.DefaultDataClasses.XML;
+ }
+
+ @Override
+ public boolean isExplicit() {
+ return true;
+ }
+}
14 years, 9 months
teiid SVN: r3078 - in trunk/engine/src/main/java/org/teiid: query/tempdata and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-04-08 14:29:53 -0400 (Fri, 08 Apr 2011)
New Revision: 3078
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
Log:
TEIID-1473 fixing the limit compensation
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-04-07 20:21:17 UTC (rev 3077)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-04-08 18:29:53 UTC (rev 3078)
@@ -126,7 +126,6 @@
AtomicRequestMessage aqr = createRequest(context.getProcessorID(), command, modelName, connectorBindingId, nodeID);
if (limit > 0) {
aqr.setFetchSize(Math.min(limit, aqr.getFetchSize()));
- throw new AssertionError();
}
ConnectorManagerRepository cmr = workItem.getDqpWorkContext().getVDB().getAttachment(ConnectorManagerRepository.class);
ConnectorWork work = cmr.getConnectorManager(aqr.getConnectorName()).registerRequest(aqr);
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-07 20:21:17 UTC (rev 3077)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-04-08 18:29:53 UTC (rev 3078)
@@ -172,7 +172,7 @@
return result;
}
}
- return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID, -1);
+ return this.processorDataManager.registerRequest(context, command, modelName, connectorBindingId, nodeID, limit);
}
TupleSource registerRequest(CommandContext context, String modelName, Command command) throws TeiidComponentException, TeiidProcessingException {
14 years, 9 months
teiid SVN: r3077 - in trunk: build/kits/jboss-container and 17 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-04-07 16:21:17 -0400 (Thu, 07 Apr 2011)
New Revision: 3077
Added:
trunk/client/src/main/java/net/
trunk/client/src/main/java/net/sf/
trunk/client/src/main/java/net/sf/retrotranslator/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/
trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/build/pom.xml
Log:
TEIID-1491: Adding support for building retro translated JDBC driver for JDK1.5
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-04-07 15:23:10 UTC (rev 3076)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-04-07 20:21:17 UTC (rev 3077)
@@ -50,7 +50,8 @@
<LI><B>Dependent query parallization</B> - when multiple dependent queries are still required, then they will be run in parallel (up to MaxUserSourceRequestConcurrency), rather than sequentially.
<LI><B>Cost based back-off</B> - for cost based dependent joins if the number of independent values is too large, then the join will be performed as normal.
</UL>
- <LI><B>Enhanced Sort Join</B> - the partitioned merge join was replaced with an enhanced sort join. The enhanced sort join will use the actual row counts from each side of the relation to perform a index based join if one side is small enough, a partial sort of the larger side and a repeated merge join if the tuples are unbalanced but one side is not small enough to form an index, or a standard sort merge join if the tuples are balanced.
+ <LI><B>Enhanced Sort Join</B> - the partitioned merge join was replaced with an enhanced sort join. The enhanced sort join will use the actual row counts from each side of the relation to perform a index based join if one side is small enough, a partial sort of the larger side and a repeated merge join if the tuples are unbalanced but one side is not small enough to form an index, or a standard sort merge join if the tuples are balanced.
+ <LI><B>JDK1.5 JDBC Client JAR</B> - A retro-translated Teiid client JDBC jar now available to use with JDK 1.5 VM. Note only JDBC API supported, not Admin API.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-04-07 15:23:10 UTC (rev 3076)
+++ trunk/build/pom.xml 2011-04-07 20:21:17 UTC (rev 3077)
@@ -62,7 +62,7 @@
</goals>
</execution>
</executions>
- </plugin>
+ </plugin>
</plugins>
</build>
@@ -86,6 +86,32 @@
</descriptors>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>retrotranslator-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>translate</goal>
+ </goals>
+ <configuration>
+ <attach>true</attach>
+ <target>1.5</target>
+ <embed>org.teiid.retroruntime</embed>
+ <destjar>target/teiid-${pom.version}-client-jdk15.jar</destjar>
+ <verify>false</verify>
+ <failonwarning>true</failonwarning>
+ <includes>
+ <include>
+ <directory>target</directory>
+ <pattern>teiid-${pom.version}-client.jar</pattern>
+ </include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</profile>
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.IOException;
+
+public class _IOException {
+ public static IOException createNewInstance(Throwable t){
+ IOException io = new IOException();
+ io.initCause(t);
+ return io;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_IOException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.io;
+
+import java.io.ObjectStreamClass;
+import java.lang.reflect.Method;
+
+public class _ObjectStreamClass {
+ public static ObjectStreamClass lookupAny(Class<?> cl) {
+ try {
+ Method m = ObjectStreamClass.class.getDeclaredMethod("lookup",new Class[] { Class.class, Boolean.TYPE }); //$NON-NLS-1$
+ m.setAccessible(true);
+ return (ObjectStreamClass) m.invoke(null, new Object[] { cl,Boolean.valueOf(true) });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/io/_ObjectStreamClass.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.Clob;
+
+public abstract interface NClob_ extends Clob
+{
+}
\ No newline at end of file
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/NClob_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public interface RowId_ {
+ boolean equals(Object obj);
+ byte[] getBytes();
+ String toString();
+ int hashCode();
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/RowId_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLClientInfoException_ extends SQLException {
+
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLClientInfoException_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class SQLFeatureNotSupportedException_ extends SQLException {
+
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLFeatureNotSupportedException_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.sql.SQLException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+public abstract interface SQLXML_
+{
+ public abstract void free()
+ throws SQLException;
+
+ public abstract InputStream getBinaryStream()
+ throws SQLException;
+
+ public abstract OutputStream setBinaryStream()
+ throws SQLException;
+
+ public abstract Reader getCharacterStream()
+ throws SQLException;
+
+ public abstract Writer setCharacterStream()
+ throws SQLException;
+
+ public abstract String getString()
+ throws SQLException;
+
+ public abstract void setString(String paramString)
+ throws SQLException;
+
+ public abstract <T extends Source> T getSource(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract <T extends Result> T setResult(Class<T> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/SQLXML_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public abstract interface Wrapper_
+{
+ public abstract <T> T unwrap(Class<T> paramClass)
+ throws SQLException;
+
+ public abstract boolean isWrapperFor(Class<?> paramClass)
+ throws SQLException;
+}
\ No newline at end of file
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/Wrapper_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLException;
+
+public class _SQLException {
+ public static SQLException createNewInstance(Throwable t){
+ SQLException sql = new SQLException();
+ sql.initCause(t);
+ return sql;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLException.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+import java.sql.SQLWarning;
+
+public class _SQLWarning {
+ public static SQLWarning createNewInstance(Throwable t){
+ SQLWarning sql = new SQLWarning();
+ sql.initCause(t);
+ return sql;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_SQLWarning.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.sql;
+
+public class _Types {
+ public final static int ROWID = -8;
+ public static final int NCHAR = -15;
+ public static final int NVARCHAR = -9;
+ public static final int LONGNVARCHAR = -16;
+ public static final int NCLOB = 2011;
+ public static final int SQLXML = 2009;
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/sql/_Types.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.java.util;
+
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+public class _Properties {
+
+ public static Set<String> stringPropertyNames(Properties props) {
+ return new HashSet<String>(Collections.list((Enumeration<String>)props.propertyNames()));
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/java/util/_Properties.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.javax.net.ssl;
+
+import java.security.NoSuchAlgorithmException;
+
+import javax.net.ssl.SSLContext;
+
+public class _SSLContext {
+ public static SSLContext getDefault() throws NoSuchAlgorithmException {
+ return SSLContext.getInstance("TLSv1"); //$NON-NLS-1$
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/javax/net/ssl/_SSLContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
===================================================================
--- trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java (rev 0)
+++ trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java 2011-04-07 20:21:17 UTC (rev 3077)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @author tags. See the COPYRIGHT.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package net.sf.retrotranslator.runtime.org.teiid.core.types.basic;
+
+import java.io.Reader;
+
+import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.Transform;
+import org.teiid.core.types.TransformationException;
+import org.teiid.core.types.XMLType.Type;
+
+public class StringToSQLXMLTransform_ extends Transform {
+
+ public static Type isXml(Reader reader) throws TransformationException {
+ return Type.UNKNOWN;
+ }
+
+ /**
+ * This method transforms a value of the source type into a value
+ * of the target type.
+ * @param value Incoming value of source type
+ * @return Outgoing value of target type
+ * @throws TransformationException if value is an incorrect input type or
+ * the transformation fails
+ */
+ public Object transformDirect(Object value) throws TransformationException {
+ throw new UnsupportedOperationException();
+ }
+
+
+
+ /**
+ * Type of the incoming value.
+ * @return Source type
+ */
+ public Class<?> getSourceType() {
+ return DataTypeManager.DefaultDataClasses.STRING;
+ }
+
+ /**
+ * Type of the outgoing value.
+ * @return Target type
+ */
+ public Class<?> getTargetType() {
+ return DataTypeManager.DefaultDataClasses.XML;
+ }
+
+ @Override
+ public boolean isExplicit() {
+ return true;
+ }
+}
Property changes on: trunk/client/src/main/java/net/sf/retrotranslator/runtime/org/teiid/core/types/basic/StringToSQLXMLTransform_.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 9 months