Incorrect handling of long values in AbstractResult
---------------------------------------------------
Key: OPENJPA-1158
URL: https://issues.apache.org/jira/browse/OPENJPA-1158
Project: OpenJPA
Issue Type: Bug
Components: jdbc
Affects Versions: 2.0.0
Reporter: Craig Russell
Assignee: Craig Russell
Priority: Minor
This code is in org.apache.openjpa.jdbc.sql.AbstractResult.
public long getLong(Object obj)
throws SQLException {
return getLongInternal(translate(obj, null), null);
}
public long getLong(Column col, Joins joins)
throws SQLException {
return getLongInternal(translate(col, joins), joins);
}
protected long getLongInternal(Object obj, Joins joins)
throws SQLException {
Number val = (Number) checkNull(getObjectInternal(obj,
JavaTypes.INT, null, joins));
return (val == null) ? 0 : val.intValue();
}
It seems like it's an obvious bug; using intValue and JavaTypes.INT in
getLongInternal should use longValue and JavaTypes.LONG.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.