Re: error building Expressions: Can't resolve path component

From: Zvonimir Spajic (z.spaji..scensys.de)
Date: Mon May 02 2005 - 09:21:20 EDT

  • Next message: Andrus Adamchik: "Re: error building Expressions: Can't resolve path component"

    I tried something out, and is
    this the best solution?

    Without defining the id in the path (hasCategory.id), only write
    hasCategory:

    ...
    Expression qual_2 = ExpressionFactory.matchExp("hasCategory", categoryId);
    ...

    Greets
    Zvonimir

    On Mon, 02 May 2005 15:06:38 +0200, Zvonimir Spajic <z.spaji..scensys.de>
    wrote:

    > Hello,
    >
    > 1) why it's not allowed to build an expression like this
    > --> see qual_2 (error message: "Can't resolve path component:
    > [Category.id]")
    >
    > ...
    > Expression qual_1 = Expression.fromString(SomeObject.NAME_PROPERTY + "
    > likeIgnoreCase '%" + name + "%'");
    > Expression qual_2 = ExpressionFactory.matchExp("hasCategory.id",
    > categoryId);
    > qual_1 = qual_1.andExp(qual_2);
    > SelectQuery query = new SelectQuery(SomeObject.class, qual_1);
    > ...
    >
    > -id is the PK-Column of category table
    >
    > 2) what is the best solution in this cases.
    >
    > Thanks for help
    > Zvonimir Spajic
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon May 02 2005 - 09:21:24 EDT