{
if (updateFkStmt == null)
{
JavaTypeMapping ownerMapping = ecs.getOwnerMapping();
JavaTypeMapping orderMapping = ecs.getOrderMapping();
DatastoreContainerObject containerTable = ecs.getContainerTable();
JavaTypeMapping elementMapping = ecs.getElementMapping();
ElementContainerStore.ElementInfo[] elementInfo = ecs.getElementInfo();
JavaTypeMapping relationDiscriminatorMapping = ecs.getRelationDiscriminatorMapping();
StringBuffer stmt = new StringBuffer();
stmt.append("UPDATE ");
if (elementInfo.length > 1)
{
stmt.append("?");
}
else
{
// Could use elementInfo[0].getDatastoreClass but need to allow for relation in superclass table
stmt.append(containerTable.toString());
}
stmt.append(" SET ");
for (int i = 0; i < ownerMapping.getNumberOfDatastoreMappings(); i++)
{
if (i > 0)