Stefan Mitzkus (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a27b49...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNmI1ZGU5ZWZh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16455?atlOrigin=eyJpIjoiNmI1ZG...
) HHH-16455 (
https://hibernate.atlassian.net/browse/HHH-16455?atlOrigin=eyJpIjoiNmI1ZG...
) calling oracle function returns Integer instead of BigDecimal (
https://hibernate.atlassian.net/browse/HHH-16455?atlOrigin=eyJpIjoiNmI1ZG...
)
Issue Type: Bug Affects Versions: 6.2.0 Assignee: Unassigned Components: hibernate-core
Created: 11/Apr/2023 08:22 AM Labels: native Priority: Critical Reporter: Stefan Mitzkus (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a27b49...
)
Calling the following oracle function with Hibernate 6.1.7 returns an BigInteger of value
1.23:
create or replace Function "HIBERNATE_TEST"
RETURN NUMBER is
d_RET DECIMAL(5,2);
BEGIN
d_RET := 1.23;
return d_RET;
END;
The function is called as follows:
public BigDecimal hibernateTest() {
Object result = entityManager
.createNativeQuery(
"SELECT HIBERNATE_TEST() FROM DUAL" )
.getSingleResult();
return (BigDecimal) result; // 1.23
}
Calling the same function with the same code as above returns an Integer of value 1 which
causes an ClassCastException.
(
https://hibernate.atlassian.net/browse/HHH-16455#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16455#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100221- sha1:9ff53d8 )