* @return the query builder
*/
public static QueryBuilder build(DatastoreService service, @DelegatesTo(value = QueryBuilder.class, strategy = Closure.DELEGATE_FIRST) Closure<?> c) {
Closure<?> cQuery = (Closure<?>) c.clone();
cQuery.setResolveStrategy(Closure.DELEGATE_FIRST);
QueryBuilder builder = new QueryBuilder(c.getThisObject() instanceof Script ? ((Script) c.getThisObject()).getBinding() : null);
cQuery.setDelegate(builder);
cQuery.call();
return builder;
}