.append(" joins.");
throw new CayenneRuntimeException(msg.toString());
}
DbJoin join = joins.get(0);
DbAttribute attribute = null;
if (rel.isToMany()) {
DbEntity ent = (DbEntity) join.getRelationship().getTargetEntity();
Collection<DbAttribute> pk = ent.getPrimaryKeys();
if (pk.size() != 1) {
StringBuilder msg = new StringBuilder();
msg
.append("DB_NAME expressions can only support ")
.append("targets with a single column PK. ")
.append("This entity has ")
.append(pk.size())
.append(" columns in primary key.");
throw new CayenneRuntimeException(msg.toString());
}
attribute = pk.iterator().next();
}
else {
attribute = join.getSource();
}
processColumn(attribute);
}