Package groovyx.gaelyk.query

Examples of groovyx.gaelyk.query.QueryBuilder


     * @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;
    }
View Full Code Here


     * @param c
     *            the Closure<?> representing the query to execute
     * @return the results
     */
    public static Object execute(DatastoreService service, @DelegatesTo(value = QueryBuilder.class, strategy = Closure.DELEGATE_FIRST) Closure<?> c) {
        QueryBuilder builder = build(service, c);
        return builder.execute();
    }
View Full Code Here

     * @param c
     *            the Closure<?> representing the query to execute
     * @return the iterator over the results
     */
    public static Object iterate(DatastoreService service, @DelegatesTo(value = QueryBuilder.class, strategy = Closure.DELEGATE_FIRST) Closure<?> c) {
        QueryBuilder builder = build(service, c);
        return builder.iterate();
    }
View Full Code Here

TOP

Related Classes of groovyx.gaelyk.query.QueryBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.