[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3081) SQL queries do not currently support iteration

Raphael Flores (JIRA) noreply at atlassian.com
Thu Nov 18 12:41:13 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39153#action_39153 ] 

Raphael Flores commented on HHH-3081:
-------------------------------------

Hi, does such feature would be complex to add?

I don't know what it implies, but it would be great if we could get an Iterator on SQL queries when an entity is supplied.

Sometimes SQL seems to be the only/best way to get data when queries are complex (ie. when haing to use date/timestamp operations).

> SQL queries do not currently support iteration
> ----------------------------------------------
>
>                 Key: HHH-3081
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3081
>             Project: Hibernate Core
>          Issue Type: Bug
>            Reporter: MG
>
> 				Query sqlQuery = session.createSQLQuery("select * from TRADE").addEntity(Trade.class);
> 				sqlQuery.setReadOnly(true);
> 				sqlQuery.setCacheMode(CacheMode.IGNORE);
> 				sqlQuery.setCacheable(false);
> 				sqlQuery.setFetchSize(1000);
> 				Iterator<Trade> trades = sqlQuery.iterate();
> Causes
> Exception in thread "main" java.lang.UnsupportedOperationException: SQL queries do not currently support iteration
> 	at org.hibernate.impl.SQLQueryImpl.iterate(SQLQueryImpl.java:190)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list