[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2900) Autodiscovery results ignored by scroll()
Gail Badner (JIRA)
noreply at atlassian.com
Mon Oct 22 16:46:39 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28509 ]
Gail Badner commented on HHH-2900:
----------------------------------
Please attach a runnable test case (Java + mapping that reproduces this issue.
Also, please add a comment containing the full stacktrace.
> Autodiscovery results ignored by scroll()
> -----------------------------------------
>
> Key: HHH-2900
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2900
> Project: Hibernate3
> Issue Type: Bug
> Components: query-hql, query-sql
> Affects Versions: 3.2.4.sp1
> Reporter: Sergey Koshcheyev
> Priority: Minor
>
> Running this piece of code:
> session.createSQLQuery("create table tab(col integer)").executeUpdate();
> session.createSQLQuery("insert into tab values (1)").executeUpdate();
> ScrollableResults sr = session
> .createSQLQuery("select col from tab")
> .addScalar("col")
> .scroll(ScrollMode.FORWARD_ONLY);
> sr.next();
> sr.getInteger(0);
> produces java.lang.NullPointerException
> at org.hibernate.impl.AbstractScrollableResults.getFinal(AbstractScrollableResults.java:126)
> at org.hibernate.impl.AbstractScrollableResults.getInteger(AbstractScrollableResults.java:208)
> The problem seems to be Loader.scroll() is using its returnTypes parameter when instantiating ScrollableResultsImpl instead of letting CustomLoader use its autodiscovered resultTypes array.
> A workaround seems to be to use ScrollableResults.get(int) since it doesn't rely on type information.
--
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