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: NUCCORE-610
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Roshan Dawrani
Votes: 1
Watchers: 1

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

Wrong getXXX() gets picked up as getter method in ClassMetaData with JPA api used

Created: 10/Dec/10 11:21 AM   Updated: 01/Feb/11 08:35 PM   Resolved: 25/Jan/11 02:55 PM
Component/s: MetaData
Affects Version/s: 1.1.5
Fix Version/s: None

Environment: Grails 1.3.5 + App Engine SDK 1.4.0 + datanucleus-core-1.1.5 + datanucleus-jpa-1.1.5

 Description  « Hide
I am trying to put a grails based application on Google App Engine and facing issues with entity classes written in Groovy.

Groovy compiler adds a few synthetic methods. two of which are as below:
Object getProperty(String prop) {...}

void setProperty(String prop, Object value) {...}

The class org.datanucleus.metadata.ClassMetaData that collects the meta data for members that don't explicitly have been given metadata (in addMetaDataForMembersNotInMetaData()) goes only by method name and not by parameters length and hence wrongly picks up getProperty(String propName) as the getter for property "property" and then later in populateMemberMetaData(), it tries to look for getter/setter for prop and fails with InvalidMetaDataException.

I added the following check in addMetaDataForMembersNotInMetaData() where it identifies the getters, to avoid the above situation and it worked fine for me.
if ((paramTypes != null) && (paramTypes.length > 0)) continue;

I haven't seen if this issue has been fixed in newer releases because I am dependent on datanucleus jars that come in App Engine SDK.

It may become a common issue for groovy/grails apps on GAE.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson made changes - 10/Dec/10 11:39 AM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
Andy Jefferson made changes - 25/Jan/11 02:55 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Cannot Reproduce [ 5 ]
Andy Jefferson made changes - 01/Feb/11 08:35 PM
Status Resolved [ 5 ] Closed [ 6 ]