[
https://issues.apache.org/jira/browse/METAMODEL-251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296723#comment-15296723
]
Kasper Sørensen commented on METAMODEL-251:
-------------------------------------------
Or maybe the change is to be done in the getSelection(...) method then? It
would be unfortunate to do eager loading of the DataSet (which I think your
removal of the optimization is going to do) instead.
> MetaModel should fail when accessing a column that is not a select item
> -----------------------------------------------------------------------
>
> Key: METAMODEL-251
> URL: https://issues.apache.org/jira/browse/METAMODEL-251
> Project: Apache MetaModel
> Issue Type: Bug
> Affects Versions: 4.5.2
> Environment: Postgres
> Reporter: Hans Drexler
> Attachments: MetaModel251Sample.java
>
>
> In our software, we create a query with SelectItems for 6 out of the 7
> columns of a postgres data base table. We actually forgot to add the seventh
> column as a SelectItem.
> {code}
> query.select(selectItems)
> .from(someTable)
> {code}
> When consuming the rows returned by this query, the code actually fetches the
> column that was not a select item, using a construct like:
> {code}
> row.getValue(table.getColumnByName('foo'));
> {code}
> This returns null values most of the time. But under stress, the code starts
> to throw exceptions.
> It would be much better if MetaModel throws an exception when the code
> attempts to access a column that is not part of the query (fail fast).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)