OPENJPA-1482:

Prevent NoSuchMethodError when calling setVersion.
Submitted By : Rick Curtis

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@905835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2010-02-02 23:23:57 +00:00
parent cbf700e499
commit a720a9c6f6
2 changed files with 10 additions and 1 deletions

View File

@ -3714,7 +3714,8 @@ public class PCEnhancer {
v.setTransient(true);
loadManagedInstance(code, true);
code.constant().setValue(1);
addSetManagedValueCode(code, v);
// pcVersionInit = true;
putfield(code, null, v.getName(), v.getDeclaredType());
}
code.vreturn();

View File

@ -75,6 +75,14 @@ public class TestDetachNoStateField extends SingleEMFTestCase {
}
/**
* This testcase was added for OPENJPA-1482.
*/
public void testSetVersionPropertyAccess() {
NoDetachedStateEntityPropertyAccess entity = new NoDetachedStateEntityPropertyAccess();
entity.setVersion(1);
}
void loadDB() {
OpenJPAEntityManagerSPI em = emf.createEntityManager();
em.getTransaction().begin();