Search in sources :

Example 1 with CommonSelectItem

use of io.shardingjdbc.core.parsing.parser.context.selectitem.CommonSelectItem in project sharding-jdbc by shardingjdbc.

the class SelectListClauseParser method parseSelectItem.

private SelectItem parseSelectItem(final SelectStatement selectStatement) {
    lexerEngine.skipIfEqual(getSkippedKeywordsBeforeSelectItem());
    SelectItem result;
    if (isRowNumberSelectItem()) {
        result = parseRowNumberSelectItem(selectStatement);
    } else if (isStarSelectItem()) {
        selectStatement.setContainStar(true);
        result = parseStarSelectItem();
    } else if (isAggregationSelectItem()) {
        result = parseAggregationSelectItem(selectStatement);
        parseRestSelectItem(selectStatement);
    } else {
        result = new CommonSelectItem(SQLUtil.getExactlyValue(parseCommonSelectItem(selectStatement) + parseRestSelectItem(selectStatement)), aliasExpressionParser.parseSelectItemAlias());
    }
    return result;
}
Also used : SelectItem(io.shardingjdbc.core.parsing.parser.context.selectitem.SelectItem) StarSelectItem(io.shardingjdbc.core.parsing.parser.context.selectitem.StarSelectItem) CommonSelectItem(io.shardingjdbc.core.parsing.parser.context.selectitem.CommonSelectItem) AggregationSelectItem(io.shardingjdbc.core.parsing.parser.context.selectitem.AggregationSelectItem) CommonSelectItem(io.shardingjdbc.core.parsing.parser.context.selectitem.CommonSelectItem)

Aggregations

AggregationSelectItem (io.shardingjdbc.core.parsing.parser.context.selectitem.AggregationSelectItem)1 CommonSelectItem (io.shardingjdbc.core.parsing.parser.context.selectitem.CommonSelectItem)1 SelectItem (io.shardingjdbc.core.parsing.parser.context.selectitem.SelectItem)1 StarSelectItem (io.shardingjdbc.core.parsing.parser.context.selectitem.StarSelectItem)1