Class Q

java.lang.Object
com.onec.query.Q

public final class Q extends Object
Static factory helpers for the fluent query DSL. They mirror the col(...) / ref(...) / eq(...) shape from the issue and reuse the existing FieldReference method-reference mechanism for field resolution.

Paths produced here are left un-rooted; QueryEngine.from(Class) binds them to the query root, so Q.col(SalesOrder::getNumber) works without repeating the class.


 import static com.onec.query.Q.*;

 query.from(SalesOrder.class)
      .select(col(SalesOrder::getNumber),
              ref(SalesOrder::getCustomer, Customer::getName),
              ref(SalesOrder::getCustomer, Customer::getRegion, Region::getDescription))
      .where(eq(SalesOrder::getStatus, "APPROVED"))
      .orderBy(desc(SalesOrder::getDate))
      .fetch();