[teiid-commits] teiid SVN: r1571 - in trunk: connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc and 13 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Nov 18 10:26:24 EST 2009


Author: shawkins
Date: 2009-11-18 10:26:22 -0500 (Wed, 18 Nov 2009)
New Revision: 1571

Added:
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Column.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSet.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Datatype.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKey.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameter.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Schema.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/SchemaObject.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Table.java
Removed:
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSetRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/DatatypeRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKeyRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ModelRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameterRecordImpl.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/TableRecordImpl.java
Modified:
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/AbstractMetadataRecord.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/BaseColumn.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/KeyRecord.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataFactory.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataStore.java
   trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureRecordImpl.java
   trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCMetdataProcessor.java
   trunk/connectors/connector-text/src/main/java/com/metamatrix/connector/text/TextConnector.java
   trunk/connectors/connector-text/src/test/java/com/metamatrix/connector/text/TestTextConnector.java
   trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
   trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java
   trunk/engine/src/main/java/com/metamatrix/query/parser/SQLParserUtil.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
   trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
   trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
   trunk/engine/src/main/javacc/com/metamatrix/query/parser/SQLParser.jj
   trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java
   trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
   trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
   trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
   trunk/metadata/src/test/java/com/metamatrix/metadata/runtime/FakeMetadataService.java
   trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedMetadataService.java
Log:
TEIID-869 TEIID-883 intermediate cleanup of metadata removing parsing logic that supported modelerid and / in identifiers

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/AbstractMetadataRecord.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/AbstractMetadataRecord.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/AbstractMetadataRecord.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -77,11 +77,6 @@
 		this.name = name;
 	}
 	
