When I make a class that defines both "gae.encoded-pk" and "gae.pk-id" persistent, the encoded-pk is updated, but the id remains null. There's no exception being thrown and the code is a straight copy paste from google's documentation, so I'm at a loss as to what may be happening here.
The class defines:
@PersistenceCapable
public class MyClass {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
private String encodedKey;
@Persistent
@Extension(vendorName="datanucleus", key="gae.pk-id", value="true")
private Long keyId;
And I make it persistent like this:
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.makePersistent(myInstance);
// myInstance = pm.makePersistent(myInstance); - Produces the same result.
} finally {
pm.close();
}
I'm using the debugger to step through this code, but the keyId remains null, even after the persistence manager is closed.
I should also point out that this is running locally using the google appengine development kit. Any pointers as to how I could debug this would be greatly appreciated!