[ https://issues.apache.org/jira/browse/OPENJPA-1158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12755165#action_12755165 ] Donald Woods commented on OPENJPA-1158: --------------------------------------- Applied to trunk in r808701 by Pinaki. > 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: Donald Woods > Priority: Minor > Attachments: OPENJPA-1158.patch > > > 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.