out.append(columnRef);
return;
}
boolean useTableReference = true;
DbEntityDescriptor ded = lookupTableRef(tableRef, false);
if (ded == null) {
useTableReference = false;
ded = lookupName(tableRef);
}
if (columnRef == null) {
DbEntityColumnDescriptor[] decList = ded.getColumnDescriptors();
int count = 0;
boolean withIds = (columnRefArr != null) && ArraysUtil.contains(columnRefArr, StringPool.PLUS);
for (DbEntityColumnDescriptor dec : decList) {
if ((includeColumns == COLS_ONLY_IDS) && (dec.isId() == false)) {
continue;
}
if ((includeColumns == COLS_ALL_BUT_ID) && (dec.isId() == true)) {
continue;
}
if ((includeColumns == COLS_NA_MULTI)
&& (!withIds || (dec.isId() == false))
&& (!ArraysUtil.contains(columnRefArr, dec.getPropertyName()))) {
continue;
}
if (count > 0) {
out.append(',').append(' ');
}
templateData.lastColumnDec = dec;
if (useTableReference) {
appendColumnName(out, ded, dec.getColumnName());
} else {
appendAlias(out, ded, dec.getColumnName());
}
count++;
}
} else {
DbEntityColumnDescriptor dec = ded.findByPropertyName(columnRef);
templateData.lastColumnDec = dec;
String columnName = dec == null ? null : dec.getColumnName();
//String columnName = ded.getColumnName(columnRef);
if (columnName == null) {
throw new DbSqlBuilderException("Invalid column reference: " + tableRef + '.' + columnRef);