public Query getQuery(ObjectType type, Object key) { Signature sig = getSignature(type); ObjectMap map = Root.getRoot().getObjectMap(type); Collection keys = map.getKeyProperties(); if (keys.size() != 1) { throw new IllegalArgumentException("type has more than one key"); } Property keyProp = (Property) keys.iterator().next(); Parameter keyParam = new Parameter (keyProp.getType(), Path.get("__key__")); sig.addParameter(keyParam); Filter f = new EqualsFilter(Path.get(keyProp.getName()), keyParam.getPath()); Query result = new Query(sig, f); result.set(keyParam, key); return result;
public Query getQuery(ObjectType type) { Signature sig = new Signature(type); sig.addDefaultProperties(); return new Query(sig, null);
    public Query getQuery(ObjectType type, Object key) {        Signature sig = getSignature(type);        ObjectMap map = Root.getRoot().getObjectMap(type);        Collection keys = map.getKeyProperties();        if (keys.size() != 1) {            throw new IllegalArgumentException("type has more than one key");        }        Property keyProp = (Property) keys.iterator().next();        Parameter keyParam = new Parameter            (keyProp.getType(), Path.get("__key__"));        sig.addParameter(keyParam);        Filter f =            new EqualsFilter(Path.get(keyProp.getName()), keyParam.getPath());        Query result = new Query(sig, f);        result.set(keyParam, key);        return result;    }