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

bugmenot (JIRA) noreply at atlassian.com
Wed Jun 3 17:19:13 EDT 2009


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

bugmenot commented on HHH-3497:
-------------------------------

An Integer is 2,147,483,647 which is certainly a reasonable number of rows to have.

> 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