Calling the following oracle function with Hibernate 6.1.7 returns an BigInteger of value 1.23:
{code:java} create or replace Function "HIBERNATE_TEST" RETURN NUMBER is d_RET DECIMAL(5,2);
BEGIN d_RET := 1.23; return d_RET; END; {code}
The function is called as follows:
{code:java}
public BigDecimal hibernateTest() { Object result = entityManager .createNativeQuery( "SELECT HIBERNATE_TEST() FROM DUAL") .getSingleResult();
return (BigDecimal) result; // 1.23 } {code}
Calling the same function with the same code as above with Hibernate 6.2.0 returns an Integer of value 1 which causes an ClassCastException. |
|