cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kazu (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAY-1510) #result directive does not work.
Date Wed, 17 Nov 2010 08:33:16 GMT
#result directive does not work.
--------------------------------

                 Key: CAY-1510
                 URL: https://issues.apache.org/jira/browse/CAY-1510
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 3.0.1
         Environment: jdk:java 6/os:windows xp
            Reporter: kazu
            Priority: Critical


#result directive didn't work when i used SQLTemplate with setPageSize().

ex)-----------------------------------------------------------------------------------
    String sql = "select  col1, col2, #result('0' 'java.lang.Integer' 'custom_col' from test_table
";
    SQLTemplate query = new SQLTemplate(TestTable.class, sql);
    query.setCacheStrategy(QueryCacheStrategy.NO_CACHE);
    query.setFetchingDataRows(true);
    query.setPageSize(100);// when this phrase used, custom_col doesn't  work.
    query.setStatementFetchSize(100);
    List<DataRow> l = getObjectContext().performQuery(query);

    // data exists
    DataRow dr = l.get(0);

    
    System.out.println(dr.get('col1')); // this phrase output col1's value.
    System.out.println(dr.get('col2')); // this phrase output col2's value.
    System.out.println(dr.get('custom_col')); // this phrase could not output custom_col's
value.

----------------------------------------------------------------------------------------

col1 and col2  are test_table's attributes.
and custom_col is not one. 

only if  i doesn't use setPageSize.  dr.get('custom_col') could output custom_col's value.

Is  this bug ? or  specification?
if someone know. please tell me how to avoid this case.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message