Re: getting obejcts, search criteria is date

From: Andrus (andru..bjectstyle.org)
Date: Sun Dec 01 2002 - 18:15:19 EST

  • Next message: Andrus: "Re: Survey: usage scenarios/performance/mile stone wishlist"

    Hi Martin,

    I think I can tell why the date filters do not work here. See below...

    At 02:40 PM 11/28/2002 +0100, martin ruff wrote:
    > employeeid.andExp(begindate);
    > employeeid.andExp(enddate);
    >
    > SelectQuery query = new SelectQuery("Reportingdates",
    > employeeid);
    > query.addOrdering("reportingdate", true);
    > return theDataContext.performQuery(query);

    Expression.andExp does not modify the original expression, rather it
    creates and returns a new expression (kind of like String.substring doesn't
    cut off the original string, but returns a new instance instead), so the
    code above could be rewritten like that:

    employeeid = employeeid.andExp(begindate).andExp(enddate);
    SelectQuery query = new SelectQuery("Reportingdates", employeeid);

    ....

    >by the way where can I get more information about building expressions?

    We need a dedicated chapter in the User Guide. I hope to get to that rather
    sooner than later. For now feel free to ask questions on this list. In
    general you got it right already - you can use dot-separated relationship
    and attribute names from the ObjEntities to build the "path" expressions.
    Operations allowed in expressions are the ones defined as constants in the
    Expression class (except for the aggregate functions like COUNT, AVG, MIN,
    MAX that are not yet implemented at this level).

    Andrus



    This archive was generated by hypermail 2.0.0 : Sun Dec 01 2002 - 18:14:28 EST