Finally found a way in case anybody was curious... Unfortunately, I
have to loop through all of my pertinent records until I have a match
on the keys. If anyone can suggest a different way (that works)
that's more efficient than below, do tell...
Query query = pm.newQuery(Categories.class,
com.google.appengine.api.datastore.Key:Categories(76) is what's
returned on the insert:
Categories category = new Categories(user.getNickname(), account,
categoryName);
pm.makePersistent(category);
Object o = JDOHelper.getObjectId(category);
System.out.println(o.toString());
This is what's
java.lang.NullPointerException at ma.CategoriesServlet.doPost
(CategoriesServlet.java:61)
So you have an NPE in your code.
Which log are you referring to? Can you point me to where it would be on my
computer?
The log for GAE/J of course. No idea where you've configured it to go
to. Look at
This is strange - when I retrieve the object after persisting via
JDOHelper.getObjectId(obj), I get an object back no problem. Then,
before trying to delete the object, I do pm.newObjectIdInstance
(Categories.class, key) and I get a NullPointerException. I know in
this post I've put in
This is strange - when I retrieve the object after persisting via
JDOHelper.getObjectId(obj), I get an object back no problem.
Yes, but you haven't told us what is the id returned by that method.
And whats in the log when you invoke that pm.getObjectById ... ?
Then,before trying to delete the
Let me be more specific about what's happening...
Not sure why we need to know what your app does; an object has a JDO
identity, set when you persist it, and that identity has to be used
when finding it. If you put in something else then you get an
exception.
When you persist your object what
Ok - before trying to delete the specific Transacation, I'm looping
through all Transactions to check if the delete request parm is the
same as Transaction.getKey().toString [if (trans.getKey().toString
().equals(reqParm)]. This is returning true. Isn't that evidence
enough that the key exists?
Not sure what I'm missing here...
Putting the correct identity key in ?
--
You received this message because you are subscribed to the Google Groups
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group,