You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "xgl1991714 (JIRA)" <ji...@apache.org> on 2014/11/10 09:50:33 UTC

[jira] [Created] (METAMODEL-94) [MongoDbDataContext] The alias will be lost,unless we use FunctionType

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) {
&nbsp;&nbsp;*if* ({color:red}selectItem.getFunction() != *null* || selectItem.getColumn() == *null*{color}){
&nbsp;&nbsp;&nbsp;&nbsp;allSelectItemsAreColumns = *false*;
&nbsp;&nbsp;&nbsp;&nbsp;*break*; 
}
}
*if* (allSelectItemsAreColumns) {
...
&nbsp;&nbsp;*final* DataSet dataSet = materializeMainSchemaTableInternal(table, columns, whereItems, firstRow, maxRows, *false*);
&nbsp;&nbsp;*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)