Re: AS400 mapping error

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Feb 14 2007 - 10:13:08 EST

  • Next message: Andrus Adamchik: "Re: Problem with DataPort & Tomcat"

    Yeah, expression parser can't cope with special chars. But you can
    always assemble the expression by hand:

    Expression e = ExpressionFactory.matchDbExp
    (Bsypemp.EMHSPPOUND_PK_COLUMN, new Integer(1));
    e = e.andExp(ExpressionFactory.likeExp(Bsypemp.EMYLNM_PROPERTY, lname
    +"%"));

    Andrus

    On Feb 14, 2007, at 10:02 AM, Frank wrote:

    > Why do I get this error?
    >
    > Lexical error at line 1, column 6. Encountered: "#" (35), after : ""
    > Expression expression = Expression.fromString
    > (Bsypemp.EMHSPPOUND_PK_COLUMN +" = 1 and EMYLNM LIKE $lastName");
    >
    > Map parameters = new HashMap(1);
    >
    > parameters.put("lastName", lname+"%");
    >
    > SelectQuery query = new SelectQuery
    > (Bsypemp.class,expression.expWithParameters(parameters));
    >



    This archive was generated by hypermail 2.0.0 : Wed Feb 14 2007 - 10:13:37 EST