Issue Details (XML | Word | Printable)

Key: NUCJPA-251
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Adrian Ber
Votes: 0
Watchers: 0
Operations

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

Inherited AttributeConverter does not work

Created: 14/Sep/13 10:04 AM   Updated: 23/Oct/13 11:56 AM   Resolved: 08/Oct/13 04:24 PM
Component/s: None
Affects Version/s: 3.3.0.release
Fix Version/s: 3.3.3

File Attachments: 1. Text File inherited-fix.patch (5 kB)
2. Text File inherited.patch (3 kB)


Severity: Production


 Description  « Hide
If you have an javax.persistence.AttributeConverter that it's inherited from a custom converter, then it will not work.

Adrian Ber added a comment - 14/Sep/13 10:06 AM - edited
I created a patch (inherited.patch) for JPA type conversion tests that reflect this issue. TypeConversionTests is failing now.

Adrian Ber made changes - 14/Sep/13 10:06 AM
Field Original Value New Value
Attachment inherited.patch [ 12011 ]
Adrian Ber added a comment - 14/Sep/13 10:07 AM

Adrian Ber added a comment - 14/Sep/13 11:24 AM - edited
And here is the patch (inherited-fix.patch) that will fix the issue.

Adrian Ber made changes - 14/Sep/13 11:24 AM
Attachment inherited-fix.patch [ 12012 ]
Adrian Ber made changes - 14/Sep/13 08:49 PM
Attachment inherited-fix.patch [ 12012 ]
Adrian Ber added a comment - 14/Sep/13 08:51 PM
Actually this is the latest patch with the fix - inherited-fix.patch.
The problem is that the JPAAnnotationReader is using getDeclaredMethods to inspect the Converter class, which returns only the methods declared in this class, hence the issue with the inherited type.

Adrian Ber made changes - 14/Sep/13 08:51 PM
Attachment inherited-fix.patch [ 12013 ]
Andy Jefferson added a comment - 16/Sep/13 02:25 AM
Thx. All patches will be looked at when I am back in the country, early October

Andy Jefferson added a comment - 08/Oct/13 04:04 PM
Would be nice if you have time, to have a test for this situation (i.e "inherited from a custom converter"), otherwise such behaviour will not be guaranteed

Andy Jefferson made changes - 08/Oct/13 04:20 PM
Project DataNucleus AccessPlatform [ 10140 ] DataNucleus API JPA [ 10171 ]
Key NUCACCESS-117 NUCJPA-251
Affects Version/s 3.3.0.release [ 11948 ]
Affects Version/s 3.3.0.release [ 11954 ]
Andy Jefferson added a comment - 08/Oct/13 04:24 PM
Ah, now i understand what your first "patch" is for. SVN trunk has both now. Thx

Andy Jefferson made changes - 08/Oct/13 04:24 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.3.3 [ 12020 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 23/Oct/13 11:56 AM
Status Resolved [ 5 ] Closed [ 6 ]