statement.append(t.getCollisionColumn().getColumnName());
statement.append(" = ?");
whereClauseProperties.add(type.getProperty(t.getCollisionColumnPropertyName()));
}
UpdateCommandImpl updateCommand;
if (t.getCollisionColumn() != null) {
updateCommand = new OptimisticWriteCommandImpl(statement.toString());
} else {
updateCommand = new UpdateCommandImpl(statement.toString());
}
int idx = 1;
Iterator params = updatedProperties.iterator();
while (params.hasNext()) {
Property p = (Property) params.next();
updateCommand.addParameter(createParameter(t, p, idx++));
}
params = managedProperties.iterator();
while (params.hasNext()) {
Property p = (Property) params.next();
updateCommand.addParameter(createManagedParameter(t, p, idx++));
}
params = whereClauseProperties.iterator();
while (params.hasNext()) {
Property p = (Property) params.next();
updateCommand.addParameter(createParameter(t, p, idx++));
}
if (this.logger.isDebugEnabled()) {
this.logger.debug(statement.toString());
}