Issue Details (XML | Word | Printable)

Key: NUCCORE-905
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Renato Garcia
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

ClassUtils.getConstructorWithArguments only recognize constructors with exact type

Created: 25/Aug/12 04:56 AM   Updated: 28/Aug/12 09:56 AM   Resolved: 25/Aug/12 09:55 AM
Component/s: Queries
Affects Version/s: 2.2.4, 3.0.11, 3.1.0.release
Fix Version/s: 3.1.1

File Attachments: 1. Text File NUCCORE-905-test.patch (2 kB)
2. Text File NUCCORE-905.patch (0.8 kB)


Severity: Development


 Description  « Hide
I'm getting the following exception:

org.datanucleus.exceptions.NucleusUserException: Query needs to return objects of type "..." but it was impossible to create a new instance of this type. The result class needs a no-args constructor.
at org.datanucleus.store.rdbms.query.JDOQLQuery$1.run(JDOQLQuery.java:435)
at java.security.AccessController.doPrivileged(Native Method)
at org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal(JDOQLQuery.java:369)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1747)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:1666)
at org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:312)

ClassUtils.getConstructorWithArguments is only considering constructors with exact same type but it should consider supertypes and interfaces as well.

Renato Garcia made changes - 25/Aug/12 04:57 AM
Field Original Value New Value
Attachment NUCCORE-905.patch [ 11750 ]
Renato Garcia added a comment - 25/Aug/12 05:33 AM
Tests for the patch

Renato Garcia made changes - 25/Aug/12 05:33 AM
Attachment NUCCORE-905-test.patch [ 11751 ]
Andy Jefferson made changes - 25/Aug/12 09:54 AM
Fix Version/s 3.1.1 [ 11630 ]
Affects Version/s 3.1.0.release [ 11261 ]
Affects Version/s 3.0.11 [ 11534 ]
Affects Version/s 2.2.4 [ 11182 ]
Affects Version/s 3.1.1 [ 11630 ]
Component/s Queries [ 10154 ]
Andy Jefferson added a comment - 25/Aug/12 09:55 AM
Now in SVN trunk.

Andy Jefferson made changes - 25/Aug/12 09:55 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 28/Aug/12 09:56 AM
Status Resolved [ 5 ] Closed [ 6 ]