This commit is contained in:
Par Winzell
2007-08-16 20:26:12 +00:00
parent a794805a86
commit fb259504c9
@@ -90,15 +90,16 @@ public abstract class BuildVisitor implements ExpressionVisitor
public void visit (WhereCondition<? extends PersistentRecord> whereCondition) public void visit (WhereCondition<? extends PersistentRecord> whereCondition)
throws Exception throws Exception
{ {
String[] keyFields = Key.getKeyFields(whereCondition.getPersistentClass()); Class<? extends PersistentRecord> pClass = whereCondition.getPersistentClass();
String[] keyFields = Key.getKeyFields(pClass);
Comparable[] values = whereCondition.getValues(); Comparable[] values = whereCondition.getValues();
for (int ii = 0; ii < keyFields.length; ii ++) { for (int ii = 0; ii < keyFields.length; ii ++) {
if (ii > 0) { if (ii > 0) {
_builder.append(" and "); _builder.append(" and ");
} }
appendTableAbbreviation(whereCondition.getPersistentClass()); appendTableAbbreviation(pClass);
_builder.append("."); _builder.append(".");
appendColumn(whereCondition.getPersistentClass(), keyFields[ii]); appendColumn(pClass, keyFields[ii]);
_builder.append(values[ii] == null ? " is null " : " = ? "); _builder.append(values[ii] == null ? " is null " : " = ? ");
} }
} }