solomax commented on code in PR #144:
URL: https://github.com/apache/openjpa/pull/144#discussion_r3563129084


##########
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jpql/functions/TestEJBQLFunction.java:
##########


Review Comment:
   I need help on this one as well :( (I'm totally lost in the code :(( )
   
   this simple JPQL is transformed to following SQL: `SELECT 
ROUND(CAST((CAST(SUM(t0.age) AS NUMERIC) / ?) AS DOUBLE), CAST(? AS DOUBLE)) 
FROM CompUser t0`
   
   at `hsqldb`
   
   Which leads to
   ```
    Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: incompatible 
data type in operation in statement [SELECT ROUND(CAST((CAST(SUM(t0.age) AS 
NUMERIC) / ?) AS DOUBLE), CAST(? AS DOUBLE)) FROM CompUser t0] {SELECT 
ROUND(CAST((CAST(SUM(t0.age) AS NUMERIC) / ?) AS DOUBLE), CAST(? AS DOUBLE)) 
FROM CompUser t0} [code=-5563, state=42563]
   ```
   
   I believe this is because second argument of ROUND should be `INT` (not 
`DOUBLE`)
   
   how it can be fixed? :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to