Issue Details (XML | Word | Printable)

Key: OPENJPA-257
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jonathan Feinberg
Votes: 0
Watchers: 2
Operations

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

Getter/Setter type inconsistency in Entity IdClass

Created: 12/Jun/07 05:27 PM   Updated: 19/Jul/07 09:06 PM
Return to search
Component/s: jpa
Affects Version/s: 1.0.0
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File jira257.patch 2007-06-12 07:31 PM Pinaki Poddar 0.8 kB

Resolution Date: 19/Jul/07 09:06 PM


 Description  « Hide
In this excerpt from ClassMetaData, we are seeking getter and setter in an identity class. We should be seeking getter and setter with type of Entity class's *key*, not type of Entity class per se. The getter code refers to "c", which was earlier set to the correct object id field type. But the setter-seeking code refers incorrectly to "fmds[i].getDeclaredType()". This is a show-stopper, as it makes OpenJPA manual section 3.2 un-implementable.

if (m == null || !m.getReturnType().isAssignableFrom(c))
                    throw new MetaDataException(_loc.get("invalid-id",
                        _type, fmds[i].getName()));
                m = Reflection.findSetter(oid, fmds[i].getName(),
                    fmds[i].getDeclaredType(), false);
                if (m == null || m.getReturnType() != void.class)
                    throw new MetaDataException(_loc.get("invalid-id",
                        _type, fmds[i].getName()));

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.