metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xgl1991714 (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (METAMODEL-94) [MongoDbDataContext] The alias will be lost,unless we use FunctionType
Date Mon, 10 Nov 2014 09:16:33 GMT

     [ https://issues.apache.org/jira/browse/METAMODEL-94?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

xgl1991714 updated METAMODEL-94:
--------------------------------
    Description: 
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}){
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

  was:
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


> [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}){
> 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)

Mime
View raw message