
| Key: |
OPENJPA-257
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Jonathan Feinberg
|
| Votes: |
0
|
| Watchers: |
2
|
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
19/Jul/07 09:06 PM
|
|
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()));
|
|
Description
|
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())); |
Show » |
made changes - 12/Jun/07 06:34 PM
| Field |
Original Value |
New Value |
|
Priority
|
Critical
[ 2
]
|
Major
[ 3
]
|
made changes - 12/Jun/07 07:31 PM
|
Attachment
|
|
jira257.patch
[ 12359544
]
|
made changes - 19/Jul/07 09:06 PM
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Fix Version/s
|
|
1.0.0
[ 12312341
]
|
|
Resolution
|
|
Fixed
[ 1
]
|
|
void setFoo(String fooKey) { foo = fooKey; }
void setFoo(Foo foo) { foo = foo.getId() }
In the identity class, but this is cheesy.