help with AS400 call

From: Frank (farocc..otmail.com)
Date: Tue Feb 13 2007 - 11:09:53 EST

  • Next message: Andrus Adamchik: "Re: cayenne with jetty6"

    Hello,

    I have the followign defined as a Raw Sql in Cayenne

    SELECT BSYDTAA.BSYPEMP.EMYLNM, BSYDTAA.BSYPEMP.EMYFNM,
    BSYDTAC.BPRPPCP.PCDEP4, BSYDTAC.BPRPPCP.PCLDDS, BSYDTAA.BSYPEMP.EMEMP# AS
    EMEMP, BSYDTAA.BSYPEMP.EMWPH# AS WPHONE FROM BSYDTAA.BSYPEMP,
    BSYDTAC.BPRPPCP WHERE BSYDTAA.BSYPEMP.EMHSP# = BSYDTAC.BPRPPCP.PCHSP# AND
    BSYDTAA.BSYPEMP.EMDEP4 = BSYDTAC.BPRPPCP.PCDEP4 AND (BSYDTAA.BSYPEMP.EMHSP#
    IN (1,5)) AND (BSYDTAA.BSYPEMP.EMDOT=0)
    AND EMYLNM like ?
    AND EMYFNM like ?
    ORDER BY EMYLNM

    I am trying something like this, but it is not working:

    DataContext context = DataContext.getThreadDataContext();

    Expression qualifier1 =
    ExpressionFactory.likeIgnoreCaseExp(Employees.EMYFNM_PROPERTY,fname+"%");

    Expression qualifier2 =
    ExpressionFactory.likeIgnoreCaseExp(Employees.EMYLNM_PROPERTY,lname+"%");

    SelectQuery query = new SelectQuery(Bsypemp.class,qualifier2);

    List records = context.performQuery(query);

    What am I doing wrong?
    Thanks
    Frank



    This archive was generated by hypermail 2.0.0 : Tue Feb 13 2007 - 11:10:50 EST