Community
Participate
Working Groups
Eclipselink 2.6.3 is used in a production environment. It was found that java.lang.ClassCastException was reported while calling stored procedure to get list of numbers. Diagnostic Analysis =================== EL 2.6.3 + JDK 1.8 + JDBC 12.1.0.2.0 + Oracle DB 11g Provide Error Details ===================== java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.Number
Created attachment 275478 [details] A Simple Test Case
I am able to run the test success with the following change. git diff diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/ ResultSetMappingQuery.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/ ResultSetMappingQuery.java index 324b86a..6454117 100644 --- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/ ResultSetMappingQuery.java +++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/ ResultSetMappingQuery.java @@ -254,7 +254,7 @@ protected List buildObjectsFromRecords(List databaseRecords, SQLResultSetMapping } for (Iterator iterator = databaseRecords.iterator(); iterator.hasNext();) { DatabaseRecord record = (DatabaseRecord)iterator.next(); - results.add(record.values().toArray()); + results.add(record.getValues().get(0)); } } else { for (Iterator iterator = databaseRecords.iterator(); iterator.hasNext();) {
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink