[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3497) Criteria row count return value in the type of Integer, not Long

Shawn Clowater (JIRA) noreply at atlassian.com
Fri Sep 26 11:10:04 EDT 2008


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

Shawn Clowater commented on HHH-3497:
-------------------------------------

Are you really expecting to have more than 9,223,372,036,854,775,807 rows in any given table?

With that said I'm a big fan of consistency and if HQL is returning a different type than Criteria then I could see the case for that.

> Criteria row count return value in the type of Integer, not Long
> ----------------------------------------------------------------
>
>                 Key: HHH-3497
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3497
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.1
>         Environment: MySQL and Postgres
>            Reporter: Yang Lifan
>
> I know the type of the return value of row count with HQL query is Long, to be compatible with JPA. But the Criteria is still return in the type of Integer, not in Long. So if there are a huge amount of data in the database, how can we get the right row count value with Criteria.
> =================================================
> criteria.setProjection(Projections.rowCount());
> Long result = Long.valueOf(criteria.uniqueResult().toString());
> =================================================
> I have to write like that to return the type of Long. But I know it is not real.

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