Hans Drexler created METAMODEL-251:
--------------------------------------

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


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)

Reply via email to