To turn a Java Google App Engine JDO query into a keys-only query, call setResult(String) on it to specify that only the @PrimaryKey column should be returned. JDO will convert this into a keys-only query on the datastore.
For example, if your entity class looks like this:
public class YourEntity {
@PrimaryKey
private String name;
// ...

