Re: Recall object by it's PK? (e.g. w/Lucene)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Apr 19 2004 - 15:24:40 EDT

  • Next message: Mike Kienenberger: "inExp vs inDbExp"

    On Apr 19, 2004, at 2:45 PM, Craig Jones wrote:
    > How do I tell Cayenne that the getId property is available for
    > searching
    > without mucking up the auto-PK generation?

    In addition to what Eric and Mike suggested, there is a method
    QueryUtils.selectQueryForIds(List) that takes a list of ObjectIds.
    Internally it does the same thing that was already suggested.

    Usually I am reluctant to recommend using QueryUtils, since its future
    fate is yet undefined. However it should be easy to migrate from this
    particular method when you switch to 1.1. In 1.1 your qualifier can be
    built like this:

    Map params = Collections.singletonMap("list", idList);
    Expression qual = Expression.fromString("db:id in
    $list").expWithParameters(params);

    > P.S. I don't suppose that there is any tutorial information available
    > on
    > using Lucene with Cayenne that I missed somewhere? If not, I guess I
    > get to be the one to write it, huh?

    It would be cool to have one!

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Apr 19 2004 - 15:24:46 EDT