// Path: nexusdata/src/main/java/com/github/dkharrat/nexusdata/predicate/PredicateBuilder.java
// public class PredicateBuilder {
// 
//     private final Predicate curPredicate;
//     private final Expression<?> curExpression;
// 
//     PredicateBuilder(Predicate curPredicate) {
//         this.curPredicate = curPredicate;
//         this.curExpression = null;
//     }
// 
//     PredicateBuilder(Expression<?> curExpression) {
//         this.curExpression = curExpression;
//         this.curPredicate = null;
//     }
// 
//     public Predicate getPredicate() {
//         return curPredicate;
//     }
// 
//     public static Predicate parse(String expr) {
//         PredicateParser parser = new PredicateParser(expr);
//         return parser.parse();
//     }
// 
//     Expression<?> getExpression() {
//         return curExpression;
//     }
// 
//     public PredicateBuilder gt(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.GREATER_THAN, rhs));
//     }
// 
//     public PredicateBuilder gt(ExpressionBuilder rhs) {
//         return gt(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder gt(T value) {
//         return gt(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder lt(Expression rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.LESS_THAN, rhs));
//     }
// 
//     public PredicateBuilder lt(ExpressionBuilder rhs) {
//         return lt(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder lt(T value) {
//         return lt(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder eq(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.EQUAL, rhs));
//     }
// 
//     public PredicateBuilder eq(ExpressionBuilder rhs) {
//         return eq(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder eq(T value) {
//         return eq(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder notEq(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.NOT_EQUAL, rhs));
//     }
// 
//     public PredicateBuilder notEq(ExpressionBuilder rhs) {
//         return notEq(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder notEq(T value) {
//         return notEq(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder isNull() {
//         return eq(new ConstantExpression<Object>(null));
//     }
// 
//     public PredicateBuilder isNotNull() {
//         return notEq(new ConstantExpression<Object>(null));
//     }
// 
//     public PredicateBuilder and(PredicateBuilder rhs) {
//         return new PredicateBuilder(new CompoundPredicate(curPredicate, CompoundPredicate.Operator.AND, rhs.getPredicate()));
//     }
// 
//     public PredicateBuilder or(PredicateBuilder rhs) {
//         return new PredicateBuilder(new CompoundPredicate(curPredicate, CompoundPredicate.Operator.OR, rhs.getPredicate()));
//     }
// }


