[teiid-commits] teiid SVN: r3882 - in branches/7.7.x/connectors/sandbox/translator-coherence: src/main/java/org/teiid/translator/coherence and 8 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Feb 14 14:24:22 EST 2012


Author: van.halbert
Date: 2012-02-14 14:24:21 -0500 (Tue, 14 Feb 2012)
New Revision: 3882

Added:
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/util/
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/util/ObjectSourceMethodManager.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/META-INF/
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/META-INF/jboss-beans.xml
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/.project
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade.vdb
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_Object.xmi
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_View.xmi
Modified:
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecution.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecutionFactory.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceUpdateExecution.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/SourceCacheAdapter.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/visitor/CoherenceVisitor.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/org/teiid/translator/coherence/i18n.properties
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/TestCoherenceTranslator.java
   branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/Trade.java
   branches/7.7.x/connectors/sandbox/translator-coherence/usage-guidelines.txt
Log:
added designer proejct artifacts, refactored reflection method management and added new logic for update (but not yet fully functional), and forgot the jboss-beans.xml template

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecution.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecution.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecution.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -1,6 +1,25 @@
 /*
- * ${license}
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
  */
+
 package org.teiid.translator.coherence;
 
 import java.util.Collections;
@@ -19,7 +38,7 @@
 
 
 /**
- * Execution of a command. Currently, only select is supported.
+ * Execution of the SELECT Command
  */
 public class CoherenceExecution implements ResultSetExecution {
 

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecutionFactory.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecutionFactory.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceExecutionFactory.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -59,7 +59,7 @@
 		this.setSourceRequired(false);
 		this.setSupportsOrderBy(false);
 		this.setSupportsSelectDistinct(false);
-		this.setSupportsInnerJoins(false);
+		this.setSupportsInnerJoins(true);
 		this.setSupportsFullOuterJoins(false);
 		this.setSupportsOuterJoins(false);
 

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceUpdateExecution.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceUpdateExecution.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/CoherenceUpdateExecution.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -21,48 +21,41 @@
  */
 package org.teiid.translator.coherence;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 import javax.resource.ResourceException;
 
-import org.teiid.dqp.internal.datamgr.RuntimeMetadataImpl;
 import org.teiid.language.ColumnReference;
 import org.teiid.language.Command;
-import org.teiid.language.Comparison;
+import org.teiid.language.Comparison.Operator;
 import org.teiid.language.Condition;
 import org.teiid.language.Delete;
 import org.teiid.language.Expression;
 import org.teiid.language.ExpressionValueSource;
 import org.teiid.language.Insert;
 import org.teiid.language.Literal;
-import org.teiid.language.NamedTable;
 import org.teiid.language.SetClause;
 import org.teiid.language.Update;
-import org.teiid.language.Comparison.Operator;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.metadata.AbstractMetadataRecord;
 import org.teiid.metadata.Column;
 import org.teiid.metadata.ForeignKey;
 import org.teiid.metadata.RuntimeMetadata;
 import org.teiid.metadata.Table;
 import org.teiid.resource.adapter.coherence.CoherenceConnection;
+import org.teiid.resource.adapter.coherence.CoherenceFilterUtil;
+import org.teiid.translator.DataNotAvailableException;
 import org.teiid.translator.ExecutionContext;
 import org.teiid.translator.TranslatorException;
-import org.teiid.translator.DataNotAvailableException;
 import org.teiid.translator.UpdateExecution;
+import org.teiid.translator.coherence.util.ObjectSourceMethodManager;
 import org.teiid.translator.coherence.visitor.CoherenceVisitor;
 import org.teiid.translator.coherence.visitor.DeleteVisitor;
 
-import com.tangosol.coherence.component.util.Collections;
-import com.tangosol.coherence.component.util.Iterator;
 
 
-
 /**
- * Please see the user's guide for a full description of capabilties, etc.
+ * Please see the user's guide for a full description of capabilities, etc.
  * 
  * Description/Assumptions:
  * 
@@ -127,50 +120,67 @@
 			throws TranslatorException {
 
 		Insert icommand = (Insert) command;		
-
-		RuntimeMetadataImpl impl = (RuntimeMetadataImpl) metadata;
 		
 		Table t = metadata.getTable(icommand.getTable().getMetadataObject().getFullName());
-		List<ForeignKey> fks = t.getForeignKeys();
 		
-		String parentToChildMethod = null;
+		// if the table has a foreign key, its must be a child (contained) object in the root
+		if (t.getForeignKeys() != null && t.getForeignKeys().size() > 0) {
+			this.addChildObject(t);
+			return;
+		}
 		String pkColName = null;
 		
-		// if a foreign key exist, then what's being updated is contained in its parent object.
-		// gather all the foreign key related info that will be needed
-		String parentColName = null;
-		Table parentTable = null;
-		// if a foreign key is defined, then this is a child object being processed
-		if (fks.size() > 0) {
-			ForeignKey fk = fks.get(0);
-			parentTable = fk.getParent();
-			// the name of the method to obtain the collection is the nameInSource of the foreginKey
-			parentToChildMethod = fk.getNameInSource();
-			
-			// there must only be 1 column in the primary key
-			parentColName = visitor.getNameFromElement(fk.getPrimaryKey().getColumns().get(0));
-					
-		} else {
-			// process the top level object
-			List<Column> pk = t.getPrimaryKey().getColumns();
-			if (pk == null || pk.isEmpty()) {
-	            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noPrimaryKeyDefinedOnTable", new Object[] {t.getName()}); //$NON-NLS-1$
-				throw new TranslatorException(msg);		
-			}
-			
-			pkColName = visitor.getNameFromElement(pk.get(0));
-		
+		// process the top level object
+		List<Column> pk = t.getPrimaryKey().getColumns();
+		if (pk == null || pk.isEmpty()) {
+            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noPrimaryKeyDefinedOnTable", new Object[] {t.getName()}); //$NON-NLS-1$
+			throw new TranslatorException(msg);		
 		}
 		
+		pkColName = visitor.getNameFromElement(pk.get(0));
 		
+		Object newObject = cacheTranslator.createObject(icommand.getColumns(), 
+				((ExpressionValueSource)icommand.getValueSource()).getValues(), 
+				this.visitor, 
+				t);
+		
+		// get the key value to use to for adding to the cache
+		Object keyvalue = ObjectSourceMethodManager.getValue("get" + pkColName, newObject);
+	
+		// add to cache
+		try {
+			this.connection.add(keyvalue, newObject);
+		} catch (ResourceException e) {
+			throw new TranslatorException(e);
+		}			
+
+		
+	}
+	
+	private void addChildObject(Table t) throws TranslatorException {
+		List<ForeignKey> fks = t.getForeignKeys();
+		
+		ForeignKey fk = fks.get(0);
+		Table parentTable = fk.getParent();
+		// the name of the method to obtain the collection is the nameInSource of the foreginKey
+		String parentToChildMethod = fk.getNameInSource();
+		if(parentToChildMethod == null) {
+            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noNameInSourceForForeingKey", new Object[] {fk.getName()}); //$NON-NLS-1$
+			throw new TranslatorException(msg);
+		}		
+		
+		
+		// there must only be 1 column in the primary key
+		String parentColName = visitor.getNameFromElement(fk.getPrimaryKey().getColumns().get(0));
+		
+		Insert icommand = (Insert) command;	
+		
 		List<ColumnReference> insertElementList = icommand.getColumns();
 		List<Expression> insertValueList = ((ExpressionValueSource)icommand.getValueSource()).getValues();
 		if(insertElementList.size() != insertValueList.size()) {
 			throw new TranslatorException("Error:  columns.size and values.size are not the same.");
 		}
-		
-		Object parentObject = null;
-		Object parentContainer = null;
+
 		ColumnReference insertElement;
 		String[] nameOfElement = new String[insertElementList.size()];
 		
@@ -181,101 +191,80 @@
 //			// call utility class to get NameInSource/Name of element
 			nameOfElement[i]= visitor.getNameFromElement(insertElement.getMetadataObject());
 			
-			if (parentColName != null) {
+			// match the parent column to the colum in the insert statement
 				if (nameOfElement[i].equalsIgnoreCase(parentColName)) {
 					parentValueLoc = i;					
-				}
-			}
-				
-		}		
+				}				
+		}	
 		
-		// this loop will
-		// 	-  get the nameInSource for each column that will be used to set the value
-		//  -  (and primarily), determine the location of the column that corresponds to the foreign key
-		//		the value for the foreign key will be needed to find the parent
-		if (parentColName != null) {
-			if (parentValueLoc == -1) {
+		if (parentColName != null && parentValueLoc == -1) {
 	            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noColumnMatchedForeignColumn", new Object[] {t.getName(), parentColName}); //$NON-NLS-1$
 				throw new TranslatorException(msg);
 				
+		}
+		
+		// get the parent key and find the root object
+		Object parentValue = insertValueList.get(parentValueLoc);
+		Object val;
+		if(parentValue instanceof Literal) {
+			Literal literalValue = (Literal)parentValue;
+			val = literalValue.getValue();
+		} else {
+			val = parentValue;
+		}
+		
+		Object parentObject = null;
+		// get the parent object from the cache
+		try {
+			List<Object> result = this.connection.get(  CoherenceFilterUtil.createCompareFilter(parentColName, val, Operator.EQ, val.getClass())   );
+			//		visitor.createFilter(parentColName + " = " + val));
+			if (result == null || result.isEmpty()) {
+	            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noobjectfound", new Object[] {parentTable.getName(), parentColName, val}); //$NON-NLS-1$
+				throw new TranslatorException(msg);
 			}
-			Object parentValue = insertValueList.get(parentValueLoc);
-			Object val;
-			if(parentValue instanceof Literal) {
-				Literal literalValue = (Literal)parentValue;
-				val = literalValue.getValue();
-				//.toString();
-			} else {
-				val = parentValue;
-				//.toString();
-			}
-			
-			// get the parent object from the cache
-			try {
-				List<Object> result = this.connection.get(visitor.createFilter(parentColName + " = " + val));
-				if (result == null || result.isEmpty()) {
-		            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noobjectfound", new Object[] {parentTable.getName(), parentColName, val}); //$NON-NLS-1$
-					throw new TranslatorException(msg);
-				}
-				parentObject = result.get(0);
-			} catch (ResourceException e) {
-				throw new TranslatorException(e);
-			}			
-			
-			List<String> token = new ArrayList<String>(1);
-			token.add(parentToChildMethod);
-			 
-			// call to get the Object on the parent, which will be a container of some sort, for which the new object will be added
-			parentContainer = cacheTranslator.getValue(visitor.getTableName(), token, Collections.class, parentObject, 0);
+			parentObject = result.get(0);
+		} catch (ResourceException e) {
+			throw new TranslatorException(e);
+		}			
 
-			
-		} 
-		// create the new object that will either be added as a top level object or added to the parent container
-		String tableName =  this.visitor.getNameFromTable(t);
-		Object newObject = cacheTranslator.createObjectFromMetadata(tableName);		
+		// create and load the child object data
+		Object newChildObject = cacheTranslator.createObject(insertElementList, 
+				insertValueList, 
+				this.visitor, 
+				t);
+		
+		///--- questions
+		/// --- how to not process - setvalue for parent column
+		/// --- need to get the key value off the object of the parent
+		
+		// get the key value to use to for adding to the cache
+		Object parentContainer = ObjectSourceMethodManager.getValue("get" + parentToChildMethod, parentObject);
+		if (parentContainer == null) {
+	        final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noParentContainerObjectFound", new Object[] {parentTable.getName(), parentToChildMethod}); //$NON-NLS-1$
+			throw new TranslatorException(msg);	
 
-		Object keyvalue = null;
-		for (int i=0; i < insertElementList.size(); i++) {
-			insertElement = insertElementList.get(i);
+		}
+		
+		if (parentContainer.getClass().isArray() ) {
 			
-			Object value = insertValueList.get(i);
-			Object val;
-			if(value instanceof Literal) {
-				Literal literalValue = (Literal)value;
-				val = literalValue.getValue();
-				//.toString();
-				if(null != val && val instanceof String) {
-					//!val.isEmpty()) {
-					val = this.stripQutes((String) val);
-				}
-			} else {
-				val = value;
-				//.toString();
-			}
-
-			if (parentColName == null && nameOfElement[i].equalsIgnoreCase(pkColName)) {
-				keyvalue = val;
-			}
+		} else if  (parentContainer instanceof Collection) {
+			Collection c = (Collection) parentContainer;
+			c.add(newChildObject);
+		} else if  ( parentContainer instanceof Map) {
 			
-		    this.cacheTranslator.setValue(tableName, nameOfElement[i], newObject, val, insertElement.getType()); 
+			Map m = (Map) parentContainer;
+			
+			m.put(1, newChildObject);
 		}
 
-		if (parentColName == null) {
-			// add top level object
-			try {
-				this.connection.add(keyvalue, newObject);
-			} catch (ResourceException e) {
-				throw new TranslatorException(e);
-			}			
-		} else {
-			// TODO:  add logic to add Map and Array's
-			((Collection) parentContainer).add(newObject);
-
-		}
+		try {
+			this.connection.update(parentValue, parentObject);
+		} catch (ResourceException e) {
+			throw new TranslatorException(e);
+		}			
 		
 	}
 
-
 	private void executeDelete()
 			throws TranslatorException {
 		
@@ -287,7 +276,11 @@
             throw visitor.getException();
         }
 
-		
+        if (visitor.getKeys() == null || visitor.getKeys().isEmpty()) {
+            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.objectNotDeleted", new Object[] {visitor.getTableName()}); //$NON-NLS-1$
+			throw new TranslatorException(msg);	
+        }
+
         for (java.util.Iterator it=visitor.getKeys().iterator(); it.hasNext();) {
         	Object key = it.next();
 			try {
@@ -299,91 +292,76 @@
 
 	}
 
-	// Private method to actually do an update operation.  Per JNDI doc at
-	// http://java.sun.com/products/jndi/tutorial/ldap/models/operations.html, 
-	// the JNDI method to use to update an entry to LDAP is one of the
-	// DirContext.modifyAttributes() methods that takes ModificationItem[]
-	// as a parameter, so that is what is used here.
-	// Note that this method does not allow for changing of the DN - to
-	// implement that we would need to use Context.rename().  Since right
-	// now we only call modifyAttributes(), and don't check for the DN
-	// in the list of updates, we will attempt to update the DN using
-	// modifyAttributes(), and let the LDAP server fail the request (and
-	// send us the explanation for the failure, which is returned in
-	// a ConnectorException)
-	//
-	// The update criteria must include only an equals comparison
-	// on the "DN" column ("WHERE DN='cn=John Doe,ou=people,dc=company,dc=com'") 
+	// Private method to actually do an update operation.  
 	private void executeUpdate()
 			throws TranslatorException {
-//
-//		List<SetClause> updateList = ((Update)command).getChanges();
-//		Condition criteria = ((Update)command).getWhere();
-//
-//		// since we have the exact same processing rules for criteria
-//		// for updates and deletes, we use a common private method to do this.
-//		// note that this private method will throw a ConnectorException
-//		// for illegal criteria, which we deliberately don't catch
-//		// so it gets passed on as is.
-//		String distinguishedName = getDNFromCriteria(criteria);
-//		
-//
-//		// this will be the list of modifications to attempt.  Since
-//		// we currently blindly try all the updates the query
-//		// specifies, right now this is the same size as the updateList.
-//		// When we start filtering out DN changes (which would need to
-//		// be performed separately using Context.rename()), we will
-//		// need to account for this in determining this list size. 
-//		ModificationItem[] updateMods = new ModificationItem[updateList.size()];
-//		ColumnReference leftElement;
-//		Expression rightExpr;
-//		String nameLeftElement;
-//		Object valueRightExpr;
-//		// iterate through the supplied list of updates (each of
-//		// which is an ICompareCriteria with an IElement on the left
-//		// side and an IExpression on the right, per the Connector
-//		// API).
-//		for (int i=0; i < updateList.size(); i++) {
-//			SetClause setClause = updateList.get(i);
-//			// trust that connector API is right and left side
-//			// will always be an IElement
-//			leftElement = setClause.getSymbol();
-//			// call utility method to get NameInSource/Name for element
-//			nameLeftElement = getNameFromElement(leftElement);
-//			// get right expression - if it is not a literal we
-//			// can't handle that so throw an exception
-//			rightExpr = setClause.getValue();
+		Update ucommand = (Update) command;	
+		
+		Table t = metadata.getTable(ucommand.getTable().getMetadataObject().getFullName());
+//		List<ForeignKey> fks = t.getForeignKeys();
+		
+		// if the table has a foreign key, its must be a child (contained) object in the root
+		if (t.getForeignKeys() != null && t.getForeignKeys().size() > 0) {
+			 updateChildObject(t);
+			 return;
+		}
+
+	}
+	
+	private void updateChildObject(Table t) throws TranslatorException {
+		List<ForeignKey> fks = t.getForeignKeys();
+		
+		ForeignKey fk = fks.get(0);
+		Table parentTable = fk.getParent();
+		// the name of the method to obtain the collection is the nameInSource of the foreginKey
+		String parentToChildMethod = fk.getNameInSource();
+		if(parentToChildMethod == null) {
+            final String msg = CoherencePlugin.Util.getString("CoherenceUpdateExecution.noNameInSourceForForeingKey", new Object[] {fk.getName()}); //$NON-NLS-1$
+			throw new TranslatorException(msg);
+		}		
+		
+		// there must only be 1 column in the primary key
+		String parentColName = visitor.getNameFromElement(fk.getPrimaryKey().getColumns().get(0));
+		
+		List<SetClause> updateList = ((Update)command).getChanges();
+		Condition criteria = ((Update)command).getWhere();
+		
+		ColumnReference leftElement;
+		Expression rightExpr;
+		String nameLeftElement;
+		Object valueRightExpr;
+		// iterate through the supplied list of updates (each of
+		// which is an ICompareCriteria with an IElement on the left
+		// side and an IExpression on the right, per the Connector
+		// API).
+		for (int i=0; i < updateList.size(); i++) {
+			SetClause setClause = updateList.get(i);
+			// trust that connector API is right and left side
+			// will always be an IElement
+			leftElement = setClause.getSymbol();
+			// call utility method to get NameInSource/Name for element
+			nameLeftElement = visitor.getNameFromElement(leftElement.getMetadataObject());
+			// get right expression - if it is not a literal we
+			// can't handle that so throw an exception
+			rightExpr = setClause.getValue();
 //			if (!(rightExpr instanceof Literal)) { 
-//	            final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.valueNotLiteralError",nameLeftElement); //$NON-NLS-1$
+//	            final String msg = CoherencePlugin.Util.getString("LDAPUpdateExecution.valueNotLiteralError",nameLeftElement); //$NON-NLS-1$
 //				throw new TranslatorException(msg);
 //		}
-//			valueRightExpr = ((Literal)rightExpr).getValue();
-//			// add in the modification as a replacement - meaning
-//			// any existing value(s) for this attribute will
-//			// be replaced by the new value.  If the attribute
-//			// didn't exist, it will automatically be created
-//			// TODO - since null is a valid attribute
-//			// value, we don't do any special handling of it right
-//			// now.  But maybe null should mean to delete an
-//			// attribute?
-//		        updateMods[i] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(nameLeftElement, valueRightExpr));
-//		}
-//		// just try to update an LDAP entry using the DN and
-//		// attributes specified in the UPDATE operation.  If it isn't
-//		// legal, we'll get a NamingException back, whose explanation
-//		// we'll return in a ConnectorException
-//		try {
-//			ldapCtx.modifyAttributes(distinguishedName, updateMods);
-//		} catch (NamingException ne) {
-//            final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailed",distinguishedName,ne.getExplanation()); //$NON-NLS-1$
-//			throw new TranslatorException(msg);
-//		// don't remember why I added this generic catch of Exception,
-//		// but it does no harm...
-//		} catch (Exception e) {
-//            final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.updateFailedUnexpected",distinguishedName); //$NON-NLS-1$
-//			throw new TranslatorException(e, msg);
-//		}
+			valueRightExpr = ((Literal)rightExpr).getValue();
+			// add in the modification as a replacement - meaning
+			// any existing value(s) for this attribute will
+			// be replaced by the new value.  If the attribute
+			// didn't exist, it will automatically be created
+			// TODO - since null is a valid attribute
+			// value, we don't do any special handling of it right
+			// now.  But maybe null should mean to delete an
+			// attribute?
+		}		
+
+
 	}
+	
 
 	// cancel here by closing the copy of the ldap context (if it was
 	// initialized, which is only true if execute() was previously called)
@@ -400,25 +378,10 @@
 	// javax.naming.Context javadoc so we won't worry about this also
 	// happening in our close method
 	public void close() {
-//		try {
-//			if(ldapCtx != null) {
-//				ldapCtx.close();
-//			}
-//		} catch (NamingException ne) {
-//            final String msg = LDAPPlugin.Util.getString("LDAPUpdateExecution.closeContextError",ne.getExplanation()); //$NON-NLS-1$
-//            LogManager.logWarning(LogConstants.CTX_CONNECTOR,msg);
-//		}
+
 	}
-	
-	private String stripQutes(String id) {
-		if((id.startsWith("'") && id.endsWith("'"))) {
-			id = id.substring(1,id.length()-1);
-		} else if ((id.startsWith("\"") && id.endsWith("\""))) {
-			id = id.substring(1,id.length()-1);
-		}
-		return id;
-	}
 
+
 }
 	
 

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/SourceCacheAdapter.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/SourceCacheAdapter.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/SourceCacheAdapter.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -22,12 +22,11 @@
 
 package org.teiid.translator.coherence;
 
-import java.lang.reflect.InvocationTargetException;
+
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -36,8 +35,11 @@
 import java.util.Set;
 
 import org.teiid.core.types.DataTypeManager;
-import org.teiid.core.util.ReflectionHelper;
+import org.teiid.core.types.TransformationException;
 import org.teiid.core.util.StringUtil;
+import org.teiid.language.ColumnReference;
+import org.teiid.language.Expression;
+import org.teiid.language.Literal;
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
 import org.teiid.metadata.Column;
@@ -46,6 +48,7 @@
 import org.teiid.metadata.Schema;
 import org.teiid.metadata.Table;
 import org.teiid.translator.TranslatorException;
+import org.teiid.translator.coherence.util.ObjectSourceMethodManager;
 import org.teiid.translator.coherence.visitor.CoherenceVisitor;
 
 
@@ -93,16 +96,8 @@
   public void addMetadata() throws TranslatorException {
 	  
   }
-  
+   
   /**
-   * Called to request the class name for the specified <code>objectName</code>
-   * @param objectName is the name of the object for which the class name is being requested
-   * @return String class name for the specified objectName
-   * @throws TranslatorException
-   */
-//  public abstract String getMappedClass(String objectName) throws TranslatorException;
-  
-  /**
    * Called to translate the list of <code>objects</code> returned from the Coherence cache.
    * The implementor will use the <code>visitor</code> to obtain sql parsed information 
    * needed to understand the columns requested.  Then use the @see #retrieveValue method
@@ -169,7 +164,7 @@
 						 String a = attributeTokensForCollection.get(collectionNodeDepth);
 						 String b = tokens.get(holder.collectionNodeDepth);
 						 if (!b.equals(a)) {
-							 throw new TranslatorException("Query Error: multiple collections found between " + a + " and " + b +", only 1 is supported per query" );
+							 throw new TranslatorException("Query Error: multiple collections found between " + attributeTokensForCollection.toString() + " and " + holder.nameNodes.toString() +" (table: " + holder.tableName + " at node depth " + collectionNodeDepth + ", only 1 is supported per query" );
 					  
 						 }
 						 collectionNames.add(n);
@@ -260,11 +255,10 @@
     	addMetadata();
     }
 
-  public Object getValue(String tableName, List<String> nameTokens, Class type, Object cachedObject, int level ) throws TranslatorException {
+  public Object getValue(String tableName, List<String> nameTokens, Class<?> type, Object cachedObject, int level ) throws TranslatorException {
 		final ParmHolder holder = ParmHolder.createParmHolder(tableName, nameTokens, type);
 		Object value =  retrieveValue(holder, cachedObject, level);
 		return value;
-
   }
 
 		
@@ -274,88 +268,132 @@
 		 return cachedObject;
 	 }
 
-	 final Class objectClass = cachedObject.getClass();
-	 
 	 final String columnName = holder.nameNodes.get(level);
 
 	 boolean atTheBottom = false;
 	 
 	 if (holder.nodeSize == (level + 1)) atTheBottom = true;
 	 
-	 try {
-		 String methodName = null;
-		 // only the last parsed name can be where the boolean call can be made
-		 // example:  x.y.z     z will be where "is" is called
-		 //			  or x	    x could be where "is" is called 
-		 if (atTheBottom && holder.attributeType == Boolean.class) {
-			 methodName = "is" + columnName;
-		 } else {
-			 methodName = "get" + columnName;
-		 }
-
-		 final Method m = findBestMethod(objectClass, methodName, null);
+	 String methodName = null;
+	 // only the last parsed name can be where the boolean call can be made
+	 // example:  x.y.z     z will be where "is" is called
+	 //			  or x	    x could be where "is" is called 
+	 if (atTheBottom && holder.attributeType != null && holder.attributeType == Boolean.class) {
+		 methodName = "is" + columnName;
+	 } else {
+		 methodName = "get" + columnName;
+	 }
+	 
+	 final Object value = ObjectSourceMethodManager.getValue(methodName, cachedObject);
+	 
+	 // if an array or collection, return, this will be processed after all objects are obtained
+	 // in order the number of rows can be created
+	 if (value == null) {
+		 return null;
+	 }
+	  if (value.getClass().isArray() || value instanceof Collection || value instanceof Map) {
+		  holder.setCollection(level);  
+		  return value;
+	  }
 		 
-		 final Object value = m.invoke(cachedObject, null);
-		 
-		 // if an array or collection, return, this will be processed after all objects are obtained
-		 // in order the number of rows can be created
-		 if (value == null) {
-			 return null;
-		 }
-		  if (value.getClass().isArray() || value instanceof Collection || value instanceof Map) {
-			  holder.setCollection(level);  
-//			  System.out.println("Found Collection: " + methodName);
-			  return value;
-		  }
-			 
-			 if (atTheBottom) {
-				 return value;
-			 }
+	 if (atTheBottom) {
+		 return value;
+	 }
 
-		  return retrieveValue(holder, value, ++level);
-
-		  
-//		 	LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Got value " + value); //$NON-NLS-1$
+	 return retrieveValue(holder, value, ++level);
 		 	
-			 
-	 } catch (InvocationTargetException x) {
-		 Throwable cause = x.getCause();
-		 System.err.format("invocation of %s failed: %s%n",
-				 "get" + columnName, cause.getMessage());
-		 LogManager.logError(LogConstants.CTX_CONNECTOR, "Error calling get" + columnName + ":" + cause.getMessage());
-		 return null;
-	 } catch (Exception e) {
-		 e.printStackTrace();
-		 throw new TranslatorException(e.getMessage());
-	 }
   }
 
   public Object createObjectFromMetadata(String metadataName) throws TranslatorException {
-//	  String mappedClass = getMappedClass(metadataName);
-	  return createObject(metadataName);
+	  return ObjectSourceMethodManager.createObject(metadataName);
 	  
   }
+  
+  public Object createObject(List<ColumnReference> columnList, List<Expression> valueList, CoherenceVisitor visitor, Table t  ) throws TranslatorException {
+		if(columnList.size() != valueList.size()) {
+			throw new TranslatorException("Error:  columns.size and values.size are not the same.");
+		}
 
-  private Object createObject(String objectClassName) throws TranslatorException {
-		try {
+		// create the new object that will either be added as a top level object or added to the parent container
+		String tableName =  visitor.getNameFromTable(t);
+		Object newObject = createObjectFromMetadata(tableName);		
+
+		for (int i=0; i < columnList.size(); i++) {
+			final ColumnReference insertElement = columnList.get(i);
+			if (!insertElement.getMetadataObject().isUpdatable()) continue;
 			
-			return  ReflectionHelper
-					.create(objectClassName,
-							null, null);
-		} catch (Exception e1) {
-			throw new TranslatorException(e1);
+			final String elementName = visitor.getNameFromElement(insertElement.getMetadataObject());
+			
+			final Object value = valueList.get(i);
+			Object val;
+			if(value instanceof Literal) {
+				Literal literalValue = (Literal)value;
+				val = literalValue.getValue();
+				//.toString();
+				if(null != val && val instanceof String) {
+					//!val.isEmpty()) {
+					val = stripQutes((String) val);
+				}
+			} else {
+				val = value;
+				//.toString();
+			}
+			
+		    setValue(tableName, elementName, newObject, val, insertElement.getType()); 
 		}
-	  
+
+		return newObject;
   }
   
+	private String stripQutes(String id) {
+		if((id.startsWith("'") && id.endsWith("'"))) {
+			id = id.substring(1,id.length()-1);
+		} else if ((id.startsWith("\"") && id.endsWith("\""))) {
+			id = id.substring(1,id.length()-1);
+		}
+		return id;
+	}
+  
   public Object setValue(String tableName, String columnName, Object cachedObject, Object value, Class classtype) throws TranslatorException {
-		LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Adding value to attribute: " + columnName); //$NON-NLS-1$
+		LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Setting value to attribute: " + columnName); //$NON-NLS-1$
 		
-	 try {
+		List<String> tokens = StringUtil.getTokens(columnName, ".");
+		
+		final ParmHolder holder = ParmHolder.createParmHolder(tableName, tokens, classtype);
+		
+		return setValue(holder, cachedObject, value, 0);
+  }
+  
+  private Object setValue(ParmHolder holder, Object cachedObject, Object value, int level) throws TranslatorException {
+		// if there are muliple nameNodes, 
+	    //			then do "get" for all but the last node, then set
+	    // 			if a "container" type object is encountered, then create the object type for the table and add it to the container
+	  //				if a map, do a put
+	  //				if a collection, do an add 
+		 
+		 final String columnName = holder.nameNodes.get(level);
+
+		 boolean atTheBottom = false;
+		 
+		 if (holder.nodeSize == (level + 1)) atTheBottom = true;
+ 
+		  if (!atTheBottom) {
+
+				final Object containerObject = ObjectSourceMethodManager.getValue("get" + columnName, cachedObject);
+				 
+				if (containerObject.getClass().isArray() || containerObject instanceof Collection || containerObject instanceof Map) {
+					 					 
+				return cachedObject;
+			}
+
+
+			  
+		  }
 		 ArrayList argTypes = new ArrayList(1);
-		 argTypes.add(classtype);
-		 Method m = findBestMethod(cachedObject.getClass(), "set" + columnName, argTypes);
+		 argTypes.add(holder.attributeType);
 		 
+		 Method m = ObjectSourceMethodManager.getMethod(cachedObject.getClass(), "set" + columnName, argTypes);
+		 
 		 Class[] setTypes = m.getParameterTypes();
 		 
 		 
@@ -363,57 +401,22 @@
 		 if (value instanceof Collection || value instanceof Map || value.getClass().isArray() ) {
 			 newValue = value;
 		 } else {
-			 newValue = DataTypeManager.transformValue(value, setTypes[0]);
+			 try {
+				newValue = DataTypeManager.transformValue(value, setTypes[0]);
+			} catch (TransformationException e) {
+				// TODO Auto-generated catch block
+				throw new TranslatorException(e);
+			}
 		 }
-	//	 Object newValue = getArg(m, value);
-			 m.invoke(cachedObject, new Object[] {newValue});
+		 ObjectSourceMethodManager.executeMethod(m, cachedObject, new Object[] {newValue});
 		 	
-		 	LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Set value " + value); //$NON-NLS-1$
+		 LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Set value " + newValue); //$NON-NLS-1$
 		 return newValue;
-	 } catch (InvocationTargetException x) {
-		 x.printStackTrace();
-		 Throwable cause = x.getCause();
-		 System.err.format("invocation of %s failed: %s%n",
-				 "set" + columnName, cause.getMessage());
-		 LogManager.logError(LogConstants.CTX_CONNECTOR, "Error calling set" + columnName + ":" + cause.getMessage());
-		 return null;
-	 } catch (Exception e) {
-		 e.printStackTrace();
-		 throw new TranslatorException(e.getMessage());
-	 }
 
+
 }  
   
-
-  private  Object getArg(Method m, int value) {
-	  return Integer.valueOf(value);
-  }
-  private  Object getArg(Method m, double value) {
-	  return Double.valueOf(value);
-  }
-  private  Object getArg(Method m, long value) {
-	  return Long.valueOf(value);
-  }
-  private  Object getArg(Method m, float value) {
-	  return Float.valueOf(value);
-  }
-  private  Object getArg(Method m, short value) {
-	  return Short.valueOf(value);
-  }
-  private  Object getArg(Method m, boolean value) {
-	  return Boolean.valueOf(value);
-  }
   
-  private  Object getArg(Method m, Long value) {
-	  return value.longValue();
-  }
-
-  private  Object getArg(Method m, Object value) throws Exception {
-	  return value;
-  }
-
-	
-  
 //  private static Object retrieveValue(Integer code, Object value) throws Exception {
 //      if(code != null) {
 //          // Calling the specific methods here is more likely to get uniform (and fast) results from different
@@ -463,20 +466,6 @@
 //
 //      return value;
 //  }
-  
-  
-  private  Method findBestMethod(Class objectClass, String methodName, List argumentsClasses) throws SecurityException, NoSuchMethodException {
-      ReflectionHelper rh = new ReflectionHelper(objectClass);
-      
-      if (argumentsClasses == null) {
-          argumentsClasses = Collections.EMPTY_LIST;
-      }
-      Method m = rh.findBestMethodWithSignature(methodName, argumentsClasses);
-      return m;
-     
-  }
-
-
 }
 
 final class ParmHolder {

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/util/ObjectSourceMethodManager.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/util/ObjectSourceMethodManager.java	                        (rev 0)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/util/ObjectSourceMethodManager.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -0,0 +1,224 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.coherence.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.teiid.core.util.ReflectionHelper;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.coherence.CoherencePlugin;
+
+/**
+ * ObjectSourceMethodManager caches the methods for the classes that
+ * are being utilized, and provides utility methods for finding a method
+ * and executing.
+ */
+public class ObjectSourceMethodManager {
+
+	private static ObjectSourceMethodManager osmm = new ObjectSourceMethodManager();
+
+	private Map<Class<?>, Method[]> classToMethodMap = new ConcurrentHashMap<Class<?>, Method[]>();
+
+	public ObjectSourceMethodManager() {
+
+	}
+
+	/**
+	 * Call to execute the method
+	 * 
+	 * @param m
+	 *            is the method to execute
+	 * @param api
+	 *            is the object to execute the method on
+	 * @param parms
+	 *            are the parameters to pass when the method is executed
+	 * @return Object return value
+	 * @throws Exception
+	 */
+	public static Object executeMethod(Method m, Object api, Object[] parms)
+			throws TranslatorException {
+		try {
+			return m.invoke(api, parms);
+		} catch (InvocationTargetException x) {
+			x.printStackTrace();
+			Throwable cause = x.getCause();
+			System.err.format("invocation of %s failed: %s%n",
+					"set" + m.getName(), cause.getMessage());
+			LogManager.logError(LogConstants.CTX_CONNECTOR, "Error calling "
+					+ m.getName() + ":" + cause.getMessage());
+			throw new TranslatorException(x.getMessage());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new TranslatorException(e.getMessage());
+		}
+	}
+
+	/**
+	 * Call to execute the method
+	 * 
+	 * @param m
+	 *            is the method to execute
+	 * @param api
+	 *            is the object to execute the method on
+	 * @param parms
+	 *            are the parameters to pass when the method is executed
+	 * @return Object return value
+	 * @throws Exception
+	 */
+	public static Object executeMethod(Method m, Object api, List parms)
+			throws TranslatorException {
+		try {
+			return m.invoke(api, parms.toArray());
+		} catch (InvocationTargetException x) {
+			x.printStackTrace();
+			Throwable cause = x.getCause();
+			System.err.format("invocation of %s failed: %s%n",
+					"set" + m.getName(), cause.getMessage());
+			LogManager.logError(LogConstants.CTX_CONNECTOR, "Error calling "
+					+ m.getName() + ":" + cause.getMessage());
+			throw new TranslatorException(x.getMessage());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new TranslatorException(e.getMessage());
+		}
+	}
+
+	public static Object createObject(String objectClassName)
+			throws TranslatorException {
+		try {
+
+			return ReflectionHelper.create(objectClassName, null, null);
+		} catch (Exception e1) {
+			throw new TranslatorException(e1);
+		}
+
+	}
+
+	public static Object getValue(String methodName, Object object)
+			throws TranslatorException {
+		try {
+			final Method m = osmm
+					.getMethod(object.getClass(), methodName, null);
+
+			return m.invoke(object, (Object[]) null);
+		} catch (TranslatorException t) {
+			throw t;
+		} catch (InvocationTargetException x) {
+			Throwable cause = x.getCause();
+			System.err.format("invocation of %s failed: %s%n", "get"
+					+ methodName, cause.getMessage());
+			LogManager.logError(LogConstants.CTX_CONNECTOR, "Error calling get"
+					+ methodName + ":" + cause.getMessage());
+			throw new TranslatorException(x.getMessage());
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new TranslatorException(e.getMessage());
+		}
+
+	}
+
+	public static Method getMethod(Class api, String methodName, List argumentsClasses)
+			throws TranslatorException {
+		
+		try {
+			Method[] namedMethods = findMethods(methodName, getMethodsFromAPI(api));
+			if (namedMethods != null && namedMethods.length == 1) {
+				return namedMethods[0];
+			}
+	
+			Method m = findBestMethod(api, methodName, argumentsClasses);
+	
+			if (m == null) {
+				throw new NoSuchMethodException(
+						CoherencePlugin.Util
+								.getString(
+										"ObjectSourceMethodManager.No_method_implemented_for", new Object[] {methodName, api.getName()})); //$NON-NLS-1$           
+			}
+			return m;
+		
+		} catch (NoSuchMethodException nsme) {
+			String msg = CoherencePlugin.Util
+			.getString(
+					"ObjectSourceMethodManager.No_method_implemented_for", new Object[] {methodName, api.getName()});
+			System.out.println(msg);
+			throw new TranslatorException(msg); //$NON-NLS-1$           
+		} catch (Exception e) {
+			e.printStackTrace();
+	        final String msg = CoherencePlugin.Util.getString("ObjectSourceMethodManager.No_method_implemented_for", new Object[] {methodName, api.getName()}); //$NON-NLS-1$
+			throw new TranslatorException(msg);	
+		}		
+	}
+
+	private static Method[] findMethods(String methodName, Method[] methods) {
+		if (methods == null || methods.length == 0) {
+			return null;
+		}
+		final ArrayList result = new ArrayList();
+		for (int i = 0; i < methods.length; i++) {
+			if (methods[i].getName().equals(methodName)) {
+				result.add(methods[i]);
+			}
+		}
+		return (Method[]) result.toArray(new Method[result.size()]);
+	}
+
+	private static synchronized Method[] getMethodsFromAPI(Class api)
+			throws SecurityException {
+		Method[] ms = osmm.classToMethodMap.get(api);
+		if (ms != null) {
+			return ms;
+		}
+		Method[] methods = api.getMethods();
+		osmm.classToMethodMap.put(api, methods);
+		return methods;
+	}
+	/**
+	 * Call to find the best method on a class, by passing the 
+	 * cache
+	 * @param objectClass
+	 * @param methodName
+	 * @param argumentsClasses
+	 * @return
+	 * @throws TranslatorException
+	 */
+	private static Method findBestMethod(Class objectClass, String methodName,
+			List argumentsClasses) throws SecurityException, NoSuchMethodException {
+		
+		ReflectionHelper rh = new ReflectionHelper(objectClass);
+
+		if (argumentsClasses == null) {
+			argumentsClasses = Collections.EMPTY_LIST;
+		}
+		return rh.findBestMethodWithSignature(methodName, argumentsClasses);
+
+	}
+
+}

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/visitor/CoherenceVisitor.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/visitor/CoherenceVisitor.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/java/org/teiid/translator/coherence/visitor/CoherenceVisitor.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -45,6 +45,7 @@
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
 import org.teiid.metadata.Column;
+import org.teiid.metadata.ForeignKey;
 import org.teiid.metadata.RuntimeMetadata;
 import org.teiid.metadata.Table;
 import org.teiid.resource.adapter.coherence.CoherenceFilterUtil;
@@ -110,15 +111,12 @@
 		int i=0;
 		while(selectSymbolItr.hasNext()) {
 			Column e = getElementFromSymbol(selectSymbolItr.next());
-			String attributeName = this.getNameFromElement(e);
-			Class attributeClass = e.getJavaType();
 			
-			attributeNames[i] = attributeName;
-			attributeTypes[i] = attributeClass;
+			attributeNames[i] = this.getNameFromElement(e);
+			attributeTypes[i] = e.getJavaType();
 
 			i++;
 		}
-
 		
 		List<TableReference> tables = query.getFrom();
 		TableReference t = tables.get(0);
@@ -244,7 +242,19 @@
 	// was null wasn't working properly, so replaced with tried and true
 	// code from another custom connector.
 	public String getNameFromElement(Column e) {
-		String attributeName = e.getNameInSource();
+		String attributeName = null;
+		Object p = e.getParent();
+		if (p instanceof Table) {
+			Table t = (Table)p;
+			if (t.getForeignKeys() != null && !t.getForeignKeys().isEmpty()) {
+				ForeignKey fk = (ForeignKey)  t.getForeignKeys().get(0);
+				String fk_nis = fk.getNameInSource();
+				attributeName = fk_nis + "." + e.getNameInSource();
+			}
+		}
+		if (attributeName == null) {
+			attributeName = e.getNameInSource();
+		}
 		if (attributeName == null || attributeName.equals("")) { //$NON-NLS-1$
 			attributeName = e.getName();
 			// If name in source is not set, then fall back to the column name.

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/META-INF/jboss-beans.xml	2012-02-14 19:24:21 UTC (rev 3882)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+    
+   <bean name="translator-coherence-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
+      <property name="info"><inject bean="translator-coherence"/></property>
+      <property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
+   </bean>
+   
+   <bean name="translator-coherence" class="org.teiid.templates.TranslatorTemplateInfo">
+      <constructor factoryMethod="createTemplateInfo">
+         <factory bean="TranslatorDeploymentTemplateInfoFactory"/>
+         <parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
+         <parameter class="java.lang.Class">org.teiid.translator.coherence.CoherenceExecutionFactory</parameter>
+         <parameter class="java.lang.String">translator-coherence</parameter>
+         <parameter class="java.lang.String">coherence</parameter>         
+      </constructor>
+   </bean> 
+   
+</deployment>
\ No newline at end of file

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/org/teiid/translator/coherence/i18n.properties
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/org/teiid/translator/coherence/i18n.properties	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/main/resources/org/teiid/translator/coherence/i18n.properties	2012-02-14 19:24:21 UTC (rev 3882)
@@ -26,4 +26,10 @@
 
 CoherenceUpdateExecution.noobjectfound=No object found in cache for table {0}, column {1} and value {2}
 CoherenceUpdateExecution.noColumnMatchedForeignColumn=No column in the Insert statement matched the foreign key column {1} on table {0}
-CoherenceUpdateExecution.noPrimaryKeyDefinedOnTable=A primary key must be defined on table {0} in order to add to the cache
\ No newline at end of file
+CoherenceUpdateExecution.noPrimaryKeyDefinedOnTable=A primary key must be defined on table {0} in order to add to the cache
+CoherenceUpdateExecution.noNameInSourceForForeingKey=No nameInSource defined for Foreign Key {0}
+
+CoherenceUpdateExecution.objectNotDeleted=No key values passed in to delete object(s) on table {0}
+CoherenceUpdateExecution.noParentContainerObjectFound=The parent object {0} did not return a non-null object when calling method {1}
+
+ObjectSourceMethodManager.No_method_implemented_for=No method implemented for {0} on class {1}
\ No newline at end of file

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/TestCoherenceTranslator.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/TestCoherenceTranslator.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/TestCoherenceTranslator.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -31,6 +31,7 @@
 import org.teiid.cdk.api.ConnectorHost;
 import org.teiid.cdk.api.TranslationUtility;
 import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.util.UnitTestUtil;
 import org.teiid.metadata.Column;
 import org.teiid.metadata.ForeignKey;
 import org.teiid.metadata.KeyRecord;
@@ -67,8 +68,9 @@
 			
 		CoherenceExecutionFactory execFactory = new CoherenceExecutionFactory();
 			
-		host = new ConnectorHost(execFactory, conn, getTradeTranslationUtility());
-				///UnitTestUtil.getTestDataPath() + "/Coherence_Designer_Project/Trade.vdb");
+		host = new ConnectorHost(execFactory, conn,
+				//getTradeTranslationUtility());
+				UnitTestUtil.getTestDataPath() + "/Coherence_Designer_Project/Trade.vdb");
 	}
 	
 	@Override
@@ -83,7 +85,7 @@
 	public void testInsertAndDelete() throws Exception {
 		StringBuilder tradeSQL = new StringBuilder();
 		
-					tradeSQL.append("INSERT INTO Trade_Update.Trade (tradeid, name) VALUES (");
+					tradeSQL.append("INSERT INTO Trade_Object.Trade (tradeid, name) VALUES (");
 					tradeSQL.append(99);
 					tradeSQL.append(",");
 					tradeSQL.append(" 'TradeName ");
@@ -92,7 +94,7 @@
 												
 		host.executeCommand(tradeSQL.toString());
 		
-		List actualResults = host.executeCommand("select * From Trade_Update.Trade where Trade_Update.Trade.TradeID = 99");
+		List actualResults = host.executeCommand("select * From Trade_Object.Trade where Trade_Object.Trade.TradeID = 99");
 		//tradeid, name
         // Compare actual and expected results
 		// should get back the 10 legs for each trade (3) totaling 30
@@ -101,7 +103,7 @@
         
 //		tradeSQL = new StringBuilder();
 //		
-//		tradeSQL.append("INSERT INTO Trade_Update.Leg (tradeid, LegID, name, Notational) VALUES (");
+//		tradeSQL.append("INSERT INTO Trade_Object.Leg (tradeid, LegID, name, Notational) VALUES (");
 //		tradeSQL.append(99);
 //		tradeSQL.append(",");
 //		tradeSQL.append(1);
@@ -117,7 +119,7 @@
 //
 //		tradeSQL = new StringBuilder();
 //		
-//		tradeSQL.append("INSERT INTO Trade_Update.Leg (tradeid, LegID, name, Notational) VALUES (");
+//		tradeSQL.append("INSERT INTO Trade_Object.Leg (tradeid, LegID, name, Notational) VALUES (");
 //		tradeSQL.append(99);
 //		tradeSQL.append(",");
 //		tradeSQL.append(2);
@@ -134,16 +136,16 @@
 		
 		
 //		actualResults = host.executeCommand(
-//	      		"SELECT Trade_Update.Trade.TradeID, Trade_Update.Trade.Name, Trade_Update.Leg.LegID, Trade_Update.Leg.Notational, Trade_Update.Leg.Name AS LegName " +
-//	        	" FROM Trade_Update.Trade, Trade_Update.Leg " +
-//	        	 "WHERE	Trade_Update.Trade.TradeID = Trade_Update.Leg.TradeID and Trade_Update.Trade.TradeID = 99");
+//	      		"SELECT Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName " +
+//	        	" FROM Trade_Object.Trade, Trade_Object.Leg " +
+//	        	 "WHERE	Trade_Object.Trade.TradeID = Trade_Object.Leg.TradeID and Trade_Object.Trade.TradeID = 99");
 //
 //	     assertEquals("Did not get expected number of rows", 2, actualResults.size()); //$NON-NLS-1$
         
  
-		actualResults = host.executeCommand("DELETE FROM Trade_Update.Trade Where Trade_Update.Trade.TradeID = 99");
+		actualResults = host.executeCommand("DELETE FROM Trade_Object.Trade Where Trade_Object.Trade.TradeID = 99");
 		
-		actualResults = host.executeCommand("select * From Trade_Update.Trade where Trade_Update.Trade.TradeID = 99");
+		actualResults = host.executeCommand("select * From Trade_Object.Trade where Trade_Object.Trade.TradeID = 99");
 		//tradeid, name
         // Compare actual and expected results
 		// should get back the 10 legs for each trade (3) totaling 30
@@ -153,6 +155,26 @@
         
              
 	}	
+	
+//	public void testUpdateChildOfExisingParent() throws Exception {
+//		StringBuilder tradeSQL = new StringBuilder();
+//		
+//		
+//		tradeSQL.append("INSERT INTO Trade_Object.Leg (tradeid, LegID, name, Notational) VALUES (");
+//		tradeSQL.append(99);
+//		tradeSQL.append(",");
+//		tradeSQL.append(1);
+//		tradeSQL.append(",");		
+//		tradeSQL.append(" 'Leg ");
+//		tradeSQL.append(1);
+//		tradeSQL.append("',");		
+//		tradeSQL.append(1.24);
+//		tradeSQL.append(")");
+////									
+////		System.out.println(tradeSQL.toString());
+////		host.executeCommand(tradeSQL.toString());												
+//		host.executeCommand(tradeSQL.toString());
+//	}	
 
 	/**
 	 * This will instantiate the {@link CoherenceManagedConnectionFactory} and
@@ -163,9 +185,9 @@
 	public void testGet1TradeWith10Legs() throws Exception {
 			
 		List<List> actualResults = host.executeCommand(
-	      		"SELECT Trade_Update.Trade.TradeID, Trade_Update.Trade.Name, Trade_Update.Leg.LegID, Trade_Update.Leg.Notational, Trade_Update.Leg.Name AS LegName " +
-	        	" FROM Trade_Update.Trade, Trade_Update.Leg " +
-	        	 "WHERE	Trade_Update.Trade.TradeID = Trade_Update.Leg.TradeID ");
+	      		"SELECT Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName " +
+	        	" FROM Trade_Object.Trade, Trade_Object.Leg " +
+	        	 "WHERE	Trade_Object.Trade.TradeID = Trade_Object.Leg.TradeID ");
 		
 	    //    		"SELECT * FROM Trade.Trad " +
 	      //  			" WHERE Trade.Trade.TradeID = Trade.Trade.TradeID");
@@ -191,7 +213,7 @@
 
 	public void testGetAllTrades() throws Exception {
 		
-		List actualResults = host.executeCommand("select * From Trade_Update.Trade");
+		List actualResults = host.executeCommand("select * From Trade_Object.Trade");
 		//tradeid, name
         // Compare actual and expected results
 		// should get back the 10 legs for each trade (3) totaling 30
@@ -201,27 +223,27 @@
 	
 	public void testTradesAndLegsWhereTradeLessThanGreatThan() throws Exception {
 		
-		String prefix = "SELECT Trade_Update.Trade.TradeID, Trade_Update.Trade.Name, Trade_Update.Leg.LegID, Trade_Update.Leg.Notational, Trade_Update.Leg.Name AS LegName " +
-    	" FROM Trade_Update.Trade, Trade_Update.Leg " +
-   	 "WHERE	Trade_Update.Trade.TradeID = Trade_Update.Leg.TradeID and ";
-
-		List actualResults = host.executeCommand(prefix + "Trade_Update.Trade.TradeID > 2");
+		String prefix = "SELECT Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName " +
+    	" FROM Trade_Object.Trade, Trade_Object.Leg " +
+   	 "WHERE	Trade_Object.Trade.TradeID = Trade_Object.Leg.TradeID and ";
 		
+		List actualResults = host.executeCommand(prefix + "Trade_Object.Trade.TradeID > 2");
+		
         assertEquals("Did not get expected number of rows", 10, actualResults.size()); //$NON-NLS-1$
         
-		actualResults = host.executeCommand(prefix + "Trade_Update.Trade.TradeID < 3");
+		actualResults = host.executeCommand(prefix + "Trade_Object.Trade.TradeID < 3");
 		
         assertEquals("Did not get expected number of rows", 20, actualResults.size()); //$NON-NLS-1$
 
-		actualResults = host.executeCommand(prefix + "Trade_Update.Trade.TradeID <= 3");
+		actualResults = host.executeCommand(prefix + "Trade_Object.Trade.TradeID <= 3");
 		
         assertEquals("Did not get expected number of rows", 30, actualResults.size()); //$NON-NLS-1$
         
-        actualResults = host.executeCommand(prefix + "Trade_Update.Trade.TradeID >= 1");
+        actualResults = host.executeCommand(prefix + "Trade_Object.Trade.TradeID >= 1");
 		
         assertEquals("Did not get expected number of rows", 30, actualResults.size()); //$NON-NLS-1$
         
-		actualResults = host.executeCommand(prefix + "Trade_Update.Trade.TradeID < 1");
+		actualResults = host.executeCommand(prefix + "Trade_Object.Trade.TradeID < 1");
 		
         assertEquals("Did not get expected number of rows", 0, actualResults.size()); //$NON-NLS-1$
               
@@ -232,18 +254,18 @@
 
 	public void testLikeTradesWithLegs() throws Exception {
 
-		String prefix = "SELECT Trade_Update.Trade.TradeID, Trade_Update.Trade.Name, Trade_Update.Leg.LegID, Trade_Update.Leg.Notational, Trade_Update.Leg.Name AS LegName " +
-    	" FROM Trade_Update.Trade, Trade_Update.Leg " +
-   	 "WHERE	Trade_Update.Trade.TradeID = Trade_Update.Leg.TradeID and ";
+		String prefix = "SELECT Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName " +
+    	" FROM Trade_Object.Trade, Trade_Object.Leg " +
+   	 "WHERE	Trade_Object.Trade.TradeID = Trade_Object.Leg.TradeID and ";
 
 	
-		List actualResults = host.executeCommand(prefix + " Trade_Update.Trade.Name like 'Trade%' ");
+		List actualResults = host.executeCommand(prefix + " Trade_Object.Trade.Name like 'Trade%' ");
 		
         // Compare actual and expected results
 		// should get back the 10 legs for each trade (3) totaling 30
         assertEquals("Did not get expected number of rows", 30, actualResults.size()); //$NON-NLS-1$
         
-        actualResults = host.executeCommand(prefix + " Trade_Update.Trade.Name like '%2%' ");
+        actualResults = host.executeCommand(prefix + " Trade_Object.Trade.Name like '%2%' ");
 		
         // Compare actual and expected results
 		// should get back the 10 legs for each trade (3) totaling 30
@@ -257,7 +279,7 @@
 	public TranslationUtility getTradeTranslationUtility() {
 		MetadataStore metadataStore = new MetadataStore();
         // Create TRADE
-        Schema trading = RealMetadataFactory.createPhysicalModel("Trade_Update", metadataStore); //$NON-NLS-1$
+        Schema trading = RealMetadataFactory.createPhysicalModel("Trade_Object", metadataStore); //$NON-NLS-1$
         
         // Create physical groups
         Table trade = RealMetadataFactory.createPhysicalGroup("TRADE", trading); //$NON-NLS-1$
@@ -299,25 +321,29 @@
                 DataTypeManager.DefaultDataTypes.LONG,
                 DataTypeManager.DefaultDataTypes.DOUBLE,
         		DataTypeManager.DefaultDataTypes.STRING,
-                DataTypeManager.DefaultDataTypes.LONG
+        		DataTypeManager.DefaultDataTypes.LONG
                        };
         
         List<Column> legcols = RealMetadataFactory.createElements(leg, legNames, legTypes);
         
         // Set name in source on each column
         String[] legnameInSource = new String[] {
-                "Legs.LegId",           
-                "Legs.Notational",
-                "Legs.Name",
-                "TradeID"
+                "LegId",           
+                "Notational",
+                "Name",
+                "TradeId"
         };
         for(int i=0; i<legnameInSource.length; i++) {
             legcols.get(i).setNameInSource(legnameInSource[i]);
         }
+        legcols.get(3).setSelectable(false);
+        legcols.get(3).setUpdatable(false);
         
         List<Column> legkeys = new ArrayList(1);
         keys.add(legcols.get(0));
         
+        
+        
         RealMetadataFactory.createKey(Type.Primary, "Leg_ID_PK", leg, legkeys);
         
         List<Column> foreignkey = new ArrayList(1);
@@ -335,9 +361,9 @@
         Schema tradeview = RealMetadataFactory.createVirtualModel("Trade_View", metadataStore);
         
         QueryNode qn = new QueryNode(
-        		"SELECT Trade_Update.Trade.TradeID, Trade_Update.Trade.Name, Trade_Update.Leg.LegID, Trade_Update.Leg.Notational, Trade_Update.Leg.Name AS LegName " +
-        	" FROM Trade_Update.Trade, Trade_Update.Leg " +
-        	 "WHERE	Trade_Update.Trade.TradeID = Trade_Update.Leg.TradeID " +    		
+        		"SELECT Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName " +
+        	" FROM Trade_Object.Trade, Trade_Object.Leg " +
+        	 "WHERE	Trade_Object.Trade.TradeID = Trade_Object.Leg.TradeID " +    		
         		"SELECT * FROM Trade.Trad " +
         			" WHERE Trade.Trade.TradeID = Trade.Trade.TradeID");
         

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/Trade.java
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/Trade.java	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/test/java/org/teiid/translator/coherence/Trade.java	2012-02-14 19:24:21 UTC (rev 3882)
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 
+import java.util.HashMap;
 import java.util.Map;
 
 
@@ -42,6 +43,9 @@
    }
 
    public Map getLegs() {
+	   if (legs == null) {
+		   legs = new HashMap();
+	   }
        return legs;
    }
    

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/.project
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/.project	                        (rev 0)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/.project	2012-02-14 19:24:21 UTC (rev 3882)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Coherence</name>
+	<comment>No Product Application, version 7.1.0.v20110215-1224-H420-GA</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.teiid.designer.core.modelBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.teiid.designer.core.modelNature</nature>
+	</natures>
+</projectDescription>

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade.vdb
===================================================================
(Binary files differ)


Property changes on: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade.vdb
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_Object.xmi
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_Object.xmi	                        (rev 0)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_Object.xmi	2012-02-14 19:24:21 UTC (rev 3882)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:diagram="http://www.metamatrix.com/metamodels/Diagram" xmlns:mmcore="http://www.metamatrix.com/metamodels/Core" xmlns:relational="http://www.metamatrix.com/metamodels/Relational">
+  <mmcore:ModelAnnotation xmi:uuid="mmuuid:abbd65a2-2896-4819-9428-fa8ba13a1b71" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Relational" modelType="PHYSICAL" ProducerName="Teiid Designer" ProducerVersion="7.4.2.v20111104-1235-H672-Final">
+    <modelImports xmi:uuid="mmuuid:48ca1629-21c3-4df9-b1ac-16b2a1783c7c" name="XMLSchema" modelLocation="http://www.w3.org/2001/XMLSchema" modelType="TYPE" primaryMetamodelUri="http://www.eclipse.org/xsd/2002/XSD"/>
+    <modelImports xmi:uuid="mmuuid:4f6cc788-01c2-4574-923a-a87393ef6838" name="SimpleDatatypes-instance" modelLocation="http://www.metamatrix.com/metamodels/SimpleDatatypes-instance" modelType="TYPE" primaryMetamodelUri="http://www.eclipse.org/xsd/2002/XSD"/>
+  </mmcore:ModelAnnotation>
+  <diagram:DiagramContainer xmi:uuid="mmuuid:060329df-f071-436c-91d8-8de84f4a38b3">
+    <diagram xmi:uuid="mmuuid:0d512295-f6e7-418d-8409-f7e689137c68" type="packageDiagramType" target="mmuuid/abbd65a2-2896-4819-9428-fa8ba13a1b71">
+      <diagramEntity xmi:uuid="mmuuid:0556cf27-0b7f-4670-ba1d-f958c70d1619" name="Trade" modelObject="mmuuid/5b23705c-0091-412a-9e79-c61ed02bd618" xPosition="131" yPosition="57"/>
+      <diagramEntity xmi:uuid="mmuuid:ada12275-d21b-4036-bcc9-c869229899ab" name="Leg" modelObject="mmuuid/3c3beef7-0a75-4bbb-9aaa-7ea240da41f3" xPosition="516" yPosition="235"/>
+    </diagram>
+  </diagram:DiagramContainer>
+  <relational:BaseTable xmi:uuid="mmuuid:5b23705c-0091-412a-9e79-c61ed02bd618" name="Trade" nameInSource="org.teiid.translator.coherence.Trade" cardinality="1">
+    <columns xmi:uuid="mmuuid:9ac8e953-1818-4ce6-a9d8-14d1a8539370" name="TradeID" nameInSource="TradeId" nativeType="Long" uniqueKeys="mmuuid/48e9ee81-01d2-4696-b63f-6a9f6f326aef">
+      <type href="http://www.w3.org/2001/XMLSchema#long"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:139a5ee2-44dc-4b5f-b3d0-68a269ffd7a1" name="Name" nameInSource="Name" nativeType="String" caseSensitive="false">
+      <type href="http://www.w3.org/2001/XMLSchema#string"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:9e0828ec-d634-4211-8e44-6f94f3092a27" name="Legs" nativeType="Collection" selectable="false" updateable="false">
+      <type href="http://www.metamatrix.com/metamodels/SimpleDatatypes-instance#object"/>
+    </columns>
+    <primaryKey xmi:uuid="mmuuid:48e9ee81-01d2-4696-b63f-6a9f6f326aef" name="TradeID_PK" nameInSource="" columns="mmuuid/9ac8e953-1818-4ce6-a9d8-14d1a8539370" foreignKeys="mmuuid/3a3196cd-3e6c-48bf-aa02-e6c99fb1fafe"/>
+  </relational:BaseTable>
+  <relational:BaseTable xmi:uuid="mmuuid:3c3beef7-0a75-4bbb-9aaa-7ea240da41f3" name="Leg" nameInSource="org.teiid.translator.coherence.Leg" cardinality="10">
+    <columns xmi:uuid="mmuuid:3ad9207c-b90f-4aca-bd66-8cd9b3a0e2a3" name="LegID" nameInSource="LegId" nativeType="Long" uniqueKeys="mmuuid/ea715b26-57e0-4245-b3a4-d326dcde47aa">
+      <type href="http://www.w3.org/2001/XMLSchema#long"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:3ef7317b-0b54-4bbe-b634-aee7910cc5ca" name="Notational" nameInSource="Notational" nativeType="Double">
+      <type href="http://www.w3.org/2001/XMLSchema#double"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:19abbb02-6270-4e16-8daa-539e4d024808" name="Name" nameInSource="Name" nativeType="String">
+      <type href="http://www.w3.org/2001/XMLSchema#string"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:937693a2-bd2b-40eb-971d-8eee24fca82a" name="TradeID" nameInSource="TradeId" nativeType="Long" selectable="false" updateable="false" foreignKeys="mmuuid/3a3196cd-3e6c-48bf-aa02-e6c99fb1fafe">
+      <type href="http://www.w3.org/2001/XMLSchema#long"/>
+    </columns>
+    <foreignKeys xmi:uuid="mmuuid:3a3196cd-3e6c-48bf-aa02-e6c99fb1fafe" name="LegToTrade_FK" nameInSource="Legs" columns="mmuuid/937693a2-bd2b-40eb-971d-8eee24fca82a" uniqueKey="mmuuid/48e9ee81-01d2-4696-b63f-6a9f6f326aef"/>
+    <primaryKey xmi:uuid="mmuuid:ea715b26-57e0-4245-b3a4-d326dcde47aa" name="LegID_PK" columns="mmuuid/3ad9207c-b90f-4aca-bd66-8cd9b3a0e2a3"/>
+  </relational:BaseTable>
+  <mmcore:AnnotationContainer xmi:uuid="mmuuid:146acc5c-ec00-4c47-b40f-bcde7a260d72"/>
+</xmi:XMI>

Added: branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_View.xmi
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_View.xmi	                        (rev 0)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/src/test/resources/Coherence_Designer_Project/Trade_View.xmi	2012-02-14 19:24:21 UTC (rev 3882)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:diagram="http://www.metamatrix.com/metamodels/Diagram" xmlns:mmcore="http://www.metamatrix.com/metamodels/Core" xmlns:relational="http://www.metamatrix.com/metamodels/Relational" xmlns:transformation="http://www.metamatrix.com/metamodels/Transformation">
+  <mmcore:ModelAnnotation xmi:uuid="mmuuid:5a3d4831-477f-42b8-bb8e-62a895f62365" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Relational" modelType="VIRTUAL" ProducerName="Teiid Designer" ProducerVersion="7.4.2.v20111104-1235-H672-Final">
+    <modelImports xmi:uuid="mmuuid:d3b3585d-b97d-4f9f-885f-b653f01daddc" name="Trade_Object" modelLocation="Trade_Object.xmi" uuid="mmuuid:abbd65a2-2896-4819-9428-fa8ba13a1b71" modelType="PHYSICAL" primaryMetamodelUri="http://www.metamatrix.com/metamodels/Relational"/>
+    <modelImports xmi:uuid="mmuuid:48862877-960f-45c6-90fe-d97b49508ddd" name="XMLSchema" modelLocation="http://www.w3.org/2001/XMLSchema" modelType="TYPE" primaryMetamodelUri="http://www.eclipse.org/xsd/2002/XSD"/>
+  </mmcore:ModelAnnotation>
+  <mmcore:AnnotationContainer xmi:uuid="mmuuid:376f12cd-a07c-430a-89f6-72c21a43f334"/>
+  <transformation:TransformationContainer xmi:uuid="mmuuid:82fc8a9d-fa7a-4f42-bd2c-435128e99bf2">
+    <transformationMappings xsi:type="transformation:SqlTransformationMappingRoot" xmi:uuid="mmuuid:e1683238-ae62-4ea5-9862-d89aa6a618c1" outputs="mmuuid/d1202de2-c370-42ad-851b-5cfb89fb19de" target="mmuuid/d1202de2-c370-42ad-851b-5cfb89fb19de">
+      <helper xsi:type="transformation:SqlTransformation" xmi:uuid="mmuuid:e347fd3e-3a26-4942-82cc-e219f8f90d5f">
+        <nested xsi:type="transformation:SqlTransformation" xmi:uuid="mmuuid:c1e16e72-4ca7-4c2d-9eea-8554bd7bc304" selectSql="SELECT&#xa;&#x9;&#x9;Trade_Object.Trade.TradeID, Trade_Object.Trade.Name, Trade_Object.Leg.LegID, Trade_Object.Leg.Notational, Trade_Object.Leg.Name AS LegName&#xa;&#x9;FROM&#xa;&#x9;&#x9;Trade_Object.Trade, Trade_Object.Leg"/>
+        <aliases xmi:uuid="mmuuid:4e39271e-ea0b-4419-ab90-75aa072e4475" alias="Trade">
+          <aliasedObject href="Trade_Object.xmi#mmuuid/5b23705c-0091-412a-9e79-c61ed02bd618"/>
+        </aliases>
+        <aliases xmi:uuid="mmuuid:60a538ba-5ecd-4ccc-afd7-0a359d2a8180" alias="Leg">
+          <aliasedObject href="Trade_Object.xmi#mmuuid/3c3beef7-0a75-4bbb-9aaa-7ea240da41f3"/>
+        </aliases>
+      </helper>
+      <nested xsi:type="transformation:TransformationMapping" xmi:uuid="mmuuid:21b5cb8c-f40e-4b98-b6f1-1a53c2dfb568" outputs="mmuuid/6a07d2c3-b0ee-4b29-85ee-bfc9e874cb10">
+        <inputs href="Trade_Object.xmi#mmuuid/9ac8e953-1818-4ce6-a9d8-14d1a8539370"/>
+      </nested>
+      <nested xsi:type="transformation:TransformationMapping" xmi:uuid="mmuuid:01039342-1945-4db0-b0f2-bfbe8488dc71" outputs="mmuuid/7a44decb-8083-4a9c-acfa-8ed71d1cc308">
+        <inputs href="Trade_Object.xmi#mmuuid/139a5ee2-44dc-4b5f-b3d0-68a269ffd7a1"/>
+      </nested>
+      <nested xsi:type="transformation:TransformationMapping" xmi:uuid="mmuuid:245d2337-8396-43f0-a75e-ac6037d22baf" outputs="mmuuid/0fb2cad2-eaee-4b73-8411-994eb7eb3fd0">
+        <inputs href="Trade_Object.xmi#mmuuid/3ad9207c-b90f-4aca-bd66-8cd9b3a0e2a3"/>
+      </nested>
+      <nested xsi:type="transformation:TransformationMapping" xmi:uuid="mmuuid:7101182e-04c9-4d12-8141-ca2fdaa90ad1" outputs="mmuuid/77da2470-3fc1-4fdf-94b4-de43b30b5f25">
+        <inputs href="Trade_Object.xmi#mmuuid/3ef7317b-0b54-4bbe-b634-aee7910cc5ca"/>
+      </nested>
+      <nested xsi:type="transformation:TransformationMapping" xmi:uuid="mmuuid:bd02fb13-86c7-4af7-a439-d76739b85bb9" outputs="mmuuid/e62074a4-0366-4332-b6a4-8fbe855a96ca">
+        <inputs href="Trade_Object.xmi#mmuuid/19abbb02-6270-4e16-8daa-539e4d024808"/>
+      </nested>
+      <inputs href="Trade_Object.xmi#mmuuid/5b23705c-0091-412a-9e79-c61ed02bd618"/>
+      <inputs href="Trade_Object.xmi#mmuuid/3c3beef7-0a75-4bbb-9aaa-7ea240da41f3"/>
+    </transformationMappings>
+  </transformation:TransformationContainer>
+  <diagram:DiagramContainer xmi:uuid="mmuuid:e3ea76b1-8edd-4f68-8fea-346d5ceb2a0c">
+    <diagram xmi:uuid="mmuuid:cd1589b7-71af-4fba-bbac-15c75732b75a" type="packageDiagramType" target="mmuuid/5a3d4831-477f-42b8-bb8e-62a895f62365">
+      <diagramEntity xmi:uuid="mmuuid:3927d9a9-77fd-4662-8029-4127e7b0f87c" modelObject="mmuuid/d1202de2-c370-42ad-851b-5cfb89fb19de"/>
+    </diagram>
+    <diagram xmi:uuid="mmuuid:e009ec34-e8c3-419d-bb0c-c4ab6fc9511a" type="transformationDiagramType" target="mmuuid/d1202de2-c370-42ad-851b-5cfb89fb19de">
+      <diagramEntity xmi:uuid="mmuuid:aaa3adb9-255e-4b77-a560-69eb0d65de26" name="Trades_View" modelObject="mmuuid/d1202de2-c370-42ad-851b-5cfb89fb19de" xPosition="30" yPosition="50"/>
+      <diagramEntity xmi:uuid="mmuuid:a403e12c-a40a-48fc-8677-31f0b0319c60" name="T" modelObject="mmuuid/e1683238-ae62-4ea5-9862-d89aa6a618c1" xPosition="189" yPosition="50"/>
+      <diagramEntity xmi:uuid="mmuuid:8db4da4d-2983-463a-a929-44fd158c1c37" xPosition="239" yPosition="50">
+        <modelObject href="Trade_Object.xmi#mmuuid/5b23705c-0091-412a-9e79-c61ed02bd618"/>
+      </diagramEntity>
+      <diagramEntity xmi:uuid="mmuuid:74af4ac8-e4ae-4853-8d45-638b1b5813bc" xPosition="381" yPosition="50">
+        <modelObject href="Trade_Object.xmi#mmuuid/3c3beef7-0a75-4bbb-9aaa-7ea240da41f3"/>
+      </diagramEntity>
+    </diagram>
+  </diagram:DiagramContainer>
+  <relational:BaseTable xmi:uuid="mmuuid:d1202de2-c370-42ad-851b-5cfb89fb19de" name="Trades_View" supportsUpdate="false">
+    <columns xmi:uuid="mmuuid:6a07d2c3-b0ee-4b29-85ee-bfc9e874cb10" name="TradeID">
+      <type href="http://www.w3.org/2001/XMLSchema#long"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:7a44decb-8083-4a9c-acfa-8ed71d1cc308" name="Name" caseSensitive="false">
+      <type href="http://www.w3.org/2001/XMLSchema#string"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:0fb2cad2-eaee-4b73-8411-994eb7eb3fd0" name="LegID">
+      <type href="http://www.w3.org/2001/XMLSchema#long"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:77da2470-3fc1-4fdf-94b4-de43b30b5f25" name="Notational">
+      <type href="http://www.w3.org/2001/XMLSchema#double"/>
+    </columns>
+    <columns xmi:uuid="mmuuid:e62074a4-0366-4332-b6a4-8fbe855a96ca" name="LegName">
+      <type href="http://www.w3.org/2001/XMLSchema#string"/>
+    </columns>
+  </relational:BaseTable>
+</xmi:XMI>

Modified: branches/7.7.x/connectors/sandbox/translator-coherence/usage-guidelines.txt
===================================================================
--- branches/7.7.x/connectors/sandbox/translator-coherence/usage-guidelines.txt	2012-02-14 17:37:23 UTC (rev 3881)
+++ branches/7.7.x/connectors/sandbox/translator-coherence/usage-guidelines.txt	2012-02-14 19:24:21 UTC (rev 3882)
@@ -9,7 +9,9 @@
 Modeling Guidelines
 -------------
 
-
+*************
+general rules:
+*************
 1.	JavaBean convention is used.  The column name (or nameinsource if used) are used in finding the get/set method on the cached object.  
 	What does that mean?
 
@@ -24,43 +26,63 @@
 	The process of getting the trade id value from the Trade object will take the nameInSource (if not provided, then use column name) and prepend "get".
 	Therefore, the method name:   getTradeId  must exist on the Trade object.
 	
+2.   the nameInSource for a table will contain the full class name of the object to be created
+
+
+*************
+specific rules:
+*************
+
+-	table defined for the root object 
+	a.  the table must have a primary key defined, this is the key the root object by which its found in the Coherence cache
 	
-2.	The Coherence Cache Name will be set on the Coherence Connector, see it for configuration.
+	
+	
+-   model a container object (i.e., Collection, Map, Array) in the root as a separate table
+	a.  a foreign key must be defined to the root table for which its contained, with the nameInSource must be the name of the 
+		method to call on the root object (see JavaBean convention)
+	b.	the foreign key column on the root must be added to the child table so that the key value can be included in the sql statements (INSERT/UPDATE/DELETE) in order
+		for the root object can be found.  Change the column NOT to updateable or selectable.
+	c.	a primary key must be defined
 
--	Top level object must have a primary key defined for the attribute that's the key to finding the object in the cache
+	
 
-3.  Model a container object (collection, array, map) as another table.
-	-   on the child table, add the primary key column on the parent table to the child table (column must not be updatable)
-	-	a foreign key must be defined, using the primary key on parent and the parent column added to the child (in above step),
-		the nameInSource for the foreign key is the name of the method (excluding get/set prefix)
+
+*****************
+Setup
+*****************
 	
 	
+1.	The Coherence Cache Name will be set on the Coherence Connector, see it for configuration.
+
+	
+	
 ------------
 Limitations
 ------------
 
-	-	A Designer modeled table can only be referencing 1 collection in the root object. 
-		If the root object contains multiple collection type objects, then a table will need to be modeled for each collection.    This will allow the 
-		the Teiid engine to perform the join across collections.
-	-	Cannot put criteria on a column that comes from an object that is in a Collection.  This is a coherence limitation out-of-the-box.  This can
-		be implemented to enable this capability.
+	-	There is NO JOIN criteria to specify when querying the root and child object, only conditional criteria.  This is because 	
+	    it a  coherence limitation out-of-the-box.  This can be implemented to enable this capability.	
+	-	See TBD below
 		
 		
 ---------------------
 TBD:  The following are things to be added:
 ---------------------
 
-	a.  Enable the mapping of a column to a property.  Using this syntax structure: property.<propertyName>
+	-	Enable UPDATE query
+	-   Enable the mapping of a column to a property.  Using this syntax structure: property.<propertyName>
 		set the nameInSource to this value.
-			
-	b.	Enable the support for Boolean.   This would use the "is" prefix to the getter method. (note, this has been coded for, but not tested)
-	
-	c.	enable the abiltiy to a criteria for a column from an object in the collection
-	
-	d.	Because all sql criteria has to mapped to Coherence filters, only some have been mapped so far.  There are others that need to be added so that 
+		
+	-	Transaction support is not fully implemented.   Example, object locking during the duration of the processing in the translator.
+					
+	-	Because all sql criteria has to mapped to Coherence filters, only some have been mapped so far.  There are others that need to be added so that 
 		the following features will be enabled:
 		-	Limit
 		-	Between
 		-	and others 
 		
-		see http://www.exforsys.com/reviews/oracle-coherence.html for information  and examples
\ No newline at end of file
+		see http://www.exforsys.com/reviews/oracle-coherence.html for information  and examples
+		
+		
+



More information about the teiid-commits mailing list