-    public String getModelName() {
-		int prntIdx = fullName.indexOf(NAME_DELIM_CHAR);
-		return fullName.substring(0, prntIdx);
-    }
-	
     public String toString() {
     	StringBuffer sb = new StringBuffer(100);
         sb.append(getClass().getSimpleName());

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/BaseColumn.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/BaseColumn.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/BaseColumn.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -44,7 +44,7 @@
     private int precision;
     private NullType nullType;
     private int position;
-    private DatatypeRecordImpl datatype;
+    private Datatype datatype;
 
     public String getDefaultValue() {
         return defaultValue;
@@ -121,11 +121,11 @@
 		defaultValue = object;
 	}
 
-    public DatatypeRecordImpl getDatatype() {
+    public Datatype getDatatype() {
 		return datatype;
 	}
     
-    public void setDatatype(DatatypeRecordImpl datatype) {
+    public void setDatatype(Datatype datatype) {
 		this.datatype = datatype;
 	}
 

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Column.java (from rev 1550, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Column.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Column.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,240 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+
+/**
+ * ColumnRecordImpl
+ */
+public class Column extends BaseColumn implements Comparable<Column> {
+
+	public enum SearchType {
+		Unsearchable,
+		Like_Only {
+			@Override
+			public String toString() {
+				return "Like Only"; //$NON-NLS-1$ 
+			}
+		},
+		All_Except_Like {
+			@Override
+			public String toString() {
+				return "All Except Like"; //$NON-NLS-1$
+			}
+		},
+		Searchable
+	}
+	
+    private boolean selectable = true;
+    private boolean updatable;
+    private boolean autoIncrementable;
+    private boolean caseSensitive;
+    private boolean signed;
+    private boolean currency;
+    private boolean fixedLength;
+    private SearchType searchType;
+    private String minValue;
+    private String maxValue;
+    private String nativeType;
+    private String format;
+    private int charOctetLength;
+    private int distinctValues = -1;
+    private int nullValues = -1;
+
+    @Override
+    public int compareTo(Column record) {
+    	return this.getPosition() - record.getPosition();
+    }
+    
+    public int getCharOctetLength() {
+        return charOctetLength;
+    }
+
+    public String getMaxValue() {
+        return maxValue;
+    }
+
+    public String getMinValue() {
+        return minValue;
+    }
+
+    public SearchType getSearchType() {
+    	if (searchType == null) {
+    		return this.getDatatype().getSearchType();
+    	}
+        return searchType;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public boolean isAutoIncrementable() {
+        return autoIncrementable;
+    }
+
+    public boolean isCaseSensitive() {
+        return caseSensitive;
+    }
+
+    public boolean isCurrency() {
+        return currency;
+    }
+
+    public boolean isFixedLength() {
+        return fixedLength;
+    }
+
+    public boolean isSelectable() {
+        return selectable;
+    }
+
+    public boolean isSigned() {
+        return signed;
+    }
+
+    public boolean isUpdatable() {
+        return updatable;
+    }
+
+    public String getNativeType() {
+        return nativeType;
+    }
+
+    public int getDistinctValues() {
+        return this.distinctValues;
+    }
+
+    public int getNullValues() {
+        return this.nullValues;
+    }
+
+    /**
+     * @param b
+     */
+    public void setAutoIncrementable(boolean b) {
+        autoIncrementable = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setCaseSensitive(boolean b) {
+        caseSensitive = b;
+    }
+
+    /**
+     * @param i
+     */
+    public void setCharOctetLength(int i) {
+        charOctetLength = i;
+    }
+
+    /**
+     * @param b
+     */
+    public void setCurrency(boolean b) {
+        currency = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setFixedLength(boolean b) {
+        fixedLength = b;
+    }
+
+    /**
+     * @param object
+     */
+    public void setMaxValue(String object) {
+        maxValue = object;
+    }
+
+    /**
+     * @param object
+     */
+    public void setMinValue(String object) {
+        minValue = object;
+    }
+
+    /**
+     * @param s
+     */
+    public void setSearchType(SearchType s) {
+        searchType = s;
+    }
+
+    /**
+     * @param b
+     */
+    public void setSelectable(boolean b) {
+        selectable = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setSigned(boolean b) {
+        signed = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setUpdatable(boolean b) {
+        updatable = b;
+    }
+
+    /**
+     * @param string
+     */
+    public void setFormat(String string) {
+        format = string;
+    }
+
+    /**
+     * @param distinctValues The distinctValues to set.
+     * @since 4.3
+     */
+    public void setDistinctValues(int distinctValues) {
+        this.distinctValues = distinctValues;
+    }
+
+    /**
+     * @param nullValues The nullValues to set.
+     * @since 4.3
+     */
+    public void setNullValues(int nullValues) {
+        this.nullValues = nullValues;
+    }
+
+    /**
+     * @param nativeType The nativeType to set.
+     * @since 4.2
+     */
+    public void setNativeType(String nativeType) {
+        this.nativeType = nativeType;
+    }
+
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Column.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,240 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-
-/**
- * ColumnRecordImpl
- */
-public class ColumnRecordImpl extends BaseColumn implements Comparable<ColumnRecordImpl> {
-
-	public enum SearchType {
-		Unsearchable,
-		Like_Only {
-			@Override
-			public String toString() {
-				return "Like Only"; //$NON-NLS-1$ 
-			}
-		},
-		All_Except_Like {
-			@Override
-			public String toString() {
-				return "All Except Like"; //$NON-NLS-1$
-			}
-		},
-		Searchable
-	}
-	
-    private boolean selectable = true;
-    private boolean updatable;
-    private boolean autoIncrementable;
-    private boolean caseSensitive;
-    private boolean signed;
-    private boolean currency;
-    private boolean fixedLength;
-    private SearchType searchType;
-    private String minValue;
-    private String maxValue;
-    private String nativeType;
-    private String format;
-    private int charOctetLength;
-    private int distinctValues = -1;
-    private int nullValues = -1;
-
-    @Override
-    public int compareTo(ColumnRecordImpl record) {
-    	return this.getPosition() - record.getPosition();
-    }
-    
-    public int getCharOctetLength() {
-        return charOctetLength;
-    }
-
-    public String getMaxValue() {
-        return maxValue;
-    }
-
-    public String getMinValue() {
-        return minValue;
-    }
-
-    public SearchType getSearchType() {
-    	if (searchType == null) {
-    		return this.getDatatype().getSearchType();
-    	}
-        return searchType;
-    }
-
-    public String getFormat() {
-        return format;
-    }
-
-    public boolean isAutoIncrementable() {
-        return autoIncrementable;
-    }
-
-    public boolean isCaseSensitive() {
-        return caseSensitive;
-    }
-
-    public boolean isCurrency() {
-        return currency;
-    }
-
-    public boolean isFixedLength() {
-        return fixedLength;
-    }
-
-    public boolean isSelectable() {
-        return selectable;
-    }
-
-    public boolean isSigned() {
-        return signed;
-    }
-
-    public boolean isUpdatable() {
-        return updatable;
-    }
-
-    public String getNativeType() {
-        return nativeType;
-    }
-
-    public int getDistinctValues() {
-        return this.distinctValues;
-    }
-
-    public int getNullValues() {
-        return this.nullValues;
-    }
-
-    /**
-     * @param b
-     */
-    public void setAutoIncrementable(boolean b) {
-        autoIncrementable = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setCaseSensitive(boolean b) {
-        caseSensitive = b;
-    }
-
-    /**
-     * @param i
-     */
-    public void setCharOctetLength(int i) {
-        charOctetLength = i;
-    }
-
-    /**
-     * @param b
-     */
-    public void setCurrency(boolean b) {
-        currency = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setFixedLength(boolean b) {
-        fixedLength = b;
-    }
-
-    /**
-     * @param object
-     */
-    public void setMaxValue(String object) {
-        maxValue = object;
-    }
-
-    /**
-     * @param object
-     */
-    public void setMinValue(String object) {
-        minValue = object;
-    }
-
-    /**
-     * @param s
-     */
-    public void setSearchType(SearchType s) {
-        searchType = s;
-    }
-
-    /**
-     * @param b
-     */
-    public void setSelectable(boolean b) {
-        selectable = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setSigned(boolean b) {
-        signed = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setUpdatable(boolean b) {
-        updatable = b;
-    }
-
-    /**
-     * @param string
-     */
-    public void setFormat(String string) {
-        format = string;
-    }
-
-    /**
-     * @param distinctValues The distinctValues to set.
-     * @since 4.3
-     */
-    public void setDistinctValues(int distinctValues) {
-        this.distinctValues = distinctValues;
-    }
-
-    /**
-     * @param nullValues The nullValues to set.
-     * @since 4.3
-     */
-    public void setNullValues(int nullValues) {
-        this.nullValues = nullValues;
-    }
-
-    /**
-     * @param nativeType The nativeType to set.
-     * @since 4.2
-     */
-    public void setNativeType(String nativeType) {
-        this.nativeType = nativeType;
-    }
-
-}
\ No newline at end of file

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSet.java (from rev 1545, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSetRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSet.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSet.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+import java.util.List;
+
+/**
+ * ColumnSetRecordImpl
+ */
+public class ColumnSet extends AbstractMetadataRecord {
+	
+    private List<Column> columns;
+    
+    public List<Column> getColumns() {
+    	return columns;
+    }
+
+    public void setColumns(List<Column> columns) {
+		this.columns = columns;
+	}
+
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSet.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSetRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSetRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ColumnSetRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-import java.util.List;
-
-/**
- * ColumnSetRecordImpl
- */
-public class ColumnSetRecordImpl extends AbstractMetadataRecord {
-	
-    private List<ColumnRecordImpl> columns;
-    
-    public List<ColumnRecordImpl> getColumns() {
-    	return columns;
-    }
-
-    public void setColumns(List<ColumnRecordImpl> columns) {
-		this.columns = columns;
-	}
-
-}
\ No newline at end of file

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Datatype.java (from rev 1550, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/DatatypeRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Datatype.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Datatype.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,282 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
+import org.teiid.connector.metadata.runtime.Column.SearchType;
+
+
+
+/**
+ * ColumnRecordImpl
+ */
+public class Datatype extends AbstractMetadataRecord {
+	
+	public enum Type {
+		Basic,
+		UserDefined,
+		ResultSet
+	}
+	
+	public enum Variety {
+		Atomic,
+		List,
+		Union,
+		Complex
+	}
+
+	/** Delimiter used to separate the URI string from the URI fragment */
+    public static final String URI_REFERENCE_DELIMITER = "#"; //$NON-NLS-1$
+	
+    private static final String DEFAULT_JAVA_CLASS_NAME = "java.lang.Object";  //$NON-NLS-1$
+
+    private int length;
+    private int precisionLength;
+    private int scale;
+    private int radix;
+    private boolean isSigned;
+    private boolean isAutoIncrement;
+    private boolean isCaseSensitive;
+    private Type type;
+    private SearchType searchType;
+    private NullType nullType;
+    private String javaClassName = DEFAULT_JAVA_CLASS_NAME;
+    private String runtimeTypeName;
+    private String datatypeID;
+    private String basetypeID;
+    private String primitiveTypeID;
+    private Variety varietyType;
+
+    public int getLength() {
+        return this.length;
+    }
+
+    public int getPrecisionLength() {
+        return this.precisionLength;
+    }
+
+    public int getScale() {
+        return this.scale;
+    }
+
+    public int getRadix() {
+        return this.radix;
+    }
+
+    public boolean isSigned() {
+        return this.isSigned;
+    }
+
+    public boolean isAutoIncrement() {
+        return this.isAutoIncrement;
+    }
+
+    public boolean isCaseSensitive() {
+        return this.isCaseSensitive;
+    }
+
+    public Type getType() {
+        return this.type;
+    }
+
+    public boolean isBuiltin() {
+        return getType() == Type.Basic;
+    }
+
+
+    public SearchType getSearchType() {
+        return this.searchType;
+    }
+
+    public NullType getNullType() {
+    	if (this.nullType == null) {
+    		return NullType.Unknown;
+    	}
+        return this.nullType;
+    }
+
+    public String getJavaClassName() {
+        return this.javaClassName;
+    }
+
+    public String getRuntimeTypeName() {
+        return this.runtimeTypeName;
+    }
+
+    public String getDatatypeID() {
+        return this.datatypeID;
+    }
+
+    public String getBasetypeID() {
+        return this.basetypeID;
+    }
+
+    public String getBasetypeName() {
+        if ( this.basetypeID != null ) {
+            final int i = getBasetypeID().lastIndexOf(URI_REFERENCE_DELIMITER);
+            if ( i != -1 && getBasetypeID().length() > (i+1)) {
+                return getBasetypeID().substring(i+1);
+            }
+        }
+        return null;
+    }
+
+    public String getPrimitiveTypeID() {
+        return this.primitiveTypeID;
+    }
+
+    public Variety getVarietyType() {
+        return this.varietyType;
+    }
+
+    /**
+     * @param string
+     */
+    public void setBasetypeID(String string) {
+        basetypeID = string;
+    }
+
+    /**
+     * @param string
+     */
+    public void setPrimitiveTypeID(String string) {
+        primitiveTypeID = string;
+    }
+
+    /**
+     * @param b
+     */
+    public void setAutoIncrement(boolean b) {
+        isAutoIncrement = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setCaseSensitive(boolean b) {
+        isCaseSensitive = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setSigned(boolean b) {
+        isSigned = b;
+    }
+
+    /**
+     * @param string
+     */
+    public void setJavaClassName(String string) {
+        javaClassName = string;
+    }
+
+    /**
+     * @param i
+     */
+    public void setLength(int i) {
+        length = i;
+    }
+
+    /**
+     * @param s
+     */
+    public void setNullType(NullType s) {
+        nullType = s;
+    }
+
+    /**
+     * @param i
+     */
+    public void setPrecisionLength(int i) {
+        precisionLength = i;
+    }
+
+    /**
+     * @param i
+     */
+    public void setRadix(int i) {
+        radix = i;
+    }
+
+    /**
+     * @param string
+     */
+    public void setRuntimeTypeName(String string) {
+        runtimeTypeName = string;
+    }
+
+    /**
+     * @param i
+     */
+    public void setScale(int i) {
+        scale = i;
+    }
+
+    /**
+     * @param s
+     */
+    public void setSearchType(SearchType s) {
+        searchType = s;
+    }
+
+    /**
+     * @param s
+     */
+    public void setType(Type s) {
+        type = s;
+    }
+
+    /**
+     * @param string
+     */
+    public void setDatatypeID(String string) {
+        datatypeID = string;
+    }
+
+    /**
+     * @param s
+     */
+    public void setVarietyType(Variety s) {
+        varietyType = s;
+    }
+
+    public String toString() {
+        StringBuffer sb = new StringBuffer(100);
+        sb.append(getClass().getSimpleName());
+        sb.append(" name="); //$NON-NLS-1$
+        sb.append(getName());
+        sb.append(", basetype name="); //$NON-NLS-1$
+        sb.append(getBasetypeName());
+        sb.append(", runtimeType="); //$NON-NLS-1$
+        sb.append(getRuntimeTypeName());
+        sb.append(", javaClassName="); //$NON-NLS-1$
+        sb.append(getJavaClassName());
+        sb.append(", ObjectID="); //$NON-NLS-1$
+        sb.append(getUUID());
+        sb.append(", datatypeID="); //$NON-NLS-1$
+        sb.append(getDatatypeID());
+        return sb.toString();
+    }
+
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Datatype.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/DatatypeRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/DatatypeRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/DatatypeRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,282 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl.SearchType;
-
-
-
-/**
- * ColumnRecordImpl
- */
-public class DatatypeRecordImpl extends AbstractMetadataRecord {
-	
-	public enum Type {
-		Basic,
-		UserDefined,
-		ResultSet
-	}
-	
-	public enum Variety {
-		Atomic,
-		List,
-		Union,
-		Complex
-	}
-
-	/** Delimiter used to separate the URI string from the URI fragment */
-    public static final String URI_REFERENCE_DELIMITER = "#"; //$NON-NLS-1$
-	
-    private static final String DEFAULT_JAVA_CLASS_NAME = "java.lang.Object";  //$NON-NLS-1$
-
-    private int length;
-    private int precisionLength;
-    private int scale;
-    private int radix;
-    private boolean isSigned;
-    private boolean isAutoIncrement;
-    private boolean isCaseSensitive;
-    private Type type;
-    private SearchType searchType;
-    private NullType nullType;
-    private String javaClassName = DEFAULT_JAVA_CLASS_NAME;
-    private String runtimeTypeName;
-    private String datatypeID;
-    private String basetypeID;
-    private String primitiveTypeID;
-    private Variety varietyType;
-
-    public int getLength() {
-        return this.length;
-    }
-
-    public int getPrecisionLength() {
-        return this.precisionLength;
-    }
-
-    public int getScale() {
-        return this.scale;
-    }
-
-    public int getRadix() {
-        return this.radix;
-    }
-
-    public boolean isSigned() {
-        return this.isSigned;
-    }
-
-    public boolean isAutoIncrement() {
-        return this.isAutoIncrement;
-    }
-
-    public boolean isCaseSensitive() {
-        return this.isCaseSensitive;
-    }
-
-    public Type getType() {
-        return this.type;
-    }
-
-    public boolean isBuiltin() {
-        return getType() == Type.Basic;
-    }
-
-
-    public SearchType getSearchType() {
-        return this.searchType;
-    }
-
-    public NullType getNullType() {
-    	if (this.nullType == null) {
-    		return NullType.Unknown;
-    	}
-        return this.nullType;
-    }
-
-    public String getJavaClassName() {
-        return this.javaClassName;
-    }
-
-    public String getRuntimeTypeName() {
-        return this.runtimeTypeName;
-    }
-
-    public String getDatatypeID() {
-        return this.datatypeID;
-    }
-
-    public String getBasetypeID() {
-        return this.basetypeID;
-    }
-
-    public String getBasetypeName() {
-        if ( this.basetypeID != null ) {
-            final int i = getBasetypeID().lastIndexOf(URI_REFERENCE_DELIMITER);
-            if ( i != -1 && getBasetypeID().length() > (i+1)) {
-                return getBasetypeID().substring(i+1);
-            }
-        }
-        return null;
-    }
-
-    public String getPrimitiveTypeID() {
-        return this.primitiveTypeID;
-    }
-
-    public Variety getVarietyType() {
-        return this.varietyType;
-    }
-
-    /**
-     * @param string
-     */
-    public void setBasetypeID(String string) {
-        basetypeID = string;
-    }
-
-    /**
-     * @param string
-     */
-    public void setPrimitiveTypeID(String string) {
-        primitiveTypeID = string;
-    }
-
-    /**
-     * @param b
-     */
-    public void setAutoIncrement(boolean b) {
-        isAutoIncrement = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setCaseSensitive(boolean b) {
-        isCaseSensitive = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setSigned(boolean b) {
-        isSigned = b;
-    }
-
-    /**
-     * @param string
-     */
-    public void setJavaClassName(String string) {
-        javaClassName = string;
-    }
-
-    /**
-     * @param i
-     */
-    public void setLength(int i) {
-        length = i;
-    }
-
-    /**
-     * @param s
-     */
-    public void setNullType(NullType s) {
-        nullType = s;
-    }
-
-    /**
-     * @param i
-     */
-    public void setPrecisionLength(int i) {
-        precisionLength = i;
-    }
-
-    /**
-     * @param i
-     */
-    public void setRadix(int i) {
-        radix = i;
-    }
-
-    /**
-     * @param string
-     */
-    public void setRuntimeTypeName(String string) {
-        runtimeTypeName = string;
-    }
-
-    /**
-     * @param i
-     */
-    public void setScale(int i) {
-        scale = i;
-    }
-
-    /**
-     * @param s
-     */
-    public void setSearchType(SearchType s) {
-        searchType = s;
-    }
-
-    /**
-     * @param s
-     */
-    public void setType(Type s) {
-        type = s;
-    }
-
-    /**
-     * @param string
-     */
-    public void setDatatypeID(String string) {
-        datatypeID = string;
-    }
-
-    /**
-     * @param s
-     */
-    public void setVarietyType(Variety s) {
-        varietyType = s;
-    }
-
-    public String toString() {
-        StringBuffer sb = new StringBuffer(100);
-        sb.append(getClass().getSimpleName());
-        sb.append(" name="); //$NON-NLS-1$
-        sb.append(getName());
-        sb.append(", basetype name="); //$NON-NLS-1$
-        sb.append(getBasetypeName());
-        sb.append(", runtimeType="); //$NON-NLS-1$
-        sb.append(getRuntimeTypeName());
-        sb.append(", javaClassName="); //$NON-NLS-1$
-        sb.append(getJavaClassName());
-        sb.append(", ObjectID="); //$NON-NLS-1$
-        sb.append(getUUID());
-        sb.append(", datatypeID="); //$NON-NLS-1$
-        sb.append(getDatatypeID());
-        return sb.toString();
-    }
-
-}
\ No newline at end of file

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKey.java (from rev 1545, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKeyRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKey.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKey.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+/**
+ * ForeignKeyRecordImpl
+ */
+public class ForeignKey extends KeyRecord {
+
+    private String uniqueKeyID;
+    private KeyRecord primaryKey;
+    
+    public ForeignKey() {
+		super(Type.Foreign);
+	}
+    
+    public String getUniqueKeyID() {
+        return uniqueKeyID;
+    }
+
+    /**
+     * @param object
+     */
+    public void setUniqueKeyID(String keyID) {
+        uniqueKeyID = keyID;
+    }    
+    
+    public KeyRecord getPrimaryKey() {
+    	return this.primaryKey;
+    }
+    
+    public void setPrimaryKey(KeyRecord primaryKey) {
+		this.primaryKey = primaryKey;
+	}
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKey.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKeyRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKeyRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ForeignKeyRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-/**
- * ForeignKeyRecordImpl
- */
-public class ForeignKeyRecordImpl extends KeyRecord {
-
-    private String uniqueKeyID;
-    private KeyRecord primaryKey;
-    
-    public ForeignKeyRecordImpl() {
-		super(Type.Foreign);
-	}
-    
-    public String getUniqueKeyID() {
-        return uniqueKeyID;
-    }
-
-    /**
-     * @param object
-     */
-    public void setUniqueKeyID(String keyID) {
-        uniqueKeyID = keyID;
-    }    
-    
-    public KeyRecord getPrimaryKey() {
-    	return this.primaryKey;
-    }
-    
-    public void setPrimaryKey(KeyRecord primaryKey) {
-		this.primaryKey = primaryKey;
-	}
-}
\ No newline at end of file

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/KeyRecord.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/KeyRecord.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/KeyRecord.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -22,7 +22,7 @@
 
 package org.teiid.connector.metadata.runtime;
 
-public class KeyRecord extends ColumnSetRecordImpl {
+public class KeyRecord extends ColumnSet {
 
 	public enum Type {
 		Primary,
@@ -34,7 +34,7 @@
 	}
 	
 	private Type type;
-	private TableRecordImpl table;
+	private Table table;
 
 	public KeyRecord(Type type) {
 		this.type = type;
@@ -44,11 +44,11 @@
 		return type;
 	}
 	
-	public TableRecordImpl getTable() {
+	public Table getTable() {
 		return table;
 	}
 	
-	public void setTable(TableRecordImpl table) {
+	public void setTable(Table table) {
 		this.table = table;
 	}
 	

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataFactory.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataFactory.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataFactory.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -33,7 +33,6 @@
 import org.teiid.connector.DataPlugin;
 import org.teiid.connector.api.ConnectorException;
 import org.teiid.connector.api.TypeFacility;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl.Type;
 
 import com.metamatrix.core.id.UUIDFactory;
 
@@ -45,22 +44,22 @@
  */
 public class MetadataFactory {
 	
-	private ModelRecordImpl model;
+	private Schema model;
 	private UUIDFactory factory = new UUIDFactory();
-	private Map<String, DatatypeRecordImpl> dataTypes;
+	private Map<String, Datatype> dataTypes;
 	private Properties importProperties;
 	private MetadataStore store = new MetadataStore();
 	private Set<String> uniqueNames = new HashSet<String>();
 	
-	public MetadataFactory(String modelName, Map<String, DatatypeRecordImpl> dataTypes, Properties importProperties) {
+	public MetadataFactory(String modelName, Map<String, Datatype> dataTypes, Properties importProperties) {
 		this.dataTypes = dataTypes;
 		this.importProperties = importProperties;
-		model = new ModelRecordImpl();
+		model = new Schema();
 		model.setName(modelName);
-		model.setModelType(Type.Physical);
+		model.setPhysical(true);
 		model.setPrimaryMetamodelUri("http://www.metamatrix.com/metamodels/Relational"); //$NON-NLS-1$
 		setUUID(model);	
-		store.addModel(model);
+		store.addSchema(model);
 	}
 	
 	public MetadataStore getMetadataStore() {
@@ -90,17 +89,17 @@
 	 * @return
 	 * @throws ConnectorException 
 	 */
-	public TableRecordImpl addTable(String name) throws ConnectorException {
-		TableRecordImpl table = new TableRecordImpl();
-		table.setTableType(TableRecordImpl.Type.Table);
+	public Table addTable(String name) throws ConnectorException {
+		Table table = new Table();
+		table.setTableType(Table.Type.Table);
 		setValuesUsingParent(name, model, table, "table"); //$NON-NLS-1$
-		table.setColumns(new LinkedList<ColumnRecordImpl>());
+		table.setColumns(new LinkedList<Column>());
 		table.setAccessPatterns(new LinkedList<KeyRecord>());
 		table.setIndexes(new LinkedList<KeyRecord>());
-		table.setForiegnKeys(new LinkedList<ForeignKeyRecordImpl>());
+		table.setForiegnKeys(new LinkedList<ForeignKey>());
 		table.setUniqueKeys(new LinkedList<KeyRecord>());
 		setUUID(table);
-		this.store.addTable(table);
+		this.model.addTable(table);
 		return table;
 	}
 	
@@ -112,12 +111,12 @@
 	 * @return
 	 * @throws ConnectorException
 	 */
-	public ColumnRecordImpl addColumn(String name, String type, ColumnSetRecordImpl table) throws ConnectorException {
-		ColumnRecordImpl column = new ColumnRecordImpl();
+	public Column addColumn(String name, String type, ColumnSet table) throws ConnectorException {
+		Column column = new Column();
 		setValuesUsingParent(name, table, column, "column"); //$NON-NLS-1$
 		table.getColumns().add(column);
 		column.setPosition(table.getColumns().size()); //1 based indexing
-		DatatypeRecordImpl datatype = setColumnType(type, column);
+		Datatype datatype = setColumnType(type, column);
 		column.setCaseSensitive(datatype.isCaseSensitive());
 		column.setAutoIncrementable(datatype.isAutoIncrement());
 		column.setSigned(datatype.isSigned());		
@@ -125,9 +124,9 @@
 		return column;
 	}
 
-	private DatatypeRecordImpl setColumnType(String type,
+	private Datatype setColumnType(String type,
 			BaseColumn column) throws ConnectorException {
-		DatatypeRecordImpl datatype = dataTypes.get(type);
+		Datatype datatype = dataTypes.get(type);
 		if (datatype == null) {
 			throw new ConnectorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
 		}
@@ -148,10 +147,10 @@
 	 * @return
 	 * @throws ConnectorException
 	 */
-	public ColumnSetRecordImpl addPrimaryKey(String name, List<String> columnNames, TableRecordImpl table) throws ConnectorException {
+	public ColumnSet addPrimaryKey(String name, List<String> columnNames, Table table) throws ConnectorException {
 		KeyRecord primaryKey = new KeyRecord(KeyRecord.Type.Primary);
 		primaryKey.setTable(table);
-		primaryKey.setColumns(new ArrayList<ColumnRecordImpl>(columnNames.size()));
+		primaryKey.setColumns(new ArrayList<Column>(columnNames.size()));
 		setValuesUsingParent(name, table, primaryKey, "pk"); //$NON-NLS-1$
 		setUUID(primaryKey);
 		assignColumns(columnNames, table, primaryKey);
@@ -167,10 +166,10 @@
 	 * @return
 	 * @throws ConnectorException
 	 */
-	public KeyRecord addAccessPattern(String name, List<String> columnNames, TableRecordImpl table) throws ConnectorException {
+	public KeyRecord addAccessPattern(String name, List<String> columnNames, Table table) throws ConnectorException {
 		KeyRecord ap = new KeyRecord(KeyRecord.Type.AccessPattern);
 		ap.setTable(table);
-		ap.setColumns(new ArrayList<ColumnRecordImpl>(columnNames.size()));
+		ap.setColumns(new ArrayList<Column>(columnNames.size()));
 		setValuesUsingParent(name, table, ap, "index"); //$NON-NLS-1$
 		setUUID(ap);
 		assignColumns(columnNames, table, ap);
@@ -187,10 +186,10 @@
 	 * @return
 	 * @throws ConnectorException
 	 */
-	public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, TableRecordImpl table) throws ConnectorException {
+	public KeyRecord addIndex(String name, boolean nonUnique, List<String> columnNames, Table table) throws ConnectorException {
 		KeyRecord index = new KeyRecord(nonUnique?KeyRecord.Type.NonUnique:KeyRecord.Type.Index);
 		index.setTable(table);
-		index.setColumns(new ArrayList<ColumnRecordImpl>(columnNames.size()));
+		index.setColumns(new ArrayList<Column>(columnNames.size()));
 		setValuesUsingParent(name, table, index, "index"); //$NON-NLS-1$
 		setUUID(index);
 		assignColumns(columnNames, table, index);
@@ -207,10 +206,10 @@
 	 * @return
 	 * @throws ConnectorException
 	 */
-	public ForeignKeyRecordImpl addForiegnKey(String name, List<String> columnNames, TableRecordImpl pkTable, TableRecordImpl table) throws ConnectorException {
-		ForeignKeyRecordImpl foreignKey = new ForeignKeyRecordImpl();
+	public ForeignKey addForiegnKey(String name, List<String> columnNames, Table pkTable, Table table) throws ConnectorException {
+		ForeignKey foreignKey = new ForeignKey();
 		foreignKey.setTable(table);
-		foreignKey.setColumns(new ArrayList<ColumnRecordImpl>(columnNames.size()));
+		foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
 		setValuesUsingParent(name, table, foreignKey, "fk"); //$NON-NLS-1$
 		setUUID(foreignKey);
 		if (pkTable.getPrimaryKey() == null) {
@@ -233,8 +232,8 @@
 		ProcedureRecordImpl procedure = new ProcedureRecordImpl();
 		setValuesUsingParent(name, this.model, procedure, "proc"); //$NON-NLS-1$
 		setUUID(procedure);
-		procedure.setParameters(new LinkedList<ProcedureParameterRecordImpl>());
-		this.store.addProcedure(procedure);
+		procedure.setParameters(new LinkedList<ProcedureParameter>());
+		this.model.addProcedure(procedure);
 		return procedure;
 	}
 	
@@ -242,13 +241,13 @@
 	 * Add a procedure parameter.
 	 * @param name
 	 * @param type should be one of {@link TypeFacility.RUNTIME_NAMES}
-	 * @param parameterType should be one of {@link ProcedureParameterRecordImpl.Type}
+	 * @param parameterType should be one of {@link ProcedureParameter.Type}
 	 * @param procedure
 	 * @return
 	 * @throws ConnectorException 
 	 */
-	public ProcedureParameterRecordImpl addProcedureParameter(String name, String type, ProcedureParameterRecordImpl.Type parameterType, ProcedureRecordImpl procedure) throws ConnectorException {
-		ProcedureParameterRecordImpl param = new ProcedureParameterRecordImpl();
+	public ProcedureParameter addProcedureParameter(String name, String type, ProcedureParameter.Type parameterType, ProcedureRecordImpl procedure) throws ConnectorException {
+		ProcedureParameter param = new ProcedureParameter();
 		setValuesUsingParent(name, procedure, param, "param"); //$NON-NLS-1$
 		setUUID(param);
 		param.setType(parameterType);
@@ -266,9 +265,9 @@
 	 * @return
 	 * @throws ConnectorException 
 	 */
-	public ColumnRecordImpl addProcedureResultSetColumn(String name, String type, ProcedureRecordImpl procedure) throws ConnectorException {
+	public Column addProcedureResultSetColumn(String name, String type, ProcedureRecordImpl procedure) throws ConnectorException {
 		if (procedure.getResultSet() == null) {
-			ColumnSetRecordImpl resultSet = new ColumnSetRecordImpl();
+			ColumnSet resultSet = new ColumnSet();
 			setValuesUsingParent("RESULT_SET", procedure, resultSet, "rs"); //$NON-NLS-1$ //$NON-NLS-2$
 			setUUID(resultSet);
 			procedure.setResultSet(resultSet);
@@ -277,11 +276,11 @@
 		return addColumn(name, type, procedure.getResultSet());
 	}
 
-	private void assignColumns(List<String> columnNames, TableRecordImpl table,
-			ColumnSetRecordImpl columns) throws ConnectorException {
+	private void assignColumns(List<String> columnNames, Table table,
+			ColumnSet columns) throws ConnectorException {
 		for (String columnName : columnNames) {
 			boolean match = false;
-			for (ColumnRecordImpl column : table.getColumns()) {
+			for (Column column : table.getColumns()) {
 				if (column.getName().equals(columnName)) {
 					match = true;
 					columns.getColumns().add(column);

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataStore.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataStore.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/MetadataStore.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -33,59 +33,27 @@
  */
 public class MetadataStore implements Serializable {
 
-	private static final long serialVersionUID = -5276588417872522795L;
-	private Map<String, ModelRecordImpl> models = new LinkedHashMap<String, ModelRecordImpl>();
-	private Map<String, TableRecordImpl> tables = new LinkedHashMap<String, TableRecordImpl>();
-	private Map<String, ProcedureRecordImpl> procedures = new LinkedHashMap<String, ProcedureRecordImpl>();
-	private Collection<DatatypeRecordImpl> datatypes = new ArrayList<DatatypeRecordImpl>();
+	private static final long serialVersionUID = -3130247626435324312L;
+	private Map<String, Schema> schemas = new LinkedHashMap<String, Schema>();
+	private Collection<Datatype> datatypes = new ArrayList<Datatype>();
 	
-	public void addModel(ModelRecordImpl model) {
-		this.models.put(model.getFullName().toLowerCase(), model);
+	public Map<String, Schema> getSchemas() {
+		return schemas;
 	}
 	
-	public void addTable(TableRecordImpl table) {
-		this.tables.put(table.getFullName().toLowerCase(), table);
+	public void addSchema(Schema schema) {
+		this.schemas.put(schema.getName().toLowerCase(), schema);
 	}
 	
-	public void addProcedure(ProcedureRecordImpl procedure) {
-		this.procedures.put(procedure.getFullName().toLowerCase(), procedure);
-	}
-	
-	public void addDatatype(DatatypeRecordImpl datatype) {
+	public void addDatatype(Datatype datatype) {
 		this.datatypes.add(datatype);
 	}
 		
 	/**
-	 * Get the models represented in this store.  
-	 * For a connector there will only be 1 model and the model name is treated as 
-	 * a top level schema for all source metadata.
-	 * @return
-	 */
-	public Map<String, ModelRecordImpl> getModels() {
-		return models;
-	}
-	
-	/**
-	 * Get the tables defined in this store
-	 * @return
-	 */
-	public Map<String, TableRecordImpl> getTables() {
-		return tables;
-	}
-	
-	/**
-	 * Get the procedures defined in this store
-	 * @return
-	 */
-	public Map<String, ProcedureRecordImpl> getProcedures() {
-		return procedures;
-	}
-	
-	/**
 	 * Get the datatypes defined in this store
 	 * @return
 	 */
-	public Collection<DatatypeRecordImpl> getDatatypes() {
+	public Collection<Datatype> getDatatypes() {
 		return datatypes;
 	}
 	

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ModelRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ModelRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ModelRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-
-/**
- * ModelRecordImpl
- */
-public class ModelRecordImpl extends AbstractMetadataRecord {
-
-	public enum Type {
-		Physical,
-		Virtual,
-		Type,
-		VDB_Archive() {
-			@Override
-			public String toString() {
-				return "VDB Archive"; //$NON-NLS-1$
-			}
-		},
-		Unknown,
-		Function,
-		Configuration,
-		Metamodel,
-		Extension,
-		Logical,
-		Materialization
-	}
-	
-    private Type modelType;
-    private boolean isVisible = true;
-    private String primaryMetamodelUri;
-
-    public String getPrimaryMetamodelUri() {
-        return primaryMetamodelUri;
-    }
-
-    public boolean isVisible() {
-        return isVisible;
-    }
-
-    public Type getModelType() {
-        return modelType;
-    }
-
-    public boolean isPhysical() {
-        return getModelType() == Type.Physical;
-    }
-
-    /**
-     * @param string
-     */
-    public void setPrimaryMetamodelUri(String string) {
-        primaryMetamodelUri = string;
-    }
-
-    /**
-     * @param b
-     */
-    public void setVisible(boolean b) {
-        isVisible = b;
-    }
-
-    /**
-     * @param i
-     */
-    public void setModelType(Type i) {
-        modelType = i;
-    }
-
-}

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameter.java (from rev 1545, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameterRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameter.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameter.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+
+/**
+ * ProcedureParameterRecordImpl
+ */
+public class ProcedureParameter extends BaseColumn {
+
+	public enum Type {
+		Unknown,
+		In,
+		InOut,
+		ResultSet,
+		Out,
+		ReturnValue
+	}
+	
+	private Type type;
+	private boolean optional;
+	
+	public void setType(Type type) {
+		this.type = type;
+	}
+	
+	public Type getType() {
+		return type;
+	}
+	
+	public void setOptional(boolean optional) {
+		this.optional = optional;
+	}
+	
+	public boolean isOptional() {
+		return optional;
+	}
+    
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameter.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameterRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameterRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureParameterRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-
-/**
- * ProcedureParameterRecordImpl
- */
-public class ProcedureParameterRecordImpl extends BaseColumn {
-
-	public enum Type {
-		Unknown,
-		In,
-		InOut,
-		ResultSet,
-		Out,
-		ReturnValue
-	}
-	
-	private Type type;
-	private boolean optional;
-	
-	public void setType(Type type) {
-		this.type = type;
-	}
-	
-	public Type getType() {
-		return type;
-	}
-	
-	public void setOptional(boolean optional) {
-		this.optional = optional;
-	}
-	
-	public boolean isOptional() {
-		return optional;
-	}
-    
-}
\ No newline at end of file

Modified: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ProcedureRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -28,7 +28,7 @@
 /**
  * ProcedureRecordImpl
  */
-public class ProcedureRecordImpl extends AbstractMetadataRecord {
+public class ProcedureRecordImpl extends AbstractMetadataRecord implements SchemaObject {
     
 	public enum Type {
 		Function,
@@ -42,10 +42,22 @@
     private boolean isVirtual;
     private String resultSetID;
     private int updateCount = 1;
-    private List<ProcedureParameterRecordImpl> parameters;
-    private ColumnSetRecordImpl resultSet;
+    private List<ProcedureParameter> parameters;
+    private ColumnSet resultSet;
     private String queryPlan;
     
+    private Schema schema;
+    
+    @Override
+    public Schema getSchema() {
+    	return schema;
+    }
+    
+    @Override
+    public void setSchema(Schema schema) {
+    	this.schema = schema;
+    }
+    
     public List<String> getParameterIDs() {
         return parameterIDs;
     }
@@ -79,11 +91,11 @@
         return this.updateCount;
     }
     
-	public List<ProcedureParameterRecordImpl> getParameters() {
+	public List<ProcedureParameter> getParameters() {
 		return parameters;
 	}
 
-	public void setParameters(List<ProcedureParameterRecordImpl> parameters) {
+	public void setParameters(List<ProcedureParameter> parameters) {
 		this.parameters = parameters;
 	}
 
@@ -127,11 +139,11 @@
     	this.updateCount = count;
     }
 
-	public void setResultSet(ColumnSetRecordImpl resultSet) {
+	public void setResultSet(ColumnSet resultSet) {
 		this.resultSet = resultSet;
 	}
 
-	public ColumnSetRecordImpl getResultSet() {
+	public ColumnSet getResultSet() {
 		return resultSet;
 	}
 

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Schema.java (from rev 1550, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/ModelRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Schema.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Schema.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+public class Schema extends AbstractMetadataRecord {
+
+    private boolean physical = true;
+    private boolean isVisible = true;
+    private String primaryMetamodelUri;
+    
+    private Map<String, Table> tables = new LinkedHashMap<String, Table>();
+	private Map<String, ProcedureRecordImpl> procedures = new LinkedHashMap<String, ProcedureRecordImpl>();
+	
+	public void addTable(Table table) {
+		table.setSchema(this);
+		this.tables.put(table.getFullName().toLowerCase(), table);
+	}
+	
+	public void addProcedure(ProcedureRecordImpl procedure) {
+		procedure.setSchema(this);
+		this.procedures.put(procedure.getFullName().toLowerCase(), procedure);
+	}
+
+	/**
+	 * Get the tables defined in this schema
+	 * @return
+	 */
+	public Map<String, Table> getTables() {
+		return tables;
+	}
+	
+	/**
+	 * Get the procedures defined in this schema
+	 * @return
+	 */
+	public Map<String, ProcedureRecordImpl> getProcedures() {
+		return procedures;
+	}
+	
+    public String getPrimaryMetamodelUri() {
+        return primaryMetamodelUri;
+    }
+
+    public boolean isVisible() {
+        return isVisible;
+    }
+
+    public boolean isPhysical() {
+        return physical;
+    }
+
+    /**
+     * @param string
+     */
+    public void setPrimaryMetamodelUri(String string) {
+        primaryMetamodelUri = string;
+    }
+
+    /**
+     * @param b
+     */
+    public void setVisible(boolean b) {
+        isVisible = b;
+    }
+    
+    public void setPhysical(boolean physical) {
+		this.physical = physical;
+	}
+
+}


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Schema.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/SchemaObject.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/SchemaObject.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/SchemaObject.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -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.connector.metadata.runtime;
+
+public interface SchemaObject {
+	
+	Schema getSchema();
+	
+	void setSchema(Schema schema);
+
+}


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/SchemaObject.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Table.java (from rev 1550, trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/TableRecordImpl.java)
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Table.java	                        (rev 0)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Table.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -0,0 +1,276 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.connector.metadata.runtime;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * TableRecordImpl
+ */
+public class Table extends ColumnSet implements SchemaObject {
+
+	public enum Type {
+		Table,
+		View,
+		Document,
+		XmlMappingClass,
+		XmlStagingTable,
+		MaterializedTable
+	}
+	
+    private int cardinality;
+    private Type tableType;
+    private boolean isVirtual;
+    private boolean isSystem;
+    private boolean isMaterialized;
+    private boolean supportsUpdate;
+    private List<ForeignKey> foriegnKeys;
+    private List<KeyRecord> indexes;
+    private List<KeyRecord> uniqueKeys;
+    private List<KeyRecord> accessPatterns;
+    private KeyRecord primaryKey;
+
+    //view information
+	private String selectTransformation;
+    private String insertPlan;
+    private String updatePlan;
+    private String deletePlan;
+    private Table materializedStageTable;
+    private Table materializedTable;
+
+    //XML specific
+    private List<String> bindings;
+	private List<String> schemaPaths;
+	private String resourcePath;
+	
+	private Schema schema;
+	
+	public Schema getSchema() {
+		return schema;
+	}
+	
+	public void setSchema(Schema schema) {
+		this.schema = schema;
+	}
+	
+    public List<String> getBindings() {
+		return bindings;
+	}
+
+	public void setBindings(List<String> bindings) {
+		this.bindings = bindings;
+	}
+
+	public List<String> getSchemaPaths() {
+		return schemaPaths;
+	}
+
+	public void setSchemaPaths(List<String> schemaPaths) {
+		this.schemaPaths = schemaPaths;
+	}
+
+    public int getCardinality() {
+        return cardinality;
+    }
+
+    public boolean isVirtual() {
+        return isVirtual;
+    }
+
+    public boolean isMaterialized() {
+        return isMaterialized;
+    }
+
+    public boolean isPhysical() {
+        return !isVirtual();
+    }
+
+    public boolean isSystem() {
+        return isSystem;
+    }
+
+    public Type getTableType() {
+    	if (tableType == null) {
+    		return Type.Table;
+    	}
+        return tableType;
+    }
+
+    public boolean supportsUpdate() {
+        return supportsUpdate;
+    }
+
+    /**
+     * @param i
+     */
+    public void setCardinality(int i) {
+        cardinality = i;
+    }
+
+    /**
+     * @param i
+     */
+    public void setTableType(Type i) {
+        tableType = i;
+    }
+
+    /**
+     * @param b
+     */
+    public void setSupportsUpdate(boolean b) {
+        supportsUpdate = b;
+    }
+
+    /**
+     * @param b
+     */
+    public void setVirtual(boolean b) {
+		isVirtual = b;
+    }
+
+    /**
+     * @param isMaterialized The isMaterialized to set.
+     * @since 4.2
+     */
+    public void setMaterialized(boolean isMaterialized) {
+        this.isMaterialized = isMaterialized;
+    }
+
+    /**
+     * @param b
+     */
+    public void setSystem(boolean b) {
+        isSystem = b;
+    }
+
+    public String getInsertPlan() {
+    	return insertPlan;
+    }
+    
+    public String getUpdatePlan() {
+    	return updatePlan;
+    }
+    
+    public String getDeletePlan() {
+    	return deletePlan;
+    }
+    
+    public void setInsertPlan(String insertPlan) {
+		this.insertPlan = insertPlan;
+	}
+    
+    public void setUpdatePlan(String updatePlan) {
+		this.updatePlan = updatePlan;
+	}
+    
+    public void setDeletePlan(String deletePlan) {
+		this.deletePlan = deletePlan;
+	}
+    
+    public List<ForeignKey> getForeignKeys() {
+    	return this.foriegnKeys;
+    }
+    
+    public void setForiegnKeys(List<ForeignKey> foriegnKeys) {
+		this.foriegnKeys = foriegnKeys;
+	}
+    
+    public List<KeyRecord> getIndexes() {
+    	return this.indexes;
+    }
+    
+    public void setIndexes(List<KeyRecord> indexes) {
+		this.indexes = indexes;
+	}
+    
+    public List<KeyRecord> getUniqueKeys() {
+    	return this.uniqueKeys;
+    }
+    
+    public void setUniqueKeys(List<KeyRecord> uniqueKeys) {
+		this.uniqueKeys = uniqueKeys;
+	}
+    
+    public List<KeyRecord> getAccessPatterns() {
+    	return this.accessPatterns;
+    }
+    
+    public void setAccessPatterns(List<KeyRecord> accessPatterns) {
+		this.accessPatterns = accessPatterns;
+	}
+    
+    public KeyRecord getPrimaryKey() {
+    	return this.primaryKey;
+    }
+    
+    public void setPrimaryKey(KeyRecord primaryKey) {
+		this.primaryKey = primaryKey;
+	}
+    
+    public String getSelectTransformation() {
+		return selectTransformation;
+	}
+    
+    public void setSelectTransformation(String selectTransformation) {
+		this.selectTransformation = selectTransformation;
+	}
+    
+    public Table getMaterializedStageTable() {
+		return materializedStageTable;
+	}
+    
+    public Table getMaterializedTable() {
+		return materializedTable;
+	}
+    
+    public void setMaterializedStageTable(Table materializedStageTable) {
+		this.materializedStageTable = materializedStageTable;
+	}
+    
+    public void setMaterializedTable(Table materializedTable) {
+		this.materializedTable = materializedTable;
+	}
+
+	public void setResourcePath(String resourcePath) {
+		this.resourcePath = resourcePath;
+	}
+
+	public String getResourcePath() {
+		return resourcePath;
+	}
+	
+	public Collection<KeyRecord> getAllKeys() { 
+		Collection<KeyRecord> keys = new LinkedList<KeyRecord>();
+		if (getPrimaryKey() != null) {
+			keys.add(getPrimaryKey());
+		}
+		keys.addAll(getForeignKeys());
+		keys.addAll(getAccessPatterns());
+		keys.addAll(getIndexes());
+		keys.addAll(getUniqueKeys());
+		return keys;
+	}
+	
+}
\ No newline at end of file


Property changes on: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/Table.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/TableRecordImpl.java
===================================================================
--- trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/TableRecordImpl.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connector-api/src/main/java/org/teiid/connector/metadata/runtime/TableRecordImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1,266 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.connector.metadata.runtime;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * TableRecordImpl
- */
-public class TableRecordImpl extends ColumnSetRecordImpl {
-
-	public enum Type {
-		Table,
-		View,
-		Document,
-		XmlMappingClass,
-		XmlStagingTable,
-		MaterializedTable
-	}
-	
-    private int cardinality;
-    private Type tableType;
-    private boolean isVirtual;
-    private boolean isSystem;
-    private boolean isMaterialized;
-    private boolean supportsUpdate;
-    private List<ForeignKeyRecordImpl> foriegnKeys;
-    private List<KeyRecord> indexes;
-    private List<KeyRecord> uniqueKeys;
-    private List<KeyRecord> accessPatterns;
-    private KeyRecord primaryKey;
-
-    //view information
-	private String selectTransformation;
-    private String insertPlan;
-    private String updatePlan;
-    private String deletePlan;
-    private TableRecordImpl materializedStageTable;
-    private TableRecordImpl materializedTable;
-
-    //XML specific
-    private List<String> bindings;
-	private List<String> schemaPaths;
-	private String resourcePath;
-	
-    public List<String> getBindings() {
-		return bindings;
-	}
-
-	public void setBindings(List<String> bindings) {
-		this.bindings = bindings;
-	}
-
-	public List<String> getSchemaPaths() {
-		return schemaPaths;
-	}
-
-	public void setSchemaPaths(List<String> schemaPaths) {
-		this.schemaPaths = schemaPaths;
-	}
-
-    public int getCardinality() {
-        return cardinality;
-    }
-
-    public boolean isVirtual() {
-        return isVirtual;
-    }
-
-    public boolean isMaterialized() {
-        return isMaterialized;
-    }
-
-    public boolean isPhysical() {
-        return !isVirtual();
-    }
-
-    public boolean isSystem() {
-        return isSystem;
-    }
-
-    public Type getTableType() {
-    	if (tableType == null) {
-    		return Type.Table;
-    	}
-        return tableType;
-    }
-
-    public boolean supportsUpdate() {
-        return supportsUpdate;
-    }
-
-    /**
-     * @param i
-     */
-    public void setCardinality(int i) {
-        cardinality = i;
-    }
-
-    /**
-     * @param i
-     */
-    public void setTableType(Type i) {
-        tableType = i;
-    }
-
-    /**
-     * @param b
-     */
-    public void setSupportsUpdate(boolean b) {
-        supportsUpdate = b;
-    }
-
-    /**
-     * @param b
-     */
-    public void setVirtual(boolean b) {
-		isVirtual = b;
-    }
-
-    /**
-     * @param isMaterialized The isMaterialized to set.
-     * @since 4.2
-     */
-    public void setMaterialized(boolean isMaterialized) {
-        this.isMaterialized = isMaterialized;
-    }
-
-    /**
-     * @param b
-     */
-    public void setSystem(boolean b) {
-        isSystem = b;
-    }
-
-    public String getInsertPlan() {
-    	return insertPlan;
-    }
-    
-    public String getUpdatePlan() {
-    	return updatePlan;
-    }
-    
-    public String getDeletePlan() {
-    	return deletePlan;
-    }
-    
-    public void setInsertPlan(String insertPlan) {
-		this.insertPlan = insertPlan;
-	}
-    
-    public void setUpdatePlan(String updatePlan) {
-		this.updatePlan = updatePlan;
-	}
-    
-    public void setDeletePlan(String deletePlan) {
-		this.deletePlan = deletePlan;
-	}
-    
-    public List<ForeignKeyRecordImpl> getForeignKeys() {
-    	return this.foriegnKeys;
-    }
-    
-    public void setForiegnKeys(List<ForeignKeyRecordImpl> foriegnKeys) {
-		this.foriegnKeys = foriegnKeys;
-	}
-    
-    public List<KeyRecord> getIndexes() {
-    	return this.indexes;
-    }
-    
-    public void setIndexes(List<KeyRecord> indexes) {
-		this.indexes = indexes;
-	}
-    
-    public List<KeyRecord> getUniqueKeys() {
-    	return this.uniqueKeys;
-    }
-    
-    public void setUniqueKeys(List<KeyRecord> uniqueKeys) {
-		this.uniqueKeys = uniqueKeys;
-	}
-    
-    public List<KeyRecord> getAccessPatterns() {
-    	return this.accessPatterns;
-    }
-    
-    public void setAccessPatterns(List<KeyRecord> accessPatterns) {
-		this.accessPatterns = accessPatterns;
-	}
-    
-    public KeyRecord getPrimaryKey() {
-    	return this.primaryKey;
-    }
-    
-    public void setPrimaryKey(KeyRecord primaryKey) {
-		this.primaryKey = primaryKey;
-	}
-    
-    public String getSelectTransformation() {
-		return selectTransformation;
-	}
-    
-    public void setSelectTransformation(String selectTransformation) {
-		this.selectTransformation = selectTransformation;
-	}
-    
-    public TableRecordImpl getMaterializedStageTable() {
-		return materializedStageTable;
-	}
-    
-    public TableRecordImpl getMaterializedTable() {
-		return materializedTable;
-	}
-    
-    public void setMaterializedStageTable(TableRecordImpl materializedStageTable) {
-		this.materializedStageTable = materializedStageTable;
-	}
-    
-    public void setMaterializedTable(TableRecordImpl materializedTable) {
-		this.materializedTable = materializedTable;
-	}
-
-	public void setResourcePath(String resourcePath) {
-		this.resourcePath = resourcePath;
-	}
-
-	public String getResourcePath() {
-		return resourcePath;
-	}
-	
-	public Collection<KeyRecord> getAllKeys() { 
-		Collection<KeyRecord> keys = new LinkedList<KeyRecord>();
-		if (getPrimaryKey() != null) {
-			keys.add(getPrimaryKey());
-		}
-		keys.addAll(getForeignKeys());
-		keys.addAll(getAccessPatterns());
-		keys.addAll(getIndexes());
-		keys.addAll(getUniqueKeys());
-		return keys;
-	}
-	
-}
\ No newline at end of file

Modified: trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCMetdataProcessor.java
===================================================================
--- trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCMetdataProcessor.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCMetdataProcessor.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -36,12 +36,12 @@
 import org.teiid.connector.api.TypeFacility;
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
 import org.teiid.connector.metadata.runtime.BaseColumn;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
 import org.teiid.connector.metadata.runtime.MetadataFactory;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl.Type;
+import org.teiid.connector.metadata.runtime.ProcedureParameter.Type;
 
 /**
  * Reads from {@link DatabaseMetaData} and creates metadata through the {@link MetadataFactory}.
@@ -55,9 +55,9 @@
 		private String catalog;
 		private String schema;
 		private String name;
-		private TableRecordImpl table;
+		private Table table;
 		
-		public TableInfo(String catalog, String schema, String name, TableRecordImpl table) {
+		public TableInfo(String catalog, String schema, String name, Table table) {
 			this.catalog = catalog;
 			this.schema = schema;
 			this.name = name;
@@ -126,7 +126,7 @@
 				}
 				BaseColumn record = null;
 				if (columnType == DatabaseMetaData.procedureColumnResult) {
-					ColumnRecordImpl column = metadataFactory.addProcedureResultSetColumn(columnName, TypeFacility.getDataTypeNameFromSQLType(sqlType), procedure);
+					Column column = metadataFactory.addProcedureResultSetColumn(columnName, TypeFacility.getDataTypeNameFromSQLType(sqlType), procedure);
 					record = column;
 					column.setNativeType(columns.getString(7));
 				} else {
@@ -153,7 +153,7 @@
 			String tableSchema = tables.getString(2);
 			String tableName = tables.getString(3);
 			String fullName = getTableName(tableCatalog, tableSchema, tableName);
-			TableRecordImpl table = metadataFactory.addTable(useFullSchemaName?fullName:tableName);
+			Table table = metadataFactory.addTable(useFullSchemaName?fullName:tableName);
 			table.setNameInSource(fullName);
 			table.setSupportsUpdate(true);
 			String remarks = tables.getString(5);
@@ -184,7 +184,7 @@
 			String columnName = columns.getString(4);
 			int type = columns.getInt(5);
 			//note that the resultset is already ordered by position, so we can rely on just adding columns in order
-			ColumnRecordImpl column = metadataFactory.addColumn(columnName, TypeFacility.getDataTypeNameFromSQLType(type), tableInfo.table);
+			Column column = metadataFactory.addColumn(columnName, TypeFacility.getDataTypeNameFromSQLType(type), tableInfo.table);
 			column.setNativeType(columns.getString(6));
 			column.setRadix(columns.getInt(10));
 			column.setNullType(NullType.values()[columns.getShort(11)]);

Modified: trunk/connectors/connector-text/src/main/java/com/metamatrix/connector/text/TextConnector.java
===================================================================
--- trunk/connectors/connector-text/src/main/java/com/metamatrix/connector/text/TextConnector.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connectors/connector-text/src/main/java/com/metamatrix/connector/text/TextConnector.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -43,9 +43,9 @@
 import org.teiid.connector.api.MetadataProvider;
 import org.teiid.connector.api.TypeFacility;
 import org.teiid.connector.basic.BasicConnector;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
 import org.teiid.connector.metadata.runtime.MetadataFactory;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Table;
 
 
 /**
@@ -374,10 +374,10 @@
 					throw new ConnectorException(TextPlugin.Util.getString("TextConnector.column_mismatch", entry.getKey())); //$NON-NLS-1$
 				}
 			}
-			TableRecordImpl table = metadataFactory.addTable(entry.getKey().substring(entry.getKey().indexOf('.') + 1));
+			Table table = metadataFactory.addTable(entry.getKey().substring(entry.getKey().indexOf('.') + 1));
 			for (int i = 0; i < columnNames.length; i++) {
 				String type = typeNames == null?TypeFacility.RUNTIME_NAMES.STRING:typeNames[i].trim().toLowerCase();
-				ColumnRecordImpl column = metadataFactory.addColumn(columnNames[i].trim(), type, table);
+				Column column = metadataFactory.addColumn(columnNames[i].trim(), type, table);
 				column.setNameInSource(String.valueOf(i));
 				column.setNativeType(TypeFacility.RUNTIME_NAMES.STRING);
 			}

Modified: trunk/connectors/connector-text/src/test/java/com/metamatrix/connector/text/TestTextConnector.java
===================================================================
--- trunk/connectors/connector-text/src/test/java/com/metamatrix/connector/text/TestTextConnector.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/connectors/connector-text/src/test/java/com/metamatrix/connector/text/TestTextConnector.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -30,9 +30,9 @@
 
 import org.junit.Test;
 import org.teiid.connector.api.ConnectorEnvironment;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.Datatype;
 import org.teiid.connector.metadata.runtime.MetadataFactory;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Table;
 
 import com.metamatrix.cdk.api.EnvironmentUtility;
 import com.metamatrix.common.types.DataTypeManager;
@@ -49,7 +49,6 @@
 
         ConnectorEnvironment env = EnvironmentUtility.createEnvironment(props, false);
         TextConnector connector = new TextConnector();
-        // Initialize license checker with class, non-GUI notifier and don't exitOnFailure
         connector.start(env);
         return connector;
     }
@@ -63,15 +62,15 @@
     
     @Test public void testGetMetadata() throws Exception{
         TextConnector connector = helpSetUp(UnitTestUtil.getTestDataPath() + "/SummitData_Descriptor.txt"); //$NON-NLS-1$
-        Map<String, DatatypeRecordImpl> datatypes = new HashMap<String, DatatypeRecordImpl>();
-        datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new DatatypeRecordImpl());
-        datatypes.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new DatatypeRecordImpl());
-        datatypes.put(DataTypeManager.DefaultDataTypes.INTEGER, new DatatypeRecordImpl());
-        datatypes.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new DatatypeRecordImpl());
+        Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
+        datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
+        datatypes.put(DataTypeManager.DefaultDataTypes.BIG_INTEGER, new Datatype());
+        datatypes.put(DataTypeManager.DefaultDataTypes.INTEGER, new Datatype());
+        datatypes.put(DataTypeManager.DefaultDataTypes.TIMESTAMP, new Datatype());
         MetadataFactory metadata = new MetadataFactory("SummitData", datatypes, new Properties()); //$NON-NLS-1$
         connector.getConnectorMetadata(metadata); 
-        assertEquals(0, metadata.getMetadataStore().getProcedures().size());
-        TableRecordImpl group = metadata.getMetadataStore().getTables().get("summitdata.summitdata"); //$NON-NLS-1$
+        assertEquals(0, metadata.getMetadataStore().getSchemas().values().iterator().next().getProcedures().size());
+        Table group = metadata.getMetadataStore().getSchemas().values().iterator().next().getTables().get("summitdata.summitdata"); //$NON-NLS-1$
         assertEquals("SUMMITDATA", group.getName()); //$NON-NLS-1$
         assertEquals("SummitData.SUMMITDATA", group.getFullName()); //$NON-NLS-1$
         assertEquals(14, group.getColumns().size());

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/datatypes.xml	2009-11-18 15:26:22 UTC (rev 1571)
@@ -231,7 +231,7 @@
         <para>When Teiid detects that an explicit conversion can
           not be applied implicitly in criteria, the criteria will be
           treated as false. For example:</para>
-        <programlisting>SELECT * FROM my.group WHERE created_by = ‘not a date’</programlisting>
+        <programlisting>SELECT * FROM my.table WHERE created_by = ‘not a date’</programlisting>
         <para>
           Given that created_by is typed as date, rather than converting
           <literal>'not a date'</literal>
@@ -350,10 +350,10 @@
       <title>Conversion of String Literals</title>
       <para> Teiid automatically converts string literals within a
         SQL statement to their implied types. This typically occurs in a
-        criteria comparison where an element with a different datatype
+        criteria comparison where an expression with a different datatype
         is compared to a literal string:</para>
-      <programlisting>SELECT * FROM my.group WHERE created_by = ‘2003-01-02’</programlisting>
-      <para> Here if the created_by element has the datatype of date,
+      <programlisting>SELECT * FROM my.table WHERE created_by = ‘2003-01-02’</programlisting>
+      <para> Here if the created_by column has the datatype of date,
         Teiid automatically converts the string literal to a date
         datatype as well.</para>
     </sect2>

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/federated_planning.xml	2009-11-18 15:26:22 UTC (rev 1571)
@@ -128,12 +128,12 @@
       <title>Access Patterns</title>
       <para>
 		Access patterns are used on both physical and virtual sources to
-		specify the need for criteria against a set of elements. Failure to supply the criteria will
+		specify the need for criteria against a set of columns. Failure to supply the criteria will
 		result in a planning error, rather than a run-away source query. Access
 		patterns can be applied in a set such that only one of the access
 		patterns is required to be satisfied.</para>
-      <para>Currently any form of criteria may satisfy an access
-		pattern as long as it contains references to affect elements.</para>
+      <para>Currently any form of criteria referencing an affected column may satisfy an access
+		pattern.</para>
     </sect2>
     <sect2>
       <title>Pushdown</title>
@@ -536,21 +536,6 @@
             processing. Also processes an offset if present.</para>
           <para />
         </listitem>
-        <listitem>
-          <para> Dependent Feeder - This node accepts its input stream
-            and forwards to its parent unchanged but also feeds all
-            dependent sources that need the stream of data. Thus, this
-            node actually performs no work within the tree, just diverts
-            a copy of the tuple stream to listening nodes.</para>
-          <para />
-        </listitem>
-        <listitem>
-          <para> Dependent Wait - This node waits until a criteria
-            requiring dependent values below this node has the necessary
-            data to continue. At that point, it continues processing on
-            it's subplan and merely forwards data from the child to the
-            parent.</para>
-        </listitem>
       </itemizedlist>
       <sect3>
         <title>Node Statistics</title>

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml	2009-11-18 15:26:22 UTC (rev 1571)
@@ -20,12 +20,12 @@
         A command statement executes a
         <link linkend="sql_commands">SQL command</link>
         , such as SELECT, INSERT, UPDATE, DELETE, or EXECUTE, against
-        one or more other models (and their underlying data sources).
+        one or more data sources.
       </para>
       <example>
         <title>Example Command Statements</title>
-        <programlisting>SELECT * FROM MyModel.MyTable WHERE ColA &gt; 100;
-INSERT INTO MyModel.MyTable (ColA,ColB) VALUES (50, 'hi');</programlisting>
+        <programlisting>SELECT * FROM MySchema.MyTable WHERE ColA &gt; 100;
+INSERT INTO MySchema.MyTable (ColA,ColB) VALUES (50, 'hi');</programlisting>
         </example>
     </sect2>
     <sect2 id="dynamic_sql">
@@ -49,7 +49,7 @@
           </para>
         </listitem>
         <listitem>
-          <para>The "USING" clause allows the dynamic SQL string to contain special element symbols that are bound at runtime to specified values. This allows for some independence of the SQL string from the surrounding procedure variable names and input names. In the dynamic command "USING" clause, each variable is specified by short name only. However in the dynamic SQL the "USING" variable must be fully qualified to "USING.". The "USING" clause is only for values that will be used in the dynamic SQL as legal expressions. It is not possible to use the "USING" clause to replace table names, keywords, etc. This makes using symbols equivalent in power to normal bind (?) expressions in prepared statements. The "USING" clause helps reduce the amount of string manipulation needed. If a reference is made to a USING symbol in the SQL string that is not bound to a value in the "USING" clause, an exception will occur.
+          <para>The "USING" clause allows the dynamic SQL string to contain variable references that are bound at runtime to specified values. This allows for some independence of the SQL string from the surrounding procedure variable names and input names. In the dynamic command "USING" clause, each variable is specified by short name only. However in the dynamic SQL the "USING" variable must be fully qualified to "USING.". The "USING" clause is only for values that will be used in the dynamic SQL as legal expressions. It is not possible to use the "USING" clause to replace table names, keywords, etc. This makes using symbols equivalent in power to normal bind (?) expressions in prepared statements. The "USING" clause helps reduce the amount of string manipulation needed. If a reference is made to a USING symbol in the SQL string that is not bound to a value in the "USING" clause, an exception will occur.
           </para>
         </listitem>
         <listitem>
@@ -194,7 +194,7 @@
           </para>
         </listitem>
         <listitem>
-          <para>VARIABLES.x = SELECT Column1 FROM MyModel.MyTable;
+          <para>VARIABLES.x = SELECT Column1 FROM MySchema.MyTable;
           </para>
         </listitem>
       </itemizedlist>
@@ -303,14 +303,14 @@
           <para>Nullable - NO_NULLS, NULLABLE, NULLABLE_UNKNOWN; parameter is optional if nullable, and is not required to be listed when using named parameter syntax</para>
         </listitem>
       </itemizedlist>
-      <para>You reference an input to a virtual procedure by using the fully-qualified name of the param (or less if unambiguous). For example, MyModel.MyProc.Param1.
+      <para>You reference an input to a virtual procedure by using the fully-qualified name of the param (or less if unambiguous). For example, MySchema.MyProc.Param1.
       </para>
       <example>
         <title>Example of Referencing an Input Parameter for 'GetBalance' Procedure</title>
         <programlisting>
 CREATE VIRTUAL PROCEDURE 
 BEGIN 
-  SELECT Balance FROM MyModel.Accts WHERE MyModel.Accts.AccountID = MyModel.GetBalance.AcctID; 
+  SELECT Balance FROM MySchema.Accts WHERE MySchema.Accts.AccountID = MySchema.GetBalance.AcctID; 
 END</programlisting>
       </example>
     </sect2>
@@ -370,7 +370,7 @@
         the procedure has defined inputs, you specify those in a
         sequential list, or using "name=value" syntax. You must use the
         name of the input parameter, scoped by the full procedure name if
-        the parameter name is ambiguous in the context of other elements
+        the parameter name is ambiguous in the context of other columns
         or variables in the procedure.</para>
       <para> A virtual procedure call will return a result set just like any
         SELECT, so you can use this in many places you can use a SELECT.
@@ -489,7 +489,7 @@
           <para>You can use the HAS CRITERIA clause to check whether the user’s command has a particular kind of criteria on a particular set of attributes. This clause evaluates to either true or false. You can use it anywhere you can use a criteria within a procedure.</para>
           <para>
             Usage:
-            <synopsis>HAS [criteria operator] CRITERIA [ON (element list)]</synopsis>
+            <synopsis>HAS [criteria operator] CRITERIA [ON (column list)]</synopsis>
           </para>
           <itemizedlist>
             <para>Syntax Rules</para>
@@ -498,11 +498,11 @@
               </para>
             </listitem>
             <listitem>
-              <para>If the ON clause is present, HAS CRITERIA will return true only if criteria was present on all of the specified elements.
+              <para>If the ON clause is present, HAS CRITERIA will return true only if criteria was present on all of the specified columns.
               </para>
             </listitem>
             <listitem>
-              <para>The elements in a HAS CRITERIA ON clause always refer to virtual elements.
+              <para>The columns in a HAS CRITERIA ON clause always refer to virtual columns.
               </para>
             </listitem>
           </itemizedlist>
@@ -521,11 +521,11 @@
                   <entry>Checks simply whether there was any criteria at all.</entry>
                 </row>
                 <row>
-                  <entry><code>HAS CRITERIA ON (element1, element2)</code></entry>
-                  <entry>Checks whether the criteria uses element1 and element2.</entry>
+                  <entry><code>HAS CRITERIA ON (column1, column2)</code></entry>
+                  <entry>Checks whether the criteria uses column1 and column2.</entry>
                 </row>
                 <row>
-                  <entry><code>HAS = CRITERIA ON (element1)</code></entry>
+                  <entry><code>HAS = CRITERIA ON (column1)</code></entry>
                   <entry>Checks whether the criteria has a comparison criteria with = operator.</entry>
                 </row>
                 <row>
@@ -541,10 +541,10 @@
         </sect3>
         <sect3>
           <title>TRANSLATE CRITERIA</title>
-          <para>You can use the TRANSLATE CRITERIA clause to convert the criteria from the user application’s SQL command into the form required to interact with the target source or view tables. The TRANSLATE CRITERIA statement uses the SELECT transformation to infer the element mapping. This clause evaluates to a translated criteria that is evaluated in the context of a command.</para>
+          <para>You can use the TRANSLATE CRITERIA clause to convert the criteria from the user application’s SQL command into the form required to interact with the target source or view tables. The TRANSLATE CRITERIA statement uses the SELECT transformation to infer the column mapping. This clause evaluates to a translated criteria that is evaluated in the context of a command.</para>
           <para>
             Usage:
-            <synopsis>TRANSLATE [criteria operator] CRITERIA [ON (element list)] [WITH (mapping list)]</synopsis>
+            <synopsis>TRANSLATE [criteria operator] CRITERIA [ON (column list)] [WITH (mapping list)]</synopsis>
           </para>
           <itemizedlist>
             <para>Syntax Rules</para>
@@ -553,15 +553,15 @@
               </para>
             </listitem>
             <listitem>
-              <para>If the ON clause is present, TRANSLATE CRITERIA will only form criteria using the specified elements.
+              <para>If the ON clause is present, TRANSLATE CRITERIA will only form criteria using the specified columns.
               </para>
             </listitem>
             <listitem>
-              <para>The elements in a TRANSLATE CRITERIA ON clause always refer to virtual elements.
+              <para>The columns in a TRANSLATE CRITERIA ON clause always refer to virtual columns.
               </para>
             </listitem>
           </itemizedlist>
-          <para>You can use these mappings either to replace the default mappings generated from the SELECT transformation or to specify a reverse expression when a virtual element is defined by an expression.</para>
+          <para>You can use these mappings either to replace the default mappings generated from the SELECT transformation or to specify a reverse expression when a virtual column is defined by an expression.</para>
           <para>Some samples of the HAS TRANSLATE clause:</para>
           <informaltable>
             <tgroup cols="2">
@@ -579,21 +579,21 @@
                   <entry>Translates any user criteria using the default mappings.</entry>
                 </row>
                 <row>
-                  <entry>TRANSLATE CRITERIA WITH (element1 = 'A', element2 = INPUT.element2 + 2)</entry>
-                  <entry>Translates any criteria with some additional mappings: element1 is always mapped to 'A' and element2 is mapped to the incoming element2 value + 2.</entry>
+                  <entry>TRANSLATE CRITERIA WITH (column1 = 'A', column2 = INPUT.column2 + 2)</entry>
+                  <entry>Translates any criteria with some additional mappings: column1 is always mapped to 'A' and column2 is mapped to the incoming column2 value + 2.</entry>
                 </row>
                 <row>
-                  <entry><code>TRANSLATE = CRITERIA ON (element1)</code></entry>
-                  <entry>Translates only criteria that have = comparison operator and involve element1.</entry>
+                  <entry><code>TRANSLATE = CRITERIA ON (column1)</code></entry>
+                  <entry>Translates only criteria that have = comparison operator and involve column1.</entry>
                 </row>
               </tbody>
             </tgroup>
           </informaltable>
           <para>
-          The TRANSLATE CRITERIA, ON clause always refers to virtual elements.
+          The TRANSLATE CRITERIA, ON clause always refers to virtual columns.
           The WITH clause always has items with form &lt;elem&gt; = &lt;expression&gt;, 
-          where the &lt;elem&gt; is a virtual element and the &lt;expression&gt; 
-          specifies what that virtual element should be
+          where the &lt;elem&gt; is a virtual column and the &lt;expression&gt; 
+          specifies what that virtual column should be
           replaced with when TRANSLATE CRITERIA translates the virtual
           criteria (from UPDATE or DELETE) into a physical criteria in
           the command. By default, a mapping is created based on the

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml	2009-11-18 15:26:22 UTC (rev 1571)
@@ -1736,47 +1736,43 @@
   </sect1>
   <sect1>
     <title>Lookup Function</title>
-    <para>The Lookup function allows you to cache a group’s
+    <para>The Lookup function allows you to cache a table’s
     data in memory and access it through a scalar function. This caching
-    accelerates response time to queries that use the lookup groups, known
-    in business terminology as lookup tables or code groups.</para>
-    <para>A StatePostalCodes group used to translate postal codes to
+    accelerates response time to queries that use the lookup tables, known
+    in business terminology as lookup tables or code tables.</para>
+    <para>A StatePostalCodes table used to translate postal codes to
       complete state names might represent an example of this type of
-      lookup group. One element, PostalCode, represents a key element.
-      Other groups within the model refer to this two-letter code. A
-      second element, StateDisplayName, would represent the complete name
-      of the state. Hence, a query to this lookup group would typically
+      lookup table. One column, PostalCode, represents a key column.
+      Other tables refer to this two-letter code. A
+      second column, StateDisplayName, would represent the complete name
+      of the state. Hence, a query to this lookup table would typically
       provide the PostalCode and expect the StateDisplayName in response.
     </para>
-    <para>When you call this function for any combination of codeGroup, returnElement, and
-      keyElement for the first time, the Teiid System caches the result. 
+    <para>When you call this function for any combination of codeTable, returnColumn, and
+      keyColumn for the first time, the Teiid System caches the result. 
       The Teiid System uses this cached map for all
-      queries, in all sessions, that later access this lookup group. The
-      codeGroup requires use of the fully-qualified name, and the
-      returnElement and keyElement parameters should use shortened column
+      queries, in all sessions, that later access this lookup table. The
+      codeTable requires use of the fully-qualified name, and the
+      returnColumn and keyColumn parameters should use shortened column
       names.</para>
     <para>Because the Teiid System caches and indexes this
       information in memory, this function provides quick access after the
-      Teiid System initially caches the lookup group. The Teiid
-      System unloads these cached lookup groups when you stop and restart
+      Teiid System initially caches the lookup table. The Teiid
+      System unloads these cached lookup tables when you stop and restart
       the Teiid System. Thus, you should not use this function for
       data that is subject to updates. Instead, you can use it against
       static data that does not change over time.</para>
     <note>
       <itemizedlist>
         <listitem>
-          <para>The keyElement column is expected to contain unique key
-            values. If the column contains duplicate values, only the last
-            loaded value will be used for lookup purposes. In some cases, this
-            may cause unexpected results, so it is strongly recommended that
-            only columns without duplicate values be used as the keyElement. The
+          <para>The keyColumn is expected to contain unique key
+            values. If the column contains duplicate values, an exception will be thrown. The
             lookup caches can be flushed via the svcmgr.</para>
         </listitem>
         <listitem>
-          <para>Cached lookup groups might consume significant memory. You
-            can limit the number and maximum size of these code groups by
-            setting properties of the QueryService through the Teiid
-            Console.</para>
+          <para>Cached lookup tables might consume significant memory. You
+            can limit the number and maximum size of these code tables by
+            setting configuration properties.</para>
         </listitem>
       </itemizedlist>
     </note>
@@ -1798,20 +1794,20 @@
         <tbody>
           <row>
             <entry>
-              <para>LOOKUP(codeGroup, returnElement,
-                keyElement, keyValue)</para>
+              <para>LOOKUP(codeTable, returnColumn,
+                keyColumn, keyValue)</para>
             </entry>
             <entry>
-              <para>In the lookup group codeGroup, find the row where
-                keyElement has the value keyValue and return the
-                associated returnElement</para>
+              <para>In the lookup table codeTable, find the row where
+                keyColumn has the value keyValue and return the
+                associated returnColumn</para>
             </entry>
             <entry>
-              <para>codeGroup must be a fully-qualified string
+              <para>codeTable must be a fully-qualified string
                 literal containing metadata identifiers, keyValue datatype
-                must match datatype of the keyElement, return datatype
-                matches that of returnElement. returnElement and
-                keyElement parameters should use their shortened names.
+                must match datatype of the keyColumn, return datatype
+                matches that of returnColumn. returnColumn and
+                keyColumn parameters should use their shortened names.
               </para>
             </entry>
           </row>

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/sql_support.xml	2009-11-18 15:26:22 UTC (rev 1571)
@@ -24,17 +24,17 @@
       are processed in the context of a virtual database, or VDB.
       Because information can be federated across multiple sources,
       tables and columns must be scoped in some manner to avoid
-      conflicts. This scoping is provided by models, which contain the
+      conflicts. This scoping is provided by schemas, which contain the
       information for each data source or set of views.</para>
     <itemizedlist>
       <para>Fully-qualified table and column names are of
         the following form, where the separate 'parts' of the identifier
         are delimited by periods.</para>
       <listitem>
-        <para>TABLE: &lt;model_name&gt;.&lt;table_spec&gt;</para>
+        <para>TABLE: &lt;schema_name&gt;.&lt;table_spec&gt;</para>
       </listitem>
       <listitem>
-        <para>COLUMN: &lt;model_name&gt;.&lt;table_spec&gt;.&lt;column_name&gt;</para>
+        <para>COLUMN: &lt;schema_name&gt;.&lt;table_spec&gt;.&lt;column_name&gt;</para>
       </listitem>
     </itemizedlist>
     <itemizedlist>
@@ -62,18 +62,15 @@
       <para> Some examples of valid fully-qualified table identifiers are:
       </para>
       <listitem>
-        <para>MyModel.MySchema.Portfolios
+        <para>MySchema.Portfolios
         </para>
       </listitem>
       <listitem>
-        <para>"MyModel"."MySchema.Portfolios"
+        <para>"MySchema.Portfolios"
         </para>      
       </listitem>
       <listitem>
-        <para>MyModel.Inventory</para>
-      </listitem>
-      <listitem>
-        <para>MyModel.MyCatalog.dbo.Authors
+        <para>MySchema.MyCatalog.dbo.Authors
         </para>
       </listitem>
     </itemizedlist>
@@ -81,21 +78,17 @@
       <para>Some examples of valid fully-qualified column identifiers
         are:</para>
       <listitem>
-        <para>MyModel.MySchema.Portfolios.portfolioID
+        <para>MySchema.Portfolios.portfolioID
         </para>
       </listitem>
       <listitem>
-        <para>"MyModel"."MySchema.Portfolios"."portfolioID" 
+        <para>"MySchema.Portfolios"."portfolioID" 
         </para>
       </listitem>
       <listitem>
-        <para>MyModel.Inventory.totalPallets
+        <para>MySchema.MyCatalog.dbo.Authors.lastName
         </para>
       </listitem>
-      <listitem>
-        <para>MyModel.MyCatalog.dbo.Authors.lastName
-        </para>
-      </listitem>
     </itemizedlist>
     <para> Fully-qualified identifiers can always be used in SQL commands.
       Partially- or unqualified forms can also be used, as long as the
@@ -564,7 +557,7 @@
             </para>
           </listitem>
           <listitem>
-            <para>The procedure virtual group automatically has an access pattern on its IN and IN_OUT parameters which
+            <para>The procedure virtual table automatically has an access pattern on its IN and IN_OUT parameters which
             allows it to be planned correctly as a dependent join when necessary or fail when sufficient criteria cannot be found.
             </para>
           </listitem>
@@ -605,7 +598,7 @@
         </para>
       </listitem>
       <listitem>
-        <para>SELECT &lt;element name>,...INTO &lt;temporary table name&gt; FROM &lt;table name&gt;
+        <para>SELECT &lt;column name>,...INTO &lt;temporary table name&gt; FROM &lt;table name&gt;
         </para>
       </listitem>
       <listitem>

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -24,7 +24,7 @@
 
 import java.util.Map;
 
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.Datatype;
 import org.teiid.metadata.CompositeMetadataStore;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -39,6 +39,6 @@
     
     CompositeMetadataStore getMetadataObjectSource(String vdbName, String vdbVersion) throws MetaMatrixComponentException;
     
-    Map<String, DatatypeRecordImpl> getBuiltinDatatypes() throws MetaMatrixComponentException;
+    Map<String, Datatype> getBuiltinDatatypes() throws MetaMatrixComponentException;
     
 }

Modified: trunk/engine/src/main/java/com/metamatrix/query/parser/SQLParserUtil.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/parser/SQLParserUtil.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/java/com/metamatrix/query/parser/SQLParserUtil.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -45,21 +45,6 @@
     boolean isMetadataID(String id) throws ParseException {
         int length = id.length();
         
-        if(id.indexOf("mmuuid:") >= 0) { //$NON-NLS-1$
-            // Validate modeler form.  Example: "mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"
-            
-            int dotIndex = id.indexOf("."); //$NON-NLS-1$
-            if(dotIndex >= 0) { 
-                String groupPart = id.substring(0, dotIndex);
-                String lastPart = id.substring(dotIndex+1);
-                if(isModelerID(groupPart) || isMetadataPart(groupPart)) {
-                    return (lastPart.equals("*") || isModelerID(lastPart)); //$NON-NLS-1$
-                } 
-                return false;
-            } 
-            return isModelerID(id);                
-        } 
-        
         // Validate server forms:   
         //  group, vdb.group, "group", vdb."group",
         //  group.*, vdb.group.*, "group".*, vdb."group".*,
@@ -94,26 +79,6 @@
     }    
 
     /**
-     * Check that this is a valid mmuuid
-     * @param id Group ID string
-     */
-    boolean isModelerID(String id) throws ParseException {
-        int length = id.length();
-        
-        if(id.startsWith("mmuuid:")) { //$NON-NLS-1$
-            // Validate modeler form.  Example: "mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"
-            for(int i=7; i<length; i++) { 
-                char c = id.charAt(i);
-                if( ! (c == '-' || (c >= 'a' && c <= 'f') || StringUtil.isDigit(c)) ) {
-                    return false;
-                }
-            }  
-            return true;
-        }  
-        return false;
-    }        
-        
-    /**
      * Check that this is a valid function name
      * @param id Function name string
      */

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	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -35,15 +35,15 @@
 import javax.sql.rowset.serial.SerialBlob;
 import javax.sql.rowset.serial.SerialClob;
 
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
-import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
+import org.teiid.connector.metadata.runtime.Datatype;
+import org.teiid.connector.metadata.runtime.ForeignKey;
 import org.teiid.connector.metadata.runtime.KeyRecord;
 import org.teiid.connector.metadata.runtime.MetadataStore;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.connector.metadata.runtime.ProcedureParameter;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.dqp.internal.process.CodeTableCache.CacheKey;
 import org.teiid.metadata.CompositeMetadataStore;
 
@@ -186,7 +186,7 @@
 				case MODELS:
 				case MODELPROPERTIES:
 					for (MetadataStore store : metadata.getMetadataStores()) {
-						for (ModelRecordImpl model : store.getModels().values()) {
+						for (Schema model : store.getSchemas().values()) {
 							if(checkVisibility(vdbName, vdbVersion, model.getName())) {
 								if (sysTable == SystemTables.MODELS) {
 									rows.add(Arrays.asList(model.getName(), model.isPhysical(), model.getUUID(), model.getAnnotation(), model.getPrimaryMetamodelUri()));
@@ -203,7 +203,7 @@
 				case DATATYPEPROPERTIES:
 					rows = new LinkedHashSet(); //System types are duplicated in each indexed vdb... 
 					for (MetadataStore store : metadata.getMetadataStores()) {
-						for (DatatypeRecordImpl datatype : store.getDatatypes()) {
+						for (Datatype datatype : store.getDatatypes()) {
 							if (sysTable == SystemTables.DATATYPES) {
 								rows.add(Arrays.asList(datatype.getName(), datatype.isBuiltin(), datatype.isBuiltin(), datatype.getName(), datatype.getJavaClassName(), datatype.getScale(), 
 										datatype.getLength(), datatype.getNullType().toString(), datatype.isSigned(), datatype.isAutoIncrement(), datatype.isCaseSensitive(), datatype.getPrecisionLength(), 
@@ -221,117 +221,121 @@
 				case PROCEDUREPARAMS:
 				case PROCEDUREPARAMPROPERTIES:
 					for (MetadataStore store : metadata.getMetadataStores()) {
-						for (ProcedureRecordImpl proc : store.getProcedures().values()) {
-							if(!checkVisibility(vdbName, vdbVersion, proc.getModelName())) {
-								continue;
-							}
-							switch (sysTable) {
-							case PROCEDURES:
-								ModelRecordImpl model = store.getModels().get(proc.getModelName().toLowerCase());
-								rows.add(Arrays.asList(proc.getModelName(), proc.getName(), proc.getNameInSource(), proc.getResultSetID() != null, model.getUUID(), proc.getUUID(), proc.getAnnotation(), proc.getFullName()));
-								break;
-							case PROCEDUREPROPERTIES:
-								for (Map.Entry<String, String> entry : proc.getProperties().entrySet()) {
-									rows.add(Arrays.asList(proc.getModelName(), proc.getName(), entry.getKey(), entry.getValue(), proc.getUUID()));
+						for (Schema schema : store.getSchemas().values()) {
+							for (ProcedureRecordImpl proc : schema.getProcedures().values()) {
+								if(!checkVisibility(vdbName, vdbVersion, proc.getSchema().getName())) {
+									continue;
 								}
-								break;
-							default:
-								for (ProcedureParameterRecordImpl param : proc.getParameters()) {
-									if (sysTable == SystemTables.PROCEDUREPARAMS) {
-										rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(), param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(), param.getType().toString(), param.isOptional(), 
-												param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(), param.getNullType().toString(), param.getUUID()));
-									} else {
-										for (Map.Entry<String, String> entry : param.getProperties().entrySet()) {
-											rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(), param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
-										}
+								switch (sysTable) {
+								case PROCEDURES:
+									Schema model = proc.getSchema();
+									rows.add(Arrays.asList(model.getName(), proc.getName(), proc.getNameInSource(), proc.getResultSetID() != null, model.getUUID(), proc.getUUID(), proc.getAnnotation(), proc.getFullName()));
+									break;
+								case PROCEDUREPROPERTIES:
+									for (Map.Entry<String, String> entry : proc.getProperties().entrySet()) {
+										rows.add(Arrays.asList(proc.getSchema().getName(), proc.getName(), entry.getKey(), entry.getValue(), proc.getUUID()));
 									}
-								}
-								if (proc.getResultSetID() != null) {
-									for (ColumnRecordImpl param : proc.getResultSet().getColumns()) {
+									break;
+								default:
+									for (ProcedureParameter param : proc.getParameters()) {
 										if (sysTable == SystemTables.PROCEDUREPARAMS) {
-											rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(), param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(), ProcedureParameterRecordImpl.Type.ResultSet.toString(), false, 
+											rows.add(Arrays.asList(proc.getSchema().getName(), proc.getFullName(), param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(), param.getType().toString(), param.isOptional(), 
 													param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(), param.getNullType().toString(), param.getUUID()));
 										} else {
 											for (Map.Entry<String, String> entry : param.getProperties().entrySet()) {
-												rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(), param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
+												rows.add(Arrays.asList(proc.getSchema().getName(), proc.getFullName(), param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
 											}
 										}
 									}
+									if (proc.getResultSetID() != null) {
+										for (Column param : proc.getResultSet().getColumns()) {
+											if (sysTable == SystemTables.PROCEDUREPARAMS) {
+												rows.add(Arrays.asList(proc.getSchema().getName(), proc.getFullName(), param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(), ProcedureParameter.Type.ResultSet.toString(), false, 
+														param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(), param.getNullType().toString(), param.getUUID()));
+											} else {
+												for (Map.Entry<String, String> entry : param.getProperties().entrySet()) {
+													rows.add(Arrays.asList(proc.getSchema().getName(), proc.getFullName(), param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
+												}
+											}
+										}
+									}
+									break;
 								}
-								break;
 							}
 						}
 					}
 					break;				
 				default:
 					for (MetadataStore store : metadata.getMetadataStores()) {
-						for (TableRecordImpl table : store.getTables().values()) {
-							if(!checkVisibility(vdbName, vdbVersion, table.getModelName())) {
-								continue;
-							}
-							switch (sysTable) {
-							case GROUPS:
-								rows.add(Arrays.asList(table.getModelName(), table.getFullName(), table.getName(), table.getTableType().toString(), table.getNameInSource(), 
-										table.isPhysical(), table.getName().toUpperCase(), table.supportsUpdate(), table.getUUID(), table.getCardinality(), table.getAnnotation(), table.isSystem(), table.isMaterialized()));
-								break;
-							case GROUPPROPERTIES:
-								for (Map.Entry<String, String> entry : table.getProperties().entrySet()) {
-									rows.add(Arrays.asList(table.getModelName(), table.getFullName(), entry.getKey(), entry.getValue(), table.getName(), table.getName().toUpperCase(), table.getUUID()));
+						for (Schema schema : store.getSchemas().values()) {
+							for (Table table : schema.getTables().values()) {
+								if(!checkVisibility(vdbName, vdbVersion, table.getSchema().getName())) {
+									continue;
 								}
-								break;
-							case ELEMENTS:
-								for (ColumnRecordImpl column : table.getColumns()) {
-									if (column.getDatatype() == null) {
-										continue; //some mapping classes don't set the datatype
+								switch (sysTable) {
+								case GROUPS:
+									rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), table.getName(), table.getTableType().toString(), table.getNameInSource(), 
+											table.isPhysical(), table.getName().toUpperCase(), table.supportsUpdate(), table.getUUID(), table.getCardinality(), table.getAnnotation(), table.isSystem(), table.isMaterialized()));
+									break;
+								case GROUPPROPERTIES:
+									for (Map.Entry<String, String> entry : table.getProperties().entrySet()) {
+										rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), entry.getKey(), entry.getValue(), table.getName(), table.getName().toUpperCase(), table.getUUID()));
 									}
-									rows.add(Arrays.asList(table.getModelName(), table.getName(), table.getFullName(), column.getName(), column.getPosition(), column.getNameInSource(), 
-											column.getDatatype().getRuntimeTypeName(), column.getScale(), column.getLength(), column.isFixedLength(), column.isSelectable(), column.isUpdatable(),
-											column.isCaseSensitive(), column.isSigned(), column.isCurrency(), column.isAutoIncrementable(), column.getNullType().toString(), column.getMinValue(), 
-											column.getMaxValue(), column.getSearchType().toString(), column.getFormat(), column.getDefaultValue(), column.getDatatype().getJavaClassName(), column.getPrecision(), 
-											column.getCharOctetLength(), column.getRadix(), table.getName().toUpperCase(), column.getName().toUpperCase(), column.getUUID(), column.getAnnotation()));
-								}
-								break;
-							case ELEMENTPROPERTIES:
-								for (ColumnRecordImpl column : table.getColumns()) {
-									for (Map.Entry<String, String> entry : column.getProperties().entrySet()) {
-										rows.add(Arrays.asList(table.getModelName(), table.getFullName(), column.getName(), entry.getKey(), entry.getValue(), table.getName(), column.getName().toUpperCase(), 
-												table.getName().toUpperCase(), column.getUUID()));
-									}	
-								}
-								break;
-							case KEYS:
-								for (KeyRecord key : table.getAllKeys()) {
-									rows.add(Arrays.asList(table.getModelName(), table.getFullName(), key.getName(), key.getAnnotation(), key.getNameInSource(), key.getType().toString(), 
-											false, table.getName(), table.getName().toUpperCase(), (key instanceof ForeignKeyRecordImpl)?((ForeignKeyRecordImpl)key).getUniqueKeyID():null, key.getUUID()));
-								}
-								break;
-							case KEYPROPERTIES:
-								for (KeyRecord key : table.getAllKeys()) {
-									for (Map.Entry<String, String> entry : key.getProperties().entrySet()) {
-										rows.add(Arrays.asList(table.getModelName(), table.getFullName(), key.getName(), entry.getKey(), entry.getValue(), table.getName(), table.getName().toUpperCase(), 
-												key.getUUID()));
+									break;
+								case ELEMENTS:
+									for (Column column : table.getColumns()) {
+										if (column.getDatatype() == null) {
+											continue; //some mapping classes don't set the datatype
+										}
+										rows.add(Arrays.asList(table.getSchema().getName(), table.getName(), table.getFullName(), column.getName(), column.getPosition(), column.getNameInSource(), 
+												column.getDatatype().getRuntimeTypeName(), column.getScale(), column.getLength(), column.isFixedLength(), column.isSelectable(), column.isUpdatable(),
+												column.isCaseSensitive(), column.isSigned(), column.isCurrency(), column.isAutoIncrementable(), column.getNullType().toString(), column.getMinValue(), 
+												column.getMaxValue(), column.getSearchType().toString(), column.getFormat(), column.getDefaultValue(), column.getDatatype().getJavaClassName(), column.getPrecision(), 
+												column.getCharOctetLength(), column.getRadix(), table.getName().toUpperCase(), column.getName().toUpperCase(), column.getUUID(), column.getAnnotation()));
 									}
-								}
-								break;
-							case KEYELEMENTS:
-								for (KeyRecord key : table.getAllKeys()) {
-									int postition = 1;
-									for (ColumnRecordImpl column : key.getColumns()) {
-										rows.add(Arrays.asList(table.getModelName(), table.getFullName(), column.getName(), key.getName(), key.getType().toString(), table.getName(), table.getName().toUpperCase(), 
-												(key instanceof ForeignKeyRecordImpl)?((ForeignKeyRecordImpl)key).getUniqueKeyID():null, key.getUUID(), postition++));
+									break;
+								case ELEMENTPROPERTIES:
+									for (Column column : table.getColumns()) {
+										for (Map.Entry<String, String> entry : column.getProperties().entrySet()) {
+											rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), column.getName(), entry.getKey(), entry.getValue(), table.getName(), column.getName().toUpperCase(), 
+													table.getName().toUpperCase(), column.getUUID()));
+										}	
 									}
-								}
-								break;
-							case REFERENCEKEYCOLUMNS:
-								for (ForeignKeyRecordImpl key : table.getForeignKeys()) {
-									int postition = 0;
-									for (ColumnRecordImpl column : key.getColumns()) {
-										TableRecordImpl pkTable = key.getPrimaryKey().getTable();
-										rows.add(Arrays.asList(null, vdbName, pkTable.getFullName(), key.getPrimaryKey().getColumns().get(postition).getName(), null, vdbName, table.getFullName(), column.getName(),
-												++postition, 3, 3, key.getName(), key.getPrimaryKey().getName(), 5));
+									break;
+								case KEYS:
+									for (KeyRecord key : table.getAllKeys()) {
+										rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), key.getName(), key.getAnnotation(), key.getNameInSource(), key.getType().toString(), 
+												false, table.getName(), table.getName().toUpperCase(), (key instanceof ForeignKey)?((ForeignKey)key).getUniqueKeyID():null, key.getUUID()));
 									}
+									break;
+								case KEYPROPERTIES:
+									for (KeyRecord key : table.getAllKeys()) {
+										for (Map.Entry<String, String> entry : key.getProperties().entrySet()) {
+											rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), key.getName(), entry.getKey(), entry.getValue(), table.getName(), table.getName().toUpperCase(), 
+													key.getUUID()));
+										}
+									}
+									break;
+								case KEYELEMENTS:
+									for (KeyRecord key : table.getAllKeys()) {
+										int postition = 1;
+										for (Column column : key.getColumns()) {
+											rows.add(Arrays.asList(table.getSchema().getName(), table.getFullName(), column.getName(), key.getName(), key.getType().toString(), table.getName(), table.getName().toUpperCase(), 
+													(key instanceof ForeignKey)?((ForeignKey)key).getUniqueKeyID():null, key.getUUID(), postition++));
+										}
+									}
+									break;
+								case REFERENCEKEYCOLUMNS:
+									for (ForeignKey key : table.getForeignKeys()) {
+										int postition = 0;
+										for (Column column : key.getColumns()) {
+											Table pkTable = key.getPrimaryKey().getTable();
+											rows.add(Arrays.asList(null, vdbName, pkTable.getFullName(), key.getPrimaryKey().getColumns().get(postition).getName(), null, vdbName, table.getFullName(), column.getName(),
+													++postition, 3, 3, key.getName(), key.getPrimaryKey().getName(), 5));
+										}
+									}
+									break;
 								}
-								break;
 							}
 						}
 					}

Modified: trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -29,12 +29,12 @@
 import java.util.List;
 import java.util.Map;
 
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
 import org.teiid.connector.metadata.runtime.MetadataStore;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
+import org.teiid.connector.metadata.runtime.Schema;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl.Type;
+import org.teiid.connector.metadata.runtime.Table;
+import org.teiid.connector.metadata.runtime.Table.Type;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
@@ -56,28 +56,28 @@
 		this.metadataSource = metadataSource;
 		this.metadataStores = metadataStores;
 		for (MetadataStore metadataStore : metadataStores) {
-			for (String model : metadataStore.getModels().keySet()) {
+			for (String model : metadataStore.getSchemas().keySet()) {
 				storeMap.put(model.toLowerCase(), metadataStore);
 			}
 		}
 	}
 	
-	public ModelRecordImpl getModel(String fullName)
+	public Schema getModel(String fullName)
 			throws QueryMetadataException, MetaMatrixComponentException {
-		ModelRecordImpl result = getMetadataStore(fullName).getModels().get(fullName);
+		Schema result = getMetadataStore(fullName).getSchemas().get(fullName);
 		if (result == null) {
 	        throw new QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}
 		return result;
 	}
 	
-	public TableRecordImpl findGroup(String fullName)
+	public Table findGroup(String fullName)
 			throws QueryMetadataException {
 		List<String> tokens = StringUtil.getTokens(fullName, TransformationMetadata.DELIMITER_STRING);
 		if (tokens.size() < 2) {
 		    throw new QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}			
-		TableRecordImpl result = getMetadataStore(tokens.get(0)).getTables().get(fullName);
+		Table result = getMetadataStore(tokens.get(0)).getSchemas().get(tokens.get(0)).getTables().get(fullName);
 		if (result == null) {
 	        throw new QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}
@@ -87,9 +87,11 @@
 	public Collection<String> getGroupsForPartialName(String partialGroupName) {
 		List<String> result = new LinkedList<String>();
 		for (MetadataStore store : metadataStores) {
-			for (Map.Entry<String, TableRecordImpl> entry : store.getTables().entrySet()) {
-				if (entry.getKey().endsWith(partialGroupName)) {
-					result.add(entry.getValue().getFullName());
+			for (Schema schema : store.getSchemas().values()) {
+				for (Map.Entry<String, Table> entry : schema.getTables().entrySet()) {
+					if (entry.getKey().endsWith(partialGroupName)) {
+						result.add(entry.getValue().getFullName());
+					}
 				}
 			}
 		}
@@ -103,7 +105,7 @@
 		if (tokens.size() < 2) {
 		    throw new QueryMetadataException(fullyQualifiedProcedureName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}
-		ProcedureRecordImpl result = getMetadataStore(tokens.get(0)).getProcedures().get(fullyQualifiedProcedureName);
+		ProcedureRecordImpl result = getMetadataStore(tokens.get(0)).getSchemas().get(tokens.get(0)).getProcedures().get(fullyQualifiedProcedureName);
 		if (result == null) {
 	        throw new QueryMetadataException(fullyQualifiedProcedureName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 		}
@@ -130,13 +132,15 @@
 	 * The next methods are hold overs from XML/UUID resolving and will perform poorly
 	 */
 	
-	public ColumnRecordImpl findElement(String elementName) throws QueryMetadataException {
+	public Column findElement(String elementName) throws QueryMetadataException {
 		if (StringUtil.startsWithIgnoreCase(elementName,UUID.PROTOCOL)) {
 			for (MetadataStore store : this.metadataStores) {
-				for (TableRecordImpl table : store.getTables().values()) {
-					for (ColumnRecordImpl column : table.getColumns()) {
-						if (column.getUUID().equalsIgnoreCase(elementName)) {
-							return column;
+				for (Schema schema : store.getSchemas().values()) {
+					for (Table table : schema.getTables().values()) {
+						for (Column column : table.getColumns()) {
+							if (column.getUUID().equalsIgnoreCase(elementName)) {
+								return column;
+							}
 						}
 					}
 				}
@@ -146,8 +150,8 @@
     		if (tokens.size() < 3) {
     		    throw new QueryMetadataException(elementName+TransformationMetadata.NOT_EXISTS_MESSAGE);
     		}
-    		TableRecordImpl table = findGroup(StringUtil.join(tokens.subList(0, tokens.size() - 1), TransformationMetadata.DELIMITER_STRING));
-    		for (ColumnRecordImpl column : table.getColumns()) {
+    		Table table = findGroup(StringUtil.join(tokens.subList(0, tokens.size() - 1), TransformationMetadata.DELIMITER_STRING));
+    		for (Column column : table.getColumns()) {
     			if (column.getFullName().equalsIgnoreCase(elementName)) {
     				return column;
     			}
@@ -156,13 +160,15 @@
         throw new QueryMetadataException(elementName+TransformationMetadata.NOT_EXISTS_MESSAGE);
 	}
 
-	public Collection<TableRecordImpl> getXMLTempGroups(TableRecordImpl tableRecord) throws QueryMetadataException {
-		ArrayList<TableRecordImpl> results = new ArrayList<TableRecordImpl>();
-		MetadataStore store = getMetadataStore(tableRecord.getModelName().toLowerCase());
+	public Collection<Table> getXMLTempGroups(Table tableRecord) throws QueryMetadataException {
+		ArrayList<Table> results = new ArrayList<Table>();
+		MetadataStore store = getMetadataStore(tableRecord.getSchema().getName().toLowerCase());
 		String namePrefix = tableRecord.getFullName() + TransformationMetadata.DELIMITER_STRING;
-		for (TableRecordImpl table : store.getTables().values()) {
-			if (table.getTableType() == Type.XmlStagingTable && table.getName().startsWith(namePrefix)) {
-				results.add(table);
+		for (Schema schema : store.getSchemas().values()) {
+			for (Table table : schema.getTables().values()) {
+				if (table.getTableType() == Type.XmlStagingTable && table.getName().startsWith(namePrefix)) {
+					results.add(table);
+				}
 			}
 		}
 		return results;

Modified: trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -36,18 +36,19 @@
 import java.util.Properties;
 
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
-import org.teiid.connector.metadata.runtime.ColumnSetRecordImpl;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
-import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
+import org.teiid.connector.metadata.runtime.ColumnSet;
+import org.teiid.connector.metadata.runtime.Datatype;
+import org.teiid.connector.metadata.runtime.ForeignKey;
 import org.teiid.connector.metadata.runtime.KeyRecord;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.connector.metadata.runtime.ProcedureParameter;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.SchemaObject;
+import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl.SearchType;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl.Type;
+import org.teiid.connector.metadata.runtime.Column.SearchType;
+import org.teiid.connector.metadata.runtime.ProcedureParameter.Type;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.query.QueryMetadataException;
@@ -144,19 +145,13 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getModelID(java.lang.Object)
      */
     public Object getModelID(final Object groupOrElementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if (!(groupOrElementID instanceof TableRecordImpl) && !(groupOrElementID instanceof ColumnRecordImpl)) {
+        if (!(groupOrElementID instanceof SchemaObject)) {
         	throw createInvalidRecordTypeException(groupOrElementID);
         }
         
-        String modelName = ((AbstractMetadataRecord)groupOrElementID).getModelName();
-        return getModel(modelName);
+        return ((SchemaObject)groupOrElementID).getSchema();
     }
 
-	private Object getModel(String modelName) throws QueryMetadataException,
-			MetaMatrixComponentException {
-    	return getMetadataStore().getModel(modelName.toLowerCase());
-	}
-
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getFullName(java.lang.Object)
      */
@@ -215,19 +210,19 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInGroupID(java.lang.Object)
      */
     public List getElementIDsInGroupID(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-    	return ((TableRecordImpl)groupID).getColumns();
+    	ArgCheck.isInstanceOf(Table.class, groupID);
+    	return ((Table)groupID).getColumns();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getGroupIDForElementID(java.lang.Object)
      */
     public Object getGroupIDForElementID(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            ColumnRecordImpl columnRecord = (ColumnRecordImpl) elementID;
+        if(elementID instanceof Column) {
+            Column columnRecord = (Column) elementID;
             return this.getGroupID(getGroupName(columnRecord.getFullName()));
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
-            ProcedureParameterRecordImpl columnRecord = (ProcedureParameterRecordImpl) elementID;
+        } else if(elementID instanceof ProcedureParameter){
+            ProcedureParameter columnRecord = (ProcedureParameter) elementID;
             return this.getGroupID(getGroupName(columnRecord.getFullName()));
         } else {
             throw createInvalidRecordTypeException(elementID);
@@ -257,10 +252,10 @@
         procInfo.setProcedureID(procRecord);
 
         // modelID for the procedure
-        procInfo.setModelID(getModel(procRecord.getModelName()));
+        procInfo.setModelID(procRecord.getSchema());
 
         // get the parameter metadata info
-        for (ProcedureParameterRecordImpl paramRecord : procRecord.getParameters()) {
+        for (ProcedureParameter paramRecord : procRecord.getParameters()) {
             String runtimeType = paramRecord.getRuntimeType();
             int direction = this.convertParamRecordTypeToStoredProcedureType(paramRecord.getType());
             // create a parameter and add it to the procedure object
@@ -272,14 +267,14 @@
 
         // if the procedure returns a resultSet, obtain resultSet metadata
         if(procRecord.getResultSet() != null) {
-            ColumnSetRecordImpl resultRecord = procRecord.getResultSet();
+            ColumnSet resultRecord = procRecord.getResultSet();
             // resultSet is the last parameter in the procedure
             int lastParamIndex = procInfo.getParameters().size() + 1;
             SPParameter param = new SPParameter(lastParamIndex, SPParameter.RESULT_SET, resultRecord.getFullName());
             param.setClassType(java.sql.ResultSet.class);           
             param.setMetadataID(resultRecord);
 
-            for (ColumnRecordImpl columnRecord : resultRecord.getColumns()) {
+            for (Column columnRecord : resultRecord.getColumns()) {
                 String colType = columnRecord.getRuntimeType();
                 param.addResultSetColumn(columnRecord.getFullName(), DataTypeManager.getDataTypeClass(colType), columnRecord);
             }
@@ -307,7 +302,7 @@
      * @param parameterType
      * @return
      */
-    private int convertParamRecordTypeToStoredProcedureType(final ProcedureParameterRecordImpl.Type parameterType) {
+    private int convertParamRecordTypeToStoredProcedureType(final ProcedureParameter.Type parameterType) {
         switch (parameterType) {
             case In : return SPParameter.IN;
             case Out : return SPParameter.OUT;
@@ -323,10 +318,10 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementType(java.lang.Object)
      */
     public String getElementType(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getRuntimeType();            
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
-            return ((ProcedureParameterRecordImpl) elementID).getRuntimeType();
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getRuntimeType();            
+        } else if(elementID instanceof ProcedureParameter){
+            return ((ProcedureParameter) elementID).getRuntimeType();
         } else {
             throw createInvalidRecordTypeException(elementID);
         }
@@ -336,19 +331,19 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getDefaultValue(java.lang.String)
      */
     public Object getDefaultValue(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getDefaultValue();            
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
-            return ((ProcedureParameterRecordImpl) elementID).getDefaultValue();
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getDefaultValue();            
+        } else if(elementID instanceof ProcedureParameter){
+            return ((ProcedureParameter) elementID).getDefaultValue();
         } else {
             throw createInvalidRecordTypeException(elementID);
         }
     }
 
     public Object getMinimumValue(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getMinValue();            
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getMinValue();            
+        } else if(elementID instanceof ProcedureParameter){
             return null;
         } else {
             throw createInvalidRecordTypeException(elementID);
@@ -356,9 +351,9 @@
     }
 
     public Object getMaximumValue(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getMaxValue();            
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getMaxValue();            
+        } else if(elementID instanceof ProcedureParameter){
             return null;
         } else {
             throw createInvalidRecordTypeException(elementID);
@@ -369,8 +364,8 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#isVirtualGroup(java.lang.Object)
      */
     public boolean isVirtualGroup(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        return ((TableRecordImpl) groupID).isVirtual();
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        return ((Table) groupID).isVirtual();
     }
 
     /** 
@@ -381,25 +376,25 @@
     	if(groupID instanceof ProcedureRecordImpl) {
             return true;            
         } 
-    	if(groupID instanceof TableRecordImpl){
+    	if(groupID instanceof Table){
             return false;
         } 
     	throw createInvalidRecordTypeException(groupID);
     }
 
     public boolean isVirtualModel(final Object modelID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
-        ModelRecordImpl modelRecord = (ModelRecordImpl) modelID;
-        return modelRecord.getModelType() == ModelRecordImpl.Type.Virtual;
+        ArgCheck.isInstanceOf(Schema.class, modelID);
+        Schema modelRecord = (Schema) modelID;
+        return !modelRecord.isPhysical();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getVirtualPlan(java.lang.Object)
      */
     public QueryNode getVirtualPlan(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+        ArgCheck.isInstanceOf(Table.class, groupID);
 
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        Table tableRecord = (Table) groupID;
         if (!tableRecord.isVirtual()) {
             throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.QueryPlan_could_not_be_found_for_physical_group__6")+tableRecord.getFullName()); //$NON-NLS-1$
         }
@@ -421,36 +416,36 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getInsertPlan(java.lang.Object)
      */
     public String getInsertPlan(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+    	ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecordImpl = (Table)groupID;
         if (!tableRecordImpl.isVirtual()) {
             throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__8")+tableRecordImpl.getFullName()); //$NON-NLS-1$
         }
-        return ((TableRecordImpl)groupID).getInsertPlan();
+        return ((Table)groupID).getInsertPlan();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getUpdatePlan(java.lang.Object)
      */
     public String getUpdatePlan(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecordImpl = (Table)groupID;
         if (!tableRecordImpl.isVirtual()) {
         	throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__10")+tableRecordImpl.getFullName());         //$NON-NLS-1$
         }
-        return ((TableRecordImpl)groupID).getUpdatePlan();
+        return ((Table)groupID).getUpdatePlan();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getDeletePlan(java.lang.Object)
      */
     public String getDeletePlan(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecordImpl = (Table)groupID;
         if (!tableRecordImpl.isVirtual()) {
             throw new QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.DeletePlan_could_not_be_found_for_physical_group__12")+tableRecordImpl.getFullName()); //$NON-NLS-1$
         }
-        return ((TableRecordImpl)groupID).getDeletePlan();
+        return ((Table)groupID).getDeletePlan();
     }
 
     /* (non-Javadoc)
@@ -458,7 +453,7 @@
      */
     public boolean modelSupports(final Object modelID, final int modelConstant)
         throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
+        ArgCheck.isInstanceOf(Schema.class, modelID);
 
         switch(modelConstant) {
             default:
@@ -471,8 +466,8 @@
      */
     public boolean groupSupports(final Object groupID, final int groupConstant)
         throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
 
         switch(groupConstant) {
             case SupportConstants.Group.UPDATE:
@@ -488,8 +483,8 @@
     public boolean elementSupports(final Object elementID, final int elementConstant)
         throws MetaMatrixComponentException, QueryMetadataException {
         
-        if(elementID instanceof ColumnRecordImpl) {
-            ColumnRecordImpl columnRecord = (ColumnRecordImpl) elementID;            
+        if(elementID instanceof Column) {
+            Column columnRecord = (Column) elementID;            
             switch(elementConstant) {
                 case SupportConstants.Element.NULL:
                     return columnRecord.getNullType() == NullType.Nullable;
@@ -518,8 +513,8 @@
                 default:
                     throw new UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12") + elementConstant); //$NON-NLS-1$
             }
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
-            ProcedureParameterRecordImpl columnRecord = (ProcedureParameterRecordImpl) elementID;            
+        } else if(elementID instanceof ProcedureParameter) {
+            ProcedureParameter columnRecord = (ProcedureParameter) elementID;            
             switch(elementConstant) {
                 case SupportConstants.Element.NULL:
                 	return columnRecord.getNullType() == NullType.Nullable;
@@ -561,7 +556,7 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMaxSetSize(java.lang.Object)
      */
     public int getMaxSetSize(final Object modelID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
+        ArgCheck.isInstanceOf(Schema.class, modelID);
         return 0;
     }
 
@@ -569,8 +564,8 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getIndexesInGroup(java.lang.Object)
      */
     public Collection getIndexesInGroup(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        return ((TableRecordImpl)groupID).getIndexes();
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        return ((Table)groupID).getIndexes();
     }
 
     /* (non-Javadoc)
@@ -578,9 +573,9 @@
      */
     public Collection getUniqueKeysInGroup(final Object groupID)
         throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-    	TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
-    	ArrayList<ColumnSetRecordImpl> result = new ArrayList<ColumnSetRecordImpl>(tableRecordImpl.getUniqueKeys());
+    	ArgCheck.isInstanceOf(Table.class, groupID);
+    	Table tableRecordImpl = (Table)groupID;
+    	ArrayList<ColumnSet> result = new ArrayList<ColumnSet>(tableRecordImpl.getUniqueKeys());
     	if (tableRecordImpl.getPrimaryKey() != null) {
 	    	result.add(tableRecordImpl.getPrimaryKey());
     	}
@@ -597,8 +592,8 @@
      */
     public Collection getForeignKeysInGroup(final Object groupID)
         throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-    	return ((TableRecordImpl)groupID).getForeignKeys();
+    	ArgCheck.isInstanceOf(Table.class, groupID);
+    	return ((Table)groupID).getForeignKeys();
     }
 
     /* (non-Javadoc)
@@ -606,8 +601,8 @@
      */
     public Object getPrimaryKeyIDForForeignKeyID(final Object foreignKeyID)
         throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ForeignKeyRecordImpl.class, foreignKeyID);
-        ForeignKeyRecordImpl fkRecord = (ForeignKeyRecordImpl) foreignKeyID;
+        ArgCheck.isInstanceOf(ForeignKey.class, foreignKeyID);
+        ForeignKey fkRecord = (ForeignKey) foreignKeyID;
         return fkRecord.getPrimaryKey();
     }
 
@@ -616,24 +611,24 @@
      */
     public Collection getAccessPatternsInGroup(final Object groupID)
         throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-    	return ((TableRecordImpl)groupID).getAccessPatterns();
+    	ArgCheck.isInstanceOf(Table.class, groupID);
+    	return ((Table)groupID).getAccessPatterns();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInIndex(java.lang.Object)
      */
     public List getElementIDsInIndex(final Object index) throws MetaMatrixComponentException, QueryMetadataException {
-    	ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, index);
-    	return ((ColumnSetRecordImpl)index).getColumns();
+    	ArgCheck.isInstanceOf(ColumnSet.class, index);
+    	return ((ColumnSet)index).getColumns();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInKey(java.lang.Object)
      */
     public List getElementIDsInKey(final Object key) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, key);
-        return ((ColumnSetRecordImpl)key).getColumns();
+        ArgCheck.isInstanceOf(ColumnSet.class, key);
+        return ((ColumnSet)key).getColumns();
     }
 
     /* (non-Javadoc)
@@ -641,18 +636,18 @@
      */
     public List getElementIDsInAccessPattern(final Object accessPattern)
         throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, accessPattern);
-        return ((ColumnSetRecordImpl)accessPattern).getColumns();
+        ArgCheck.isInstanceOf(ColumnSet.class, accessPattern);
+        return ((ColumnSet)accessPattern).getColumns();
     }
 
     /* (non-Javadoc)
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#isXMLGroup(java.lang.Object)
      */
     public boolean isXMLGroup(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+        ArgCheck.isInstanceOf(Table.class, groupID);
 
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
-        return tableRecord.getTableType() == TableRecordImpl.Type.Document;
+        Table tableRecord = (Table) groupID;
+        return tableRecord.getTableType() == Table.Type.Document;
     }
 
     /** 
@@ -661,8 +656,8 @@
      */
     public boolean hasMaterialization(final Object groupID) throws MetaMatrixComponentException,
                                                       QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
         return tableRecord.isMaterialized();
     }
 
@@ -672,8 +667,8 @@
      */
     public Object getMaterialization(final Object groupID) throws MetaMatrixComponentException,
                                                     QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
         if(tableRecord.isMaterialized()) {
 	        return tableRecord.getMaterializedTable();
         }
@@ -686,8 +681,8 @@
      */
     public Object getMaterializationStage(final Object groupID) throws MetaMatrixComponentException,
                                                          QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
         if(tableRecord.isMaterialized()) {
 	        return tableRecord.getMaterializedStageTable();
         }
@@ -698,9 +693,9 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getMappingNode(java.lang.Object)
      */
     public MappingNode getMappingNode(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+        ArgCheck.isInstanceOf(Table.class, groupID);
 
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        Table tableRecord = (Table) groupID;
 		final String groupName = tableRecord.getFullName();
         if(tableRecord.isVirtual()) {
             // get mappin transform
@@ -735,10 +730,10 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getXMLTempGroups(java.lang.Object)
      */
     public Collection getXMLTempGroups(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
 
-        if(tableRecord.getTableType() == TableRecordImpl.Type.Document) {
+        if(tableRecord.getTableType() == Table.Type.Document) {
             return this.store.getXMLTempGroups(tableRecord);
         }
         return Collections.EMPTY_SET;
@@ -748,8 +743,8 @@
      * @see com.metamatrix.query.metadata.QueryMetadataInterface#getCardinality(java.lang.Object)
      */
     public int getCardinality(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        return ((TableRecordImpl) groupID).getCardinality();
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        return ((Table) groupID).getCardinality();
     }
 
     /* (non-Javadoc)
@@ -757,8 +752,8 @@
      */
     public List getXMLSchemas(final Object groupID) throws MetaMatrixComponentException, QueryMetadataException {
 
-        ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
-        TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+        ArgCheck.isInstanceOf(Table.class, groupID);
+        Table tableRecord = (Table) groupID;
 
         // lookup transformation record for the group
         String groupName = tableRecord.getFullName();
@@ -794,66 +789,66 @@
     }
 
     public int getElementLength(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getLength();            
-        } else if(elementID instanceof ProcedureParameterRecordImpl){
-            return ((ProcedureParameterRecordImpl) elementID).getLength();
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getLength();            
+        } else if(elementID instanceof ProcedureParameter){
+            return ((ProcedureParameter) elementID).getLength();
         } else {
             throw createInvalidRecordTypeException(elementID);
         }
     }
 
     public int getPosition(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getPosition();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
-            return ((ProcedureParameterRecordImpl) elementID).getPosition();            
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getPosition();
+        } else if(elementID instanceof ProcedureParameter) {
+            return ((ProcedureParameter) elementID).getPosition();            
         } else {
             throw createInvalidRecordTypeException(elementID);            
         }
     }
     
     public int getPrecision(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getPrecision();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
-            return ((ProcedureParameterRecordImpl) elementID).getPrecision();            
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getPrecision();
+        } else if(elementID instanceof ProcedureParameter) {
+            return ((ProcedureParameter) elementID).getPrecision();            
         } else {
             throw createInvalidRecordTypeException(elementID);            
         }
     }
     
     public int getRadix(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getRadix();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
-            return ((ProcedureParameterRecordImpl) elementID).getRadix();            
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getRadix();
+        } else if(elementID instanceof ProcedureParameter) {
+            return ((ProcedureParameter) elementID).getRadix();            
         } else {
             throw createInvalidRecordTypeException(elementID);            
         }
     }
     
 	public String getFormat(Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getFormat();
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getFormat();
         } 
         throw createInvalidRecordTypeException(elementID);            
 	}       
     
     public int getScale(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getScale();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
-            return ((ProcedureParameterRecordImpl) elementID).getScale();            
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getScale();
+        } else if(elementID instanceof ProcedureParameter) {
+            return ((ProcedureParameter) elementID).getScale();            
         } else {
             throw createInvalidRecordTypeException(elementID);            
         }
     }
 
     public int getDistinctValues(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getDistinctValues();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getDistinctValues();
+        } else if(elementID instanceof ProcedureParameter) {
             return -1;            
         } else {
             throw createInvalidRecordTypeException(elementID);            
@@ -861,9 +856,9 @@
     }
 
     public int getNullValues(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getNullValues();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getNullValues();
+        } else if(elementID instanceof ProcedureParameter) {
             return -1;            
         } else {
             throw createInvalidRecordTypeException(elementID);            
@@ -871,9 +866,9 @@
     }
 
     public String getNativeType(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        if(elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl) elementID).getNativeType();
-        } else if(elementID instanceof ProcedureParameterRecordImpl) {
+        if(elementID instanceof Column) {
+            return ((Column) elementID).getNativeType();
+        } else if(elementID instanceof ProcedureParameter) {
             return null;            
         } else {
             throw createInvalidRecordTypeException(elementID);            
@@ -935,7 +930,7 @@
      * @since 5.0
      */
     public String getModeledType(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        DatatypeRecordImpl record = getDatatypeRecord(elementID);
+        Datatype record = getDatatypeRecord(elementID);
         if (record != null) {
             return record.getDatatypeID();
         }
@@ -947,7 +942,7 @@
      * @since 5.0
      */
     public String getModeledBaseType(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        DatatypeRecordImpl record = getDatatypeRecord(elementID);
+        Datatype record = getDatatypeRecord(elementID);
         if (record != null) {
             return record.getBasetypeID();
         }
@@ -959,18 +954,18 @@
      * @since 5.0
      */
     public String getModeledPrimitiveType(final Object elementID) throws MetaMatrixComponentException, QueryMetadataException {
-        DatatypeRecordImpl record = getDatatypeRecord(elementID);
+        Datatype record = getDatatypeRecord(elementID);
         if (record != null) {
             return record.getPrimitiveTypeID();
         }
         return null;
     }
 
-    private DatatypeRecordImpl getDatatypeRecord(final Object elementID) {
-        if (elementID instanceof ColumnRecordImpl) {
-            return ((ColumnRecordImpl)elementID).getDatatype();
-        } else if (elementID instanceof ProcedureParameterRecordImpl) {
-            return ((ProcedureParameterRecordImpl)elementID).getDatatype();
+    private Datatype getDatatypeRecord(final Object elementID) {
+        if (elementID instanceof Column) {
+            return ((Column)elementID).getDatatype();
+        } else if (elementID instanceof ProcedureParameter) {
+            return ((ProcedureParameter)elementID).getDatatype();
         } else {
             throw createInvalidRecordTypeException(elementID);            
         }

Modified: trunk/engine/src/main/javacc/com/metamatrix/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/com/metamatrix/query/parser/SQLParser.jj	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/main/javacc/com/metamatrix/query/parser/SQLParser.jj	2009-11-18 15:26:22 UTC (rev 1571)
@@ -194,26 +194,22 @@
 |	<SQL_TSI_YEAR: "SQL_TSI_YEAR"> 
 }
 
-TOKEN : /* User variables and literals */
+TOKEN : /* User variables and literals 
+          - NOTE IDs are not spec compliant.  We allow for
+          - any number of name parts to appear and restrict quoted
+          - IDs to continaing regular identifiers
+         */
 {
-    < ALL_IN_GROUP: (<GROUP_PART> | <MMUUID_PART>) <PERIOD> <STAR> >
+    < ALL_IN_GROUP: <GROUP_PART> <PERIOD> <STAR> >
 
-|   < VARIABLE: <ID> | <MMUUID> >
+|   < ID: <GROUP_PART> ( <PERIOD> <QUOTED_ID> )? >
 
-|   < #ID: <GROUP_PART> 									  // Group name
-		   ( (<PERIOD>|<SLASH>) (<QUOTED_ID> | <MMUUID_PART>) )? >        // Element name extension
-
-|	< #ELEMENT: <GROUP_PART> (<PERIOD>|<SLASH>) <QUOTED_ID> >
-|	< #GROUP_PART: ("#")? (<QUOTED_ID> (<PERIOD>|<SLASH>))? <QUOTED_ID> >
+|	< #GROUP_PART: ("#")? (<QUOTED_ID> <PERIOD>)? <QUOTED_ID> >
 |	< #QUOTED_ID: <DOTTED_ID> | ("\"" <DOTTED_ID> "\"") >           
-|	< #DOTTED_ID: <ID_PART> ((<PERIOD>|<SLASH>) <ID_PART>)* >           
+|	< #DOTTED_ID: <ID_PART> (<PERIOD> <ID_PART>)* >           
 |   < #ID_PART: ("@")? <LETTER> (<ID_CHAR>)* >               
 |   < #ID_CHAR: (<LETTER> | "_" | <DIGIT>) >    
 
-|	< #MMUUID: <MMUUID_PART> (<PERIOD> <MMUUID_PART>)?	>	  // Modeler-only mmuuid formats
-|   < #MMUUID_PART: "mmuuid:" (<MMUUID_CHAR>)* >              
-|   < #MMUUID_CHAR: ["a"-"f"] | ["0"-"9"] | "-">          
-
 | 	< DATETYPE: "{" "d" >
 | 	< TIMETYPE: "{" "t" >
 | 	< TIMESTAMPTYPE: "{" "ts" >
@@ -313,7 +309,7 @@
 }
 {
 	<DROP> <TABLE> 
-	tableToken = <VARIABLE>
+	tableToken = <ID>
 	{
 		drop.setTable(new GroupSymbol(validateMetadataID(tableToken.image)));
 		return drop;
@@ -334,7 +330,7 @@
 }
 {
 	<CREATE> <LOCAL> <TEMPORARY> <TABLE> 
-	tableToken = <VARIABLE>
+	tableToken = <ID>
 	<LPAREN>
 	{
 		create.setTable(new GroupSymbol(validateMetadataID(tableToken.image)));
@@ -511,7 +507,7 @@
     query = queryExpression(info)
     <RPAREN>
     <AS>
-    cursor = <VARIABLE>
+    cursor = <ID>
     block = block(info)
     
     {
@@ -583,14 +579,14 @@
     [LOOKAHEAD(4)<ON> 
     <LPAREN> 
     
-    elementToken = <VARIABLE>
+    elementToken = <ID>
     
     { 
        elements.add(new ElementSymbol(validateMetadataID(elementToken.image)));
     }       
         
     (<COMMA>
-        elementToken = <VARIABLE>
+        elementToken = <ID>
         
         {
             elements.add(new ElementSymbol(validateMetadataID(elementToken.image)));
@@ -643,7 +639,7 @@
 {
     <DECLARE>
     type = dataType()
-    varToken = <VARIABLE>
+    varToken = <ID>
     {
         variableID = new ElementSymbol(validateMetadataID(varToken.image));
     }
@@ -669,7 +665,7 @@
 }
 {
     
-    varToken = <VARIABLE>
+    varToken = <ID>
     {
         elementID = new ElementSymbol(validateMetadataID(varToken.image));              
     } 
@@ -750,7 +746,7 @@
             critList = new ArrayList();
          }
          <LPAREN>
-        elementToken = <VARIABLE>
+        elementToken = <ID>
         <EQ>
         value = expression(info) 
         {
@@ -763,7 +759,7 @@
             compCrit = null;
         }
         (   <COMMA>
-            elementToken = <VARIABLE>
+            elementToken = <ID>
             <EQ>
             value = expression(info)
          {
@@ -838,7 +834,7 @@
 	elements = createElementsWithTypes(info)
 
 	 [<INTO>
-      groupToken = <VARIABLE>
+      groupToken = <ID>
       {
          String groupID = validateMetadataID(groupToken.image);
          group = new GroupSymbol(groupID);
@@ -879,7 +875,7 @@
 	Token elementToken = null;
 }
 {
-	elementToken = <VARIABLE>
+	elementToken = <ID>
     <EQ>
     {
     	String symbolName = shortName?validateElementName(elementToken.image):validateMetadataID(elementToken.image);
@@ -888,7 +884,7 @@
         using.addClause(symbol, value);
     }
 	(<COMMA>
-     elementToken = <VARIABLE>
+     elementToken = <ID>
      <EQ>
      {
           symbolName = shortName?validateElementName(elementToken.image):validateMetadataID(elementToken.image);
@@ -913,7 +909,7 @@
 	List elements = new ArrayList();
 }
 {
-	 elementToken = <VARIABLE>
+	 elementToken = <ID>
 	 type = dataType()
 	 {
 	    ElementSymbol symbol = new ElementSymbol(validateElementName(elementToken.image));
@@ -921,7 +917,7 @@
 		elements.add(symbol);
 	 }
 	 (<COMMA>
-		elementToken = <VARIABLE>
+		elementToken = <ID>
 		type = dataType()
 		{
 			symbol = new ElementSymbol(validateElementName(elementToken.image));
@@ -952,13 +948,13 @@
 	   storedProcedure.setParameter(parameter);
 	 }
 	]
-	call = <VARIABLE>
+	call = <ID>
 	{
 		if (!"call".equalsIgnoreCase(call.image)) { //$NON-NLS-1$
 		   throw new ParseException(QueryPlugin.Util.getString("SQLParser.call_expected")); //$NON-NLS-1$
 		}
 	}
-	procNameToken = <VARIABLE>
+	procNameToken = <ID>
 	{
 		storedProcedure.setProcedureName(procNameToken.image);
 	}
@@ -998,7 +994,7 @@
 {
 	(
 		(<EXEC> | <EXECUTE>)
-		procNameToken = <VARIABLE>
+		procNameToken = <ID>
 		{
 			storedProcedure.setProcedureName(procNameToken.image);
 		}
@@ -1007,7 +1003,7 @@
 		<LPAREN>
 		
 		(
-		 LOOKAHEAD(<VARIABLE> <EQ>)
+		 LOOKAHEAD(<ID> <EQ>)
 		 storedProcedure = executeNamedParams(info, storedProcedure)
 		 | 		
 		 storedProcedure = executeUnnamedParams(info, storedProcedure, 1)
@@ -1113,7 +1109,7 @@
     
 }
 {
-	t=<VARIABLE>	
+	t=<ID>	
 	{ 
 		parameterName = t.image;
 		
@@ -1139,16 +1135,16 @@
 }
 {
 	<INSERT> <INTO>
-	groupToken = <VARIABLE>
+	groupToken = <ID>
 
-	[LOOKAHEAD(<LPAREN><VARIABLE>)
+	[LOOKAHEAD(<LPAREN><ID>)
 		<LPAREN>
-		elementToken = <VARIABLE>
+		elementToken = <ID>
 		{
 			insert.addVariable(new ElementSymbol(validateMetadataID(elementToken.image)));
 		}
 		(	<COMMA>
-			elementToken = <VARIABLE>
+			elementToken = <ID>
 			{
 				insert.addVariable(new ElementSymbol(validateMetadataID(elementToken.image)));
 			}
@@ -1231,7 +1227,7 @@
 }
 {
 	<UPDATE>
-	groupToken = <VARIABLE>
+	groupToken = <ID>
 	<SET>
 	setClauseList = setClauseList(false, info)
 	{
@@ -1271,7 +1267,7 @@
 }
 {
 	<DELETE> <FROM>
-	groupToken = <VARIABLE>
+	groupToken = <ID>
 	[criteria = where(info)]
 	[option = option(info)
 	  {
@@ -1407,7 +1403,7 @@
 }
 {	
 	<INTO>
-	(groupID=<VARIABLE>)
+	(groupID=<ID>)
 	{
     	into = new Into(new GroupSymbol(groupID.image));
 		return into;
@@ -1472,7 +1468,7 @@
 			// Expression
 			expression=expression(info)	
 		)
-		[[<AS>] ( aliasToken=<VARIABLE> |
+		[[<AS>] ( aliasToken=<ID> |
 				  aliasToken=<STRINGVAL>
 				)
 		]
@@ -1744,7 +1740,7 @@
       command = storedProcedure(info) )
 	<RPAREN>
 	[<AS>]
-	aliasID = <VARIABLE>
+	aliasID = <ID>
 	
 	{
 		clause = new SubqueryFromClause(validateAlias(aliasID.image), command);
@@ -1766,7 +1762,7 @@
 	UnaryFromClause clause = null;
 }
 {	
-	(groupID=<VARIABLE> [[<AS>] aliasID=<VARIABLE>])
+	(groupID=<ID> [[<AS>] aliasID=<ID>])
 	{
     	if(aliasID != null) {		
             group = new GroupSymbol(validateAlias(aliasID.image), validateMetadataID(groupID.image));
@@ -2287,7 +2283,7 @@
 }
 {
 	<ORDER> <BY>
-	(id=<VARIABLE> | id=<STRINGVAL> | id=<INTEGERVAL>) [<ASC> | type=<DESC>]
+	(id=<ID> | id=<STRINGVAL> | id=<INTEGERVAL>) [<ASC> | type=<DESC>]
 	{
         ascending = true;
        	if(type != null) {
@@ -2302,7 +2298,7 @@
        	}
 	}
 	(<COMMA>
-		(id=<VARIABLE> | id=<STRINGVAL> | id=<INTEGERVAL>) [<ASC> | type=<DESC>]
+		(id=<ID> | id=<STRINGVAL> | id=<INTEGERVAL>) [<ASC> | type=<DESC>]
 		{
             ascending = true;
             if(type != null) {
@@ -2379,35 +2375,35 @@
 		debug 		= <DEBUG> |
 		
 		<MAKEDEP>		
-		id=<VARIABLE>
+		id=<ID>
 		{
             option.addDependentGroup(validateMetadataID(id.image));
 		}
 		(<COMMA>
-			id=<VARIABLE>
+			id=<ID>
 			{
                 option.addDependentGroup(validateMetadataID(id.image));
 	        }
 		)* |
 		<MAKENOTDEP>		
-		id=<VARIABLE>
+		id=<ID>
 		{
             option.addNotDependentGroup(validateMetadataID(id.image));
 		}
 		(<COMMA>
-			id=<VARIABLE>
+			id=<ID>
 			{
                 option.addNotDependentGroup(validateMetadataID(id.image));
 	        }
 		)* |
 		
 		nocache	= <NOCACHE>		
-		[id=<VARIABLE>
+		[id=<ID>
 		{
             option.addNoCacheGroup(validateMetadataID(id.image));
 		}
 		(<COMMA>
-			id=<VARIABLE>
+			id=<ID>
 			{
                 option.addNoCacheGroup(validateMetadataID(id.image));
 	        }
@@ -2596,7 +2592,7 @@
 		LOOKAHEAD(2) (expression=function(info))
 		|
 		// ElementSymbol
-		(symbol=<VARIABLE> 
+		(symbol=<ID> 
 			{
 				// Check that this isn't actually a string expression.  That 
 				// is a possibility due to the token definitions where a 
@@ -2841,7 +2837,7 @@
 		<RPAREN>
 	)  			
 	|
-	(	funcToken = <VARIABLE>
+	(	funcToken = <ID>
 		{ 
 			funcName = validateFunctionName(funcToken.image);
 		}

Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -25,7 +25,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.Datatype;
 import org.teiid.metadata.CompositeMetadataStore;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -82,7 +82,7 @@
 	}
 	
 	@Override
-	public Map<String, DatatypeRecordImpl> getBuiltinDatatypes()
+	public Map<String, Datatype> getBuiltinDatatypes()
 			throws MetaMatrixComponentException {
 		return null;
 	}

Modified: trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -2805,111 +2805,6 @@
         helpException("SELECT a from db.g where b like '#String' escape '#1'", "Parsing error: Like escape value must be a single character.");  //$NON-NLS-1$ //$NON-NLS-2$
     }   
 
-    
-	// ==================== modeler literals ===========================
-
-	/** Select mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 */
-	public void testModelerID() {
-		GroupSymbol g = new GroupSymbol("mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"); //$NON-NLS-1$
-		From from = new From();
-		from.addGroup(g);
-
-		Select select = new Select();
-		ElementSymbol a = new ElementSymbol("mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0");  //$NON-NLS-1$
-		select.addSymbol(a);
-
-		Query query = new Query();
-		query.setSelect(select);
-		query.setFrom(from);
-		
-		helpTest("Select mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 "SELECT mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 FROM mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 query);		
-	}
-	
-	/** Select mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 */
-	public void testModelerFullID() {
-		GroupSymbol g = new GroupSymbol("mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"); //$NON-NLS-1$
-		From from = new From();
-		from.addGroup(g);
-
-		Select select = new Select();
-		ElementSymbol a = new ElementSymbol("mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0");  //$NON-NLS-1$
-		select.addSymbol(a);
-
-		Query query = new Query();
-		query.setSelect(select);
-		query.setFrom(from);
-		
-		helpTest("Select mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 "SELECT mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 FROM mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 query);		
-	    
-	}
-
-	/** Select a.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 as a */
-	public void testModelerAliasElement() {
-		GroupSymbol g = new GroupSymbol("a", "mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"); //$NON-NLS-1$ //$NON-NLS-2$
-		From from = new From();
-		from.addGroup(g);
-
-		Select select = new Select();
-		ElementSymbol a = new ElementSymbol("a.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0");  //$NON-NLS-1$
-		select.addSymbol(a);
-
-		Query query = new Query();
-		query.setSelect(select);
-		query.setFrom(from);
-		
-		helpTest("Select a.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 as a",  //$NON-NLS-1$
-				 "SELECT a.mmuuid:abcf22c0-3236-1dfa-9931-e83d04ce10a0 FROM mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 AS a",  //$NON-NLS-1$
-				 query);		
-	    
-	}
-
-	/** Select mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.* From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0 */
-	public void testModelerGroupStar() {
-		GroupSymbol g = new GroupSymbol("mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0"); //$NON-NLS-1$
-		From from = new From();
-		from.addGroup(g);
-
-		Select select = new Select();
-		AllInGroupSymbol a = new AllInGroupSymbol("mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.*");  //$NON-NLS-1$
-		select.addSymbol(a);
-
-		Query query = new Query();
-		query.setSelect(select);
-		query.setFrom(from);
-		
-		helpTest("Select mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.* From mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 "SELECT mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0.* FROM mmuuid:345f22c0-3236-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-				 query);		
-	    
-	}
-    
-    /** SELECT * FROM mmuuid:66f628c1-3455-1dfa-9931-e83d04ce10a0 ORDER BY mmuuid:66f628c2-3455-1dfa-9931-e83d04ce10a0 */
-    public void testModelerOrderBy() {
-        GroupSymbol g = new GroupSymbol("mmuuid:66f628c1-3455-1dfa-9931-e83d04ce10a0"); //$NON-NLS-1$
-        From from = new From();
-        from.addGroup(g);
-
-        Select select = new Select();
-        select.addSymbol(new AllSymbol());
-
-        OrderBy orderBy = new OrderBy();
-        orderBy.addVariable(new ElementSymbol("mmuuid:66f628c2-3455-1dfa-9931-e83d04ce10a0")); //$NON-NLS-1$
-
-        Query query = new Query();
-        query.setSelect(select);
-        query.setFrom(from);
-        query.setOrderBy(orderBy);
-        
-        helpTest("SELECT * FROM mmuuid:66f628c1-3455-1dfa-9931-e83d04ce10a0 ORDER BY mmuuid:66f628c2-3455-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-                 "SELECT * FROM mmuuid:66f628c1-3455-1dfa-9931-e83d04ce10a0 ORDER BY mmuuid:66f628c2-3455-1dfa-9931-e83d04ce10a0",  //$NON-NLS-1$
-                 query);        
-        
-    }
-
 	/** SELECT "date"."time" from db.g */
 	public void testReservedWordsInElement() {
 		GroupSymbol g = new GroupSymbol("db.g"); //$NON-NLS-1$
@@ -6464,7 +6359,7 @@
 
     /** QUERY Tool Format*/
     public void testQueryWithQuotes_MSQuery() throws Exception {
-        QueryParser.getQueryParser().parseCommand("SELECT \"PART_COLOR\", \"PART_ID\", \"PART_NAME\", \"PART_WEIGHT\" FROM \"VirtualParts/base\".\"Parts\""); //$NON-NLS-1$
+        QueryParser.getQueryParser().parseCommand("SELECT \"PART_COLOR\", \"PART_ID\", \"PART_NAME\", \"PART_WEIGHT\" FROM \"VirtualParts.base\".\"Parts\""); //$NON-NLS-1$
     }
      
     /** MS Query Format **/
@@ -6474,17 +6369,17 @@
 
     /** MS Access Format**/
     public void testQueryWithQuotes_MSAccess() throws Exception {
-        QueryParser.getQueryParser().parseCommand("SELECT \"PART_COLOR\" ,\"PART_ID\" ,\"PART_NAME\" ,\"PART_WEIGHT\"  FROM \"parts_oracle/DEV_RRAMESH\".\"PARTS\""); //$NON-NLS-1$
+        QueryParser.getQueryParser().parseCommand("SELECT \"PART_COLOR\" ,\"PART_ID\" ,\"PART_NAME\" ,\"PART_WEIGHT\"  FROM \"parts_oracle.DEV_RRAMESH\".\"PARTS\""); //$NON-NLS-1$
     }
 
     /** BO Business View Manager**/
     public void testQueryWithQuotes_BODesigner() throws Exception {
-        QueryParser.getQueryParser().parseCommand("SELECT DISTINCT \"PARTS\".\"PART_NAME\" FROM   \"parts_oracle/DEV_RRAMESH\".\"PARTS\" \"PARTS\""); //$NON-NLS-1$
+        QueryParser.getQueryParser().parseCommand("SELECT DISTINCT \"PARTS\".\"PART_NAME\" FROM   \"parts_oracle.DEV_RRAMESH\".\"PARTS\" \"PARTS\""); //$NON-NLS-1$
     }
 
     /** Crystal Reports **/
     public void testQueryWithQuotes_CrystalReports() throws Exception {
-        QueryParser.getQueryParser().parseCommand("SELECT \"Oracle_PARTS\".\"PART_COLOR\", \"Oracle_PARTS\".\"PART_ID\", \"Oracle_PARTS\".\"PART_NAME\", \"Oracle_PARTS\".\"PART_WEIGHT\", \"SQL_PARTS\".\"PART_COLOR\", \"SQL_PARTS\".\"PART_ID\", \"SQL_PARTS\".\"PART_NAME\", \"SQL_PARTS\".\"PART_WEIGHT\" FROM   \"parts_oracle/DEV_RRAMESH\".\"PARTS\" \"Oracle_PARTS\", \"parts_sqlserver/dv_rreddy/dv_rreddy\".\"PARTS\" \"SQL_PARTS\" WHERE  (\"Oracle_PARTS\".\"PART_ID\"=\"SQL_PARTS\".\"PART_ID\")"); //$NON-NLS-1$
+        QueryParser.getQueryParser().parseCommand("SELECT \"Oracle_PARTS\".\"PART_COLOR\", \"Oracle_PARTS\".\"PART_ID\", \"Oracle_PARTS\".\"PART_NAME\", \"Oracle_PARTS\".\"PART_WEIGHT\", \"SQL_PARTS\".\"PART_COLOR\", \"SQL_PARTS\".\"PART_ID\", \"SQL_PARTS\".\"PART_NAME\", \"SQL_PARTS\".\"PART_WEIGHT\" FROM   \"parts_oracle.DEV_RRAMESH\".\"PARTS\" \"Oracle_PARTS\", \"parts_sqlserver.dv_rreddy.dv_rreddy\".\"PARTS\" \"SQL_PARTS\" WHERE  (\"Oracle_PARTS\".\"PART_ID\"=\"SQL_PARTS\".\"PART_ID\")"); //$NON-NLS-1$
     }
 
     public void testOrderByWithNumbers_InQuotes() throws Exception {       

Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/IndexMetadataFactory.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -33,16 +33,16 @@
 import java.util.Map;
 
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
-import org.teiid.connector.metadata.runtime.ColumnSetRecordImpl;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
-import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
+import org.teiid.connector.metadata.runtime.ColumnSet;
+import org.teiid.connector.metadata.runtime.Datatype;
+import org.teiid.connector.metadata.runtime.ForeignKey;
 import org.teiid.connector.metadata.runtime.KeyRecord;
 import org.teiid.connector.metadata.runtime.MetadataStore;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureParameter;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.core.index.IEntryResult;
 import org.teiid.internal.core.index.Index;
 import org.teiid.metadata.TransformationMetadata;
@@ -61,10 +61,10 @@
 public class IndexMetadataFactory {
 
 	private Index[] indexes;
-    private Map<String, DatatypeRecordImpl> datatypeCache;
+    private Map<String, Datatype> datatypeCache;
     private Map<String, KeyRecord> primaryKeyCache = new HashMap<String, KeyRecord>();
-    private Map<String, TableRecordImpl> tableCache = new HashMap<String, TableRecordImpl>();
-    private MetadataStore store = new MetadataStore();
+    private Map<String, Table> tableCache = new HashMap<String, Table>();
+	private MetadataStore store = new MetadataStore();
     
     public IndexMetadataFactory(MetadataSource source) throws IOException {
     	ArrayList<Index> tmp = new ArrayList<Index>();
@@ -86,19 +86,19 @@
 	}
     
     public void getModels() {
-    	Collection<ModelRecordImpl> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.MODEL, null, false);
-    	for (ModelRecordImpl modelRecord : records) {
-			store.addModel(modelRecord);
+    	Collection<Schema> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.MODEL, null, false);
+    	for (Schema modelRecord : records) {
+			store.addSchema(modelRecord);
 		}
     }
     
     public void getTables() {
-    	for (ModelRecordImpl model : store.getModels().values()) {
-			List<TableRecordImpl> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.TABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
+    	for (Schema model : store.getSchemas().values()) {
+			List<Table> records = findMetadataRecords(MetadataConstants.RECORD_TYPE.TABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
 			//load non-materialized first, so that the uuid->table cache is populated
-			Collections.sort(records, new Comparator<TableRecordImpl>() {
+			Collections.sort(records, new Comparator<Table>() {
 				@Override
-				public int compare(TableRecordImpl o1, TableRecordImpl o2) {
+				public int compare(Table o1, Table o2) {
 					if (!o1.isMaterialized()) {
 						return -1;
 					}
@@ -108,17 +108,17 @@
 					return 0;
 				}
 			});
-			for (TableRecordImpl tableRecord : records) {
+			for (Table tableRecord : records) {
 				tableCache.put(tableRecord.getUUID(), tableRecord);
-		    	List<ColumnRecordImpl> columns = new ArrayList<ColumnRecordImpl>(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.COLUMN));
-		        for (ColumnRecordImpl columnRecordImpl : columns) {
+		    	List<Column> columns = new ArrayList<Column>(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.COLUMN));
+		        for (Column columnRecordImpl : columns) {
 		    		columnRecordImpl.setDatatype(getDatatypeCache().get(columnRecordImpl.getDatatypeUUID()));
 				}
 		        Collections.sort(columns);
 		        tableRecord.setColumns(columns);
 		        tableRecord.setAccessPatterns(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.ACCESS_PATTERN));
-		        Map<String, ColumnRecordImpl> uuidColumnMap = new HashMap<String, ColumnRecordImpl>();
-		        for (ColumnRecordImpl columnRecordImpl : columns) {
+		        Map<String, Column> uuidColumnMap = new HashMap<String, Column>();
+		        for (Column columnRecordImpl : columns) {
 					uuidColumnMap.put(columnRecordImpl.getUUID(), columnRecordImpl);
 				}
 		        for (KeyRecord columnSetRecordImpl : tableRecord.getAccessPatterns()) {
@@ -126,7 +126,7 @@
 					columnSetRecordImpl.setTable(tableRecord);
 				}
 		        tableRecord.setForiegnKeys(findChildRecords(tableRecord, MetadataConstants.RECORD_TYPE.FOREIGN_KEY));
-		        for (ForeignKeyRecordImpl foreignKeyRecord : tableRecord.getForeignKeys()) {
+		        for (ForeignKey foreignKeyRecord : tableRecord.getForeignKeys()) {
 		        	foreignKeyRecord.setPrimaryKey(getPrimaryKey(foreignKeyRecord.getUniqueKeyID()));
 		        	loadColumnSetRecords(foreignKeyRecord, uuidColumnMap);
 		        	foreignKeyRecord.setTable(tableRecord);
@@ -177,7 +177,7 @@
 		        	tableRecord.setMaterializedStageTable(tableCache.get(tableRecord.getMaterializedStageTable().getUUID()));
 		        	tableRecord.setMaterializedTable(tableCache.get(tableRecord.getMaterializedTable().getUUID()));
 		        }
-				store.addTable(tableRecord);
+				model.addTable(tableRecord);
 			}
     	}
     }
@@ -191,11 +191,11 @@
 		return pk;
 	}
 	
-    public Map<String, DatatypeRecordImpl> getDatatypeCache() {
+    public Map<String, Datatype> getDatatypeCache() {
 		if (this.datatypeCache == null) {
-			this.datatypeCache = new HashMap<String, DatatypeRecordImpl>();
-			Collection<DatatypeRecordImpl> dataTypes = findMetadataRecords(MetadataConstants.RECORD_TYPE.DATATYPE, null, false);
-			for (DatatypeRecordImpl datatypeRecordImpl : dataTypes) {
+			this.datatypeCache = new HashMap<String, Datatype>();
+			Collection<Datatype> dataTypes = findMetadataRecords(MetadataConstants.RECORD_TYPE.DATATYPE, null, false);
+			for (Datatype datatypeRecordImpl : dataTypes) {
 				datatypeCache.put(datatypeRecordImpl.getUUID(), datatypeRecordImpl);
 				this.store.addDatatype(datatypeRecordImpl);
 			}
@@ -203,8 +203,8 @@
 		return datatypeCache;
 	}
 	
-	private ColumnRecordImpl findElement(String fullName) {
-        ColumnRecordImpl columnRecord = (ColumnRecordImpl)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
+	private Column findElement(String fullName) {
+        Column columnRecord = (Column)getRecordByType(fullName, MetadataConstants.RECORD_TYPE.COLUMN);
     	columnRecord.setDatatype(getDatatypeCache().get(columnRecord.getDatatypeUUID()));
         return columnRecord;
     }
@@ -233,21 +233,21 @@
     }
     
     public void getProcedures() {
-    	for (ModelRecordImpl model : store.getModels().values()) {
+    	for (Schema model : store.getSchemas().values()) {
 			Collection<ProcedureRecordImpl> procedureRecordImpls = findMetadataRecords(MetadataConstants.RECORD_TYPE.CALLABLE, model.getName() + IndexConstants.NAME_DELIM_CHAR + IndexConstants.RECORD_STRING.MATCH_CHAR, true);
 			for (ProcedureRecordImpl procedureRecord : procedureRecordImpls) {
-		    	procedureRecord.setParameters(new ArrayList<ProcedureParameterRecordImpl>(procedureRecord.getParameterIDs().size()));
+		    	procedureRecord.setParameters(new ArrayList<ProcedureParameter>(procedureRecord.getParameterIDs().size()));
 		    	
 		        // get the parameter metadata info
 		        for (String paramID : procedureRecord.getParameterIDs()) {
-		            ProcedureParameterRecordImpl paramRecord = (ProcedureParameterRecordImpl) this.getRecordByType(paramID, MetadataConstants.RECORD_TYPE.CALLABLE_PARAMETER);
+		            ProcedureParameter paramRecord = (ProcedureParameter) this.getRecordByType(paramID, MetadataConstants.RECORD_TYPE.CALLABLE_PARAMETER);
 		            paramRecord.setDatatype(getDatatypeCache().get(paramRecord.getDatatypeUUID()));
 		            procedureRecord.getParameters().add(paramRecord);
 		        }
 		    	
 		        String resultID = procedureRecord.getResultSetID();
 		        if(resultID != null) {
-		            ColumnSetRecordImpl resultRecord = (ColumnSetRecordImpl) getRecordByType(resultID, MetadataConstants.RECORD_TYPE.RESULT_SET, false);
+		            ColumnSet resultRecord = (ColumnSet) getRecordByType(resultID, MetadataConstants.RECORD_TYPE.RESULT_SET, false);
 		            if (resultRecord != null) {
 			            loadColumnSetRecords(resultRecord, null);
 			            procedureRecord.setResultSet(resultRecord);
@@ -265,7 +265,7 @@
 		    			procedureRecord.setQueryPlan(transformRecord.getTransformation());
 		    		}
 		        }
-				store.addProcedure(procedureRecord);
+				model.addProcedure(procedureRecord);
 			}
     	}
     }
@@ -286,7 +286,7 @@
 		return loadRecords(results);        
     }
     
-	private void loadColumnSetRecords(ColumnSetRecordImpl indexRecord, Map<String, ColumnRecordImpl> columns) {
+	private void loadColumnSetRecords(ColumnSet indexRecord, Map<String, Column> columns) {
 		for (int i = 0; i < indexRecord.getColumns().size(); i++) {
 			String uuid = indexRecord.getColumns().get(i).getUUID();
 			if (columns != null) {

Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -29,18 +29,18 @@
 import java.util.List;
 
 import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
-import org.teiid.connector.metadata.runtime.ColumnSetRecordImpl;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
-import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.Column;
+import org.teiid.connector.metadata.runtime.ColumnSet;
+import org.teiid.connector.metadata.runtime.Datatype;
+import org.teiid.connector.metadata.runtime.ForeignKey;
 import org.teiid.connector.metadata.runtime.KeyRecord;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.Schema;
+import org.teiid.connector.metadata.runtime.ProcedureParameter;
 import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.Table;
 import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl.SearchType;
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl.Variety;
+import org.teiid.connector.metadata.runtime.Column.SearchType;
+import org.teiid.connector.metadata.runtime.Datatype.Variety;
 import org.teiid.core.index.IEntryResult;
 import org.teiid.internal.core.index.EntryResult;
 import org.teiid.internal.core.index.IIndexConstants;
@@ -177,7 +177,7 @@
             case MetadataConstants.RECORD_TYPE.COLUMN: return createColumnRecord(record);
             case MetadataConstants.RECORD_TYPE.ACCESS_PATTERN: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.AccessPattern));
             case MetadataConstants.RECORD_TYPE.INDEX: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Index));
-            case MetadataConstants.RECORD_TYPE.RESULT_SET: return createColumnSetRecord(record, new ColumnSetRecordImpl());
+            case MetadataConstants.RECORD_TYPE.RESULT_SET: return createColumnSetRecord(record, new ColumnSet());
             case MetadataConstants.RECORD_TYPE.UNIQUE_KEY: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Unique));
             case MetadataConstants.RECORD_TYPE.PRIMARY_KEY: return createColumnSetRecord(record, new KeyRecord(KeyRecord.Type.Primary));
             case MetadataConstants.RECORD_TYPE.FOREIGN_KEY: return createForeignKeyRecord(record);
@@ -309,10 +309,10 @@
     /**
      * Create a ModelRecord instance from the specified index record
      */
-    public static ModelRecordImpl createModelRecord(final char[] record) {
+    public static Schema createModelRecord(final char[] record) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final ModelRecordImpl model = new ModelRecordImpl();
+        final Schema model = new Schema();
 
         // The tokens are the standard header values
         int tokenIndex = 0;
@@ -324,7 +324,7 @@
         tokenIndex++;
         
         // The next token is the model type
-        model.setModelType(ModelRecordImpl.Type.values()[Integer.parseInt((String)tokens.get(tokenIndex++))]);
+        model.setPhysical(Integer.parseInt((String)tokens.get(tokenIndex++)) == 0);
         
         // The next token is the primary metamodel Uri
         model.setPrimaryMetamodelUri(getObjectValue((String)tokens.get(tokenIndex++)));
@@ -394,10 +394,10 @@
     /**
      * Create a TableRecord instance from the specified index record
      */
-    public static TableRecordImpl createTableRecord(final char[] record) {
+    public static Table createTableRecord(final char[] record) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final TableRecordImpl table = new TableRecordImpl();
+        final Table table = new Table();
 
         // Extract the index version information from the record 
         int indexVersion = getIndexVersion(record);
@@ -412,7 +412,7 @@
         table.setCardinality( Integer.parseInt((String)tokens.get(tokenIndex++)) );
 
         // The next token is the tableType
-        table.setTableType(TableRecordImpl.Type.values()[Integer.parseInt((String)tokens.get(tokenIndex++))]);
+        table.setTableType(Table.Type.values()[Integer.parseInt((String)tokens.get(tokenIndex++))]);
 
         // The next token are the supports flags
         char[] supportFlags = ((String)tokens.get(tokenIndex++)).toCharArray();
@@ -438,11 +438,11 @@
 
         if(includeMaterializationFlag(indexVersion)) {
             // The next token are the UUIDs for the materialized table ID
-        	TableRecordImpl matTable = new TableRecordImpl();
+        	Table matTable = new Table();
         	matTable.setUUID((String)tokens.get(tokenIndex++));
             table.setMaterializedTable(matTable);
             // The next token are the UUID for the materialized stage table ID
-            matTable = new TableRecordImpl();
+            matTable = new Table();
         	matTable.setUUID((String)tokens.get(tokenIndex++));
             table.setMaterializedStageTable(matTable);
         }
@@ -453,10 +453,10 @@
         return table;
     }
 
-	private static List<ColumnRecordImpl> createColumns(List<String> uuids) {
-		List<ColumnRecordImpl> columns = new ArrayList<ColumnRecordImpl>(uuids.size());
+	private static List<Column> createColumns(List<String> uuids) {
+		List<Column> columns = new ArrayList<Column>(uuids.size());
         for (String uuid : uuids) {
-        	ColumnRecordImpl column = new ColumnRecordImpl();
+        	Column column = new Column();
         	column.setUUID(uuid);
 			columns.add(column);
 		}
@@ -466,10 +466,10 @@
     /**
      * Create a ColumnRecord instance from the specified index record
      */
-    public static ColumnRecordImpl createColumnRecord(final char[] record) {
+    public static Column createColumnRecord(final char[] record) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final ColumnRecordImpl column = new ColumnRecordImpl();
+        final Column column = new Column();
 
         // Extract the index version information from the record 
         int indexVersion = getIndexVersion(record);
@@ -553,7 +553,7 @@
     /**
      * Create a ColumnSetRecord instance from the specified index record
      */
-    public static ColumnSetRecordImpl createColumnSetRecord(final char[] record, ColumnSetRecordImpl columnSet) {
+    public static ColumnSet createColumnSetRecord(final char[] record, ColumnSet columnSet) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
 
@@ -583,10 +583,10 @@
     /**
      * Create a ForeignKeyRecord instance from the specified index record
      */
-    public static ForeignKeyRecordImpl createForeignKeyRecord(final char[] record) {
+    public static ForeignKey createForeignKeyRecord(final char[] record) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final ForeignKeyRecordImpl fkRecord = new ForeignKeyRecordImpl();
+        final ForeignKey fkRecord = new ForeignKey();
 
         // Extract the index version information from the record 
         int indexVersion = getIndexVersion(record);
@@ -613,10 +613,10 @@
     /**
      * Create a DatatypeRecord instance from the specified index record
      */
-    public static DatatypeRecordImpl createDatatypeRecord(final char[] record) {
+    public static Datatype createDatatypeRecord(final char[] record) {
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final DatatypeRecordImpl dt = new DatatypeRecordImpl();
+        final Datatype dt = new Datatype();
 
         // Extract the index version information from the record 
         int indexVersion = getIndexVersion(record);
@@ -645,7 +645,7 @@
         dt.setJavaClassName(getObjectValue((String)tokens.get(tokenIndex++)));
         
         // Set the datatype type
-        dt.setType(DatatypeRecordImpl.Type.values()[Short.parseShort((String)tokens.get(tokenIndex++))]);
+        dt.setType(Datatype.Type.values()[Short.parseShort((String)tokens.get(tokenIndex++))]);
         
         // Set the search type
         dt.setSearchType(SearchType.values()[3 - Integer.parseInt((String)tokens.get(tokenIndex++))]);
@@ -731,11 +731,11 @@
      * Create a ProcedureParameterRecord instance from the specified index record
      * header|defaultValue|dataType|length|radix|scale|nullType|precision|paramType|footer|
      */
-    public static ProcedureParameterRecordImpl createProcedureParameterRecord(final char[] record) {
+    public static ProcedureParameter createProcedureParameterRecord(final char[] record) {
 
         final String str = new String(record);
         final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
-        final ProcedureParameterRecordImpl paramRd = new ProcedureParameterRecordImpl();
+        final ProcedureParameter paramRd = new ProcedureParameter();
 
         // The tokens are the standard header values
         int tokenIndex = 0;
@@ -773,22 +773,22 @@
         paramRd.setPosition(Integer.parseInt((String)tokens.get(tokenIndex++)) );
 
         // The next token is parameter type
-        ProcedureParameterRecordImpl.Type type = null;
+        ProcedureParameter.Type type = null;
         switch (Short.parseShort((String)tokens.get(tokenIndex++))) {
         case MetadataConstants.PARAMETER_TYPES.IN_PARM:
-        	type = ProcedureParameterRecordImpl.Type.In;
+        	type = ProcedureParameter.Type.In;
         	break;
         case MetadataConstants.PARAMETER_TYPES.INOUT_PARM:
-        	type = ProcedureParameterRecordImpl.Type.InOut;
+        	type = ProcedureParameter.Type.InOut;
         	break;
         case MetadataConstants.PARAMETER_TYPES.OUT_PARM:
-        	type = ProcedureParameterRecordImpl.Type.Out;
+        	type = ProcedureParameter.Type.Out;
         	break;
         case MetadataConstants.PARAMETER_TYPES.RESULT_SET:
-        	type = ProcedureParameterRecordImpl.Type.ResultSet;
+        	type = ProcedureParameter.Type.ResultSet;
         	break;
         case MetadataConstants.PARAMETER_TYPES.RETURN_VALUE:
-        	type = ProcedureParameterRecordImpl.Type.ReturnValue;
+        	type = ProcedureParameter.Type.ReturnValue;
         	break;
         }
         paramRd.setType(type);
@@ -1012,16 +1012,17 @@
         
         record.setUUID(getObjectValue(objectID));
         if (fullName != null) {
-        	int index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
-            String name = fullName;
-            if (index > 0) {
-            	name = fullName.substring(index + 1);
-            }
-            if (record instanceof ColumnRecordImpl) {
-                index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
+        	String name = fullName;
+            if (record instanceof Column) { //take only the last part
+                int index = fullName.lastIndexOf(IndexConstants.NAME_DELIM_CHAR);
                 if (index > 0) {
                 	name = fullName.substring(index + 1);
                 }
+            } else { //remove model name
+	            int index = fullName.indexOf(IndexConstants.NAME_DELIM_CHAR);
+	            if (index > 0) {
+	            	name = fullName.substring(index + 1);
+	            }
             }
             record.setName(name);
         }

Modified: trunk/metadata/src/test/java/com/metamatrix/metadata/runtime/FakeMetadataService.java
===================================================================
--- trunk/metadata/src/test/java/com/metamatrix/metadata/runtime/FakeMetadataService.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/metadata/src/test/java/com/metamatrix/metadata/runtime/FakeMetadataService.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -28,7 +28,7 @@
 import java.util.Map;
 import java.util.Properties;
 
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.Datatype;
 import org.teiid.metadata.CompositeMetadataStore;
 import org.teiid.metadata.TransformationMetadata;
 import org.teiid.metadata.index.IndexMetadataFactory;
@@ -79,7 +79,7 @@
 	}
 	
 	@Override
-	public Map<String, DatatypeRecordImpl> getBuiltinDatatypes()
+	public Map<String, Datatype> getBuiltinDatatypes()
 			throws MetaMatrixComponentException {
 		return null;
 	}

Modified: trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedMetadataService.java
===================================================================
--- trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedMetadataService.java	2009-11-17 19:07:47 UTC (rev 1570)
+++ trunk/runtime/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedMetadataService.java	2009-11-18 15:26:22 UTC (rev 1571)
@@ -38,7 +38,7 @@
 import java.util.Properties;
 import java.util.Set;
 
-import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.Datatype;
 import org.teiid.connector.metadata.runtime.MetadataStore;
 import org.teiid.metadata.CompositeMetadataStore;
 import org.teiid.metadata.TransformationMetadata;
@@ -205,11 +205,11 @@
 		return null;
 	}
 
-	public Map<String, DatatypeRecordImpl> getBuiltinDatatypes() {
-		Collection<DatatypeRecordImpl> datatypes = this.systemMetadataStore.getDatatypes();
-		Map<String, DatatypeRecordImpl> datatypeMap = new HashMap<String, DatatypeRecordImpl>();
+	public Map<String, Datatype> getBuiltinDatatypes() {
+		Collection<Datatype> datatypes = this.systemMetadataStore.getDatatypes();
+		Map<String, Datatype> datatypeMap = new HashMap<String, Datatype>();
 		for (Class<?> typeClass : DataTypeManager.getAllDataTypeClasses()) {
-			for (DatatypeRecordImpl datatypeRecordImpl : datatypes) {
+			for (Datatype datatypeRecordImpl : datatypes) {
 				if (datatypeRecordImpl.getJavaClassName().equals(typeClass.getName())) {
 					datatypeMap.put(DataTypeManager.getDataTypeName(typeClass), datatypeRecordImpl);
 					break;



More information about the teiid-commits mailing list