import java.util.ArrayList;
import java.util.List;
import com.github.dkharrat.nexusdata.metamodel.Entity;
import com.github.dkharrat.nexusdata.predicate.Predicate;
import com.github.dkharrat.nexusdata.predicate.PredicateBuilder;
     * A builder class that simplifies the creation of a FetchRequest.
     */
    public static class Builder<T extends ManagedObject> {
        private final FetchRequest<T> fetchRequest;

        /**
         * @see FetchRequest#FetchRequest(com.github.dkharrat.nexusdata.metamodel.Entity)
         */
        public static <S extends ManagedObject> Builder<S> forEntity(Entity<S> entity) {
            return new Builder<S>(new FetchRequest<S>(entity));
        }

        private Builder(FetchRequest<T> fetchRequest) {
            this.fetchRequest = fetchRequest;
        }

        /**
         * @see FetchRequest#setPredicate(com.github.dkharrat.nexusdata.predicate.Predicate)
         */
        public Builder<T> predicate(Predicate predicate) {
            fetchRequest.setPredicate(predicate);
            return this;
        }

        /**
         * Sets the predicate given a string representation.
         *
         * @see FetchRequest#setPredicate(com.github.dkharrat.nexusdata.predicate.Predicate)
         */
        public Builder<T> predicate(String predicateToParse) {
// Path: nexusdata/src/main/java/com/github/dkharrat/nexusdata/predicate/PredicateBuilder.java
// public class PredicateBuilder {
// 
//     private final Predicate curPredicate;
//     private final Expression<?> curExpression;
// 
//     PredicateBuilder(Predicate curPredicate) {
//         this.curPredicate = curPredicate;
//         this.curExpression = null;
//     }
// 
//     PredicateBuilder(Expression<?> curExpression) {
//         this.curExpression = curExpression;
//         this.curPredicate = null;
//     }
// 
//     public Predicate getPredicate() {
//         return curPredicate;
//     }
// 
//     public static Predicate parse(String expr) {
//         PredicateParser parser = new PredicateParser(expr);
//         return parser.parse();
//     }
// 
//     Expression<?> getExpression() {
//         return curExpression;
//     }
// 
//     public PredicateBuilder gt(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.GREATER_THAN, rhs));
//     }
// 
//     public PredicateBuilder gt(ExpressionBuilder rhs) {
//         return gt(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder gt(T value) {
//         return gt(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder lt(Expression rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.LESS_THAN, rhs));
//     }
// 
//     public PredicateBuilder lt(ExpressionBuilder rhs) {
//         return lt(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder lt(T value) {
//         return lt(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder eq(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.EQUAL, rhs));
//     }
// 
//     public PredicateBuilder eq(ExpressionBuilder rhs) {
//         return eq(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder eq(T value) {
//         return eq(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder notEq(Expression<?> rhs) {
//         return new PredicateBuilder(new ComparisonPredicate(curExpression, ComparisonPredicate.Operator.NOT_EQUAL, rhs));
//     }
// 
//     public PredicateBuilder notEq(ExpressionBuilder rhs) {
//         return notEq(rhs.getExpression());
//     }
// 
//     public <T> PredicateBuilder notEq(T value) {
//         return notEq(new ConstantExpression<T>(value));
//     }
// 
//     public PredicateBuilder isNull() {
//         return eq(new ConstantExpression<Object>(null));
//     }
// 
//     public PredicateBuilder isNotNull() {
//         return notEq(new ConstantExpression<Object>(null));
//     }
// 
//     public PredicateBuilder and(PredicateBuilder rhs) {
//         return new PredicateBuilder(new CompoundPredicate(curPredicate, CompoundPredicate.Operator.AND, rhs.getPredicate()));
//     }
// 
//     public PredicateBuilder or(PredicateBuilder rhs) {
//         return new PredicateBuilder(new CompoundPredicate(curPredicate, CompoundPredicate.Operator.OR, rhs.getPredicate()));
//     }
// }


// Path: nexusdata/src/main/java/com/github/dkharrat/nexusdata/core/FetchRequest.java
import java.util.ArrayList;
import java.util.List;
import com.github.dkharrat.nexusdata.metamodel.Entity;
import com.github.dkharrat.nexusdata.predicate.Predicate;
import com.github.dkharrat.nexusdata.predicate.PredicateBuilder;

     * A builder class that simplifies the creation of a FetchRequest.
     */
    public static class Builder<T extends ManagedObject> {
        private final FetchRequest<T> fetchRequest;

        /**
         * @see FetchRequest#FetchRequest(com.github.dkharrat.nexusdata.metamodel.Entity)
         */
        public static <S extends ManagedObject> Builder<S> forEntity(Entity<S> entity) {
            return new Builder<S>(new FetchRequest<S>(entity));
        }

        private Builder(FetchRequest<T> fetchRequest) {
            this.fetchRequest = fetchRequest;
        }

        /**
         * @see FetchRequest#setPredicate(com.github.dkharrat.nexusdata.predicate.Predicate)
         */
        public Builder<T> predicate(Predicate predicate) {
            fetchRequest.setPredicate(predicate);
            return this;
        }

        /**
         * Sets the predicate given a string representation.
         *
         * @see FetchRequest#setPredicate(com.github.dkharrat.nexusdata.predicate.Predicate)
         */
        public Builder<T> predicate(String predicateToParse) {
            fetchRequest.setPredicate(PredicateBuilder.parse(predicateToParse));