I am trying to build a relatively simple application on Google App Engine. I am trying to use JDO to build my datalayer and am running into a load of issues. I am very new to JDO so these might be newbie issues, but I cant seem to proceed past this.
The problem is that when i try to access an object via getObjectByID and I create a User key to pass to the function, I was getting different errors at different times.
1. Error while trying to convert <stringified primary key object> into internal key
2. Object not found
The detailed steps I performed are as follows:
1. Created a New Google App Engine Project
2. Created a new Entity: User (Code attached) (fields: firstName, lastName, emailID)
3. Created a primaryKey: UserPK (on emailID ) // I know that i could use the default key, but i need to do this way
4. Stored it vi
User user = new User(....., "email@example.com");
5. Trying to access it by: UserPK pk = new UserPK("com.basildsouza.odometer.datalayer.dataobjects.User$UserPK::firstname.lastname@example.org")
pm.getObjectById(pk) // This doesnt work, was initially giving my error 1 (see above) and now gives me error 2
Also when i run a query like select from ...User where emailIDemail@example.com, it does find the value properly, so i am at a loss as to why the getObjectById isnt working.
Also, when i do pm.deletePersistant on an object i got via my above query, i get an error saying that the primary key is null.
What i have understood from this, is that for some reason the primary key isnt getting set for the user object. But i dont know why.
User.java (with the UserPK as an inner static class) (Pardon the mess :)
jdoconfig.xml (generated by google)