xgl1991714 created METAMODEL-94:
-----------------------------------
Summary: [MongoDbDataContext] The alias will be lost,unless we use
FunctionType
Key: METAMODEL-94
URL: https://issues.apache.org/jira/browse/METAMODEL-94
Project: Metamodel
Issue Type: Bug
Affects Versions: 4.1.0-incubating, 4.2.0-incubating
Reporter: xgl1991714
here is the method 'executeQuery()' of MongoDbDataContext:
{quote}
*public* DataSet executeQuery(Query query) {
...
*boolean* allSelectItemsAreColumns = *true*;
List<SelectItem> selectItems =
query.getSelectClause().getItems();
*for* (SelectItem selectItem : selectItems) {
*if* ({color:red}selectItem.getFunction() != *null* ||
selectItem.getColumn() == *null*{color}){
allSelectItemsAreColumns = *false*;
*break*;
}
}
*if* (allSelectItemsAreColumns) {
...
*final* DataSet dataSet = materializeMainSchemaTableInternal(table,
columns, whereItems, firstRow, maxRows, *false*);
*return* {color:red}dataSet{color};
}
*return* {color:red}super.executeQuery(query){color};
}
{quote}
when I run:
{quote}
mongoDbDataContext.query().from({color:blue}"dept"{color}).select({color:blue}"dname"{color}).as({color:blue}"xxx"{color})
{quote}
the +allSelectItemsAreColumns+ is *true* and the alias is lost
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)