[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-4778) Need better handling of criteria expression casting

Steve Ebersole (JIRA) noreply at atlassian.com
Tue Jan 12 12:32:29 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-4778.
-------------------------------

    Resolution: Fixed

Initially I thought the issue was with the builder.toBigInteger(...) expression. But on further reflection, then issue is actually with the BigInteger literal. We currently do not provide a means to indicate a particular literal expression is a BignInteger (or BigDecimal for that matter) to the query parser. So the query parser sees the literal as an integer and the result of a prod(int, int) is an int which leads to the overflow.

Made a change to the query parser to accept defining literals as BigInteger or BigDecimal via suffixes ("bi"/"bd") just as with Long("l"), Float("f") and Double("d")

> Need better handling of criteria expression casting
> ---------------------------------------------------
>
>                 Key: HHH-4778
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4778
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager, query-criteria
>    Affects Versions: 3.5.0-Beta-2
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>             Fix For: 3.5.0-Beta-3
>
>
> CriteriaBuilder#toInteger, #toLong, et al.  Currently we handle this as a simple in-memory conversion, which can, however, lead to overflows when the cast'ed expression is used in the select clause.  The issue is the type Hibernate chooses to actually extract the values from the result set are not effected by the cast.

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