Delete an entity by key without fetching it first in app engine (using JDO)

Posted by Peter Recore on Stack Overflow See other posts from Stack Overflow or by Peter Recore
Published on 2009-11-07T09:11:24Z Indexed on 2010/05/23 13:11 UTC
Read the original article Hit count: 223

Is there a way to delete an entity without having to fetch it from the datastore first? I am assuming I already have the key or id for the entity. I'm thinking of something like deleteObjectById that would be an analogue to getObjectById on PersistenceManager.

The closest I can think of is using Query.deletePersistentAll() (as seen here) and specifying a query that only relies on the key, but I can't tell if that is going to fetch the entity before deleting it.

thanks

EDIT: I know how to do this using the low level API, as well as in the python API. I was wondering if there was a way to do it within the JDO layer.

© Stack Overflow or respective owner

Related posts about java

Related posts about google-app-engine