Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-3371

HHH-4769 on MySQL, HQL function ROUND always returns an Integer, it truncate the decimal part of Double number.

    XMLWordPrintable

    Details

    • Affects:
      Release Notes

      Description

      Running the query "select round(stTmpRiepCap.imponibile,1), round(stTmpRiepCap.ritImponibile,1) from StTmpRiepCap stTmpRiepCap", it always returns an Integer and it always truncate the decimal part of Double number ("stTmpRiepCap.imponibile" and "stTmpRiepCap.ritImponibile" are "java.lang.Double").

      Example

      REAL VALUE - Imponibile: 1528.57 - Ritenuta imponibile 266.13

      VALUE RETURNED USING ROUND - Imponibile: 1528 - Ritenuta imponibile 266

      mysql document said :
      http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_round

      "The return type is the same type as that of the first argument (assuming that it is integer, double, or decimal). This means that for an integer argument, the result is an integer (no decimal places): "

      http://opensource.atlassian.com/projects/hibernate/browse/HHH-4769

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                stliu Strong Liu
                Reporter:
                stliu Strong Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: