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

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

  • Next message: Craig Jones: "RE: Recall object by it's PK? (e.g. w/Lucene)"

    On Apr 19, 2004, at 5:03 PM, Craig Jones wrote:

    > Andrus,
    >
    >>> there is a method QueryUtils.selectQueryForIds(List) that takes a
    > list of ObjectIds.
    >
    > Are you sugesting that I need have Lucene store (serialize) the whole
    > ObjectId, rather than just the PK value itself? I'm not sure I can do
    > that, since Lucene only seems to want to store ASCII text.
    >
    > Or was that just an aside, in case I happen to want to work with
    > ObjectId's?
    >
    > // Craig

    I was simply saying that there is a ready to use API for this type of
    query, and it happens to work with ObjectIds. What was implied is that
    you'll have to wrap your pks into ObjectIds by yourself right on the
    spot, e.g. by using this constructor: ObjectId(Class, String, int).
    This is less efficient, since you'd create a bunch of extra short-lived
    objects, but makes the code more compact.

    At the end it doesn't matter that much whether you use QueryUtils or
    create the qualifier manually, the result is the same :-)

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Apr 19 2004 - 18:07:44 EDT