use of org.jooq.impl.DSL.asterisk in project jOOQ by jOOQ.
the class DefaultParseContext method parseSelectList.
private final List<SelectFieldOrAsterisk> parseSelectList() {
List<SelectFieldOrAsterisk> result = new ArrayList<>();
do {
QualifiedAsterisk qa;
if (parseIf('*')) {
if (parseKeywordIf("EXCEPT")) {
parse('(');
result.add(DSL.asterisk().except(parseList(',', c -> parseFieldName()).toArray(EMPTY_FIELD)));
parse(')');
} else
result.add(DSL.asterisk());
} else if ((qa = parseQualifiedAsteriskIf()) != null) {
if (parseKeywordIf("EXCEPT")) {
parse('(');
result.add(qa.except(parseList(',', c -> parseFieldName()).toArray(EMPTY_FIELD)));
parse(')');
} else
result.add(qa);
} else {
Name alias = null;
SelectField<?> field = null;
if (field == null) {
field = parseSelectField();
if (parseKeywordIf("AS"))
alias = parseIdentifier(true, false);
else if (!peekKeyword(KEYWORDS_IN_SELECT) && !peekKeyword(KEYWORDS_IN_STATEMENTS))
alias = parseIdentifierIf(true, false);
}
result.add(alias == null ? field : field.as(alias));
}
} while (parseIf(','));
return result;
}
Aggregations