You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Ksenia Khailenko (JIRA)" <ji...@apache.org> on 2010/11/19 09:11:13 UTC

[jira] Commented: (CAY-1510) #result directive does not work.

    [ https://issues.apache.org/jira/browse/CAY-1510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933717#action_12933717 ] 

Ksenia Khailenko commented on CAY-1510:
---------------------------------------

Hi, kazu!

At first, I think there is a misprint in your sql statement: there's no closing brace for "#result". I've fixed the statement and got the error on attempt of getting the element from the result list:

Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.0 Apr 30 2010 11:29:33] Can't find id for org.apache.cayenne.DataRow@43582a7c[values={id=1, col1=1, col2=2}, version=-9223372036854775805, replaces=-9223372036854775808]
	at org.apache.cayenne.access.IncrementalFaultList$IncrementalListHelper.updateWithResolvedObjectInRange(IncrementalFaultList.java:701)
	at org.apache.cayenne.access.IncrementalFaultList.resolveInterval(IncrementalFaultList.java:306)
	at org.apache.cayenne.access.IncrementalFaultList.get(IncrementalFaultList.java:550)
	at test.Main.main(Main.java:33)

If the setPageSize method invocation is commented, this error doesn't fall.
Is this the same error that you got?


> #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.