Package io.ebean

Interface ExpressionFactory


  • public interface ExpressionFactory
    Expression factory for creating standard expressions.

    Creates standard common expressions for using in a Query Where or Having clause.

    You will often not use this class directly but instead just add expressions via the methods on ExpressionList such as ExpressionList.gt(String, Object).

    The ExpressionList is returned from Query.where().

    
     // Example: fetch orders where status equals new or orderDate > lastWeek.
    
     Expression newOrLastWeek =
         Expr.or(Expr.eq("status", Order.Status.NEW),
                 Expr.gt("orderDate", lastWeek));
    
     List<Order> list = DB.find(Order.class)
       .where().add(newOrLastWeek)
       .findList();
     ...
     
    See Also:
    Query.where()