DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
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

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.

Sort Order: Ascending order - Click to sort in descending order
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 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 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.

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 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