Re: limit of objects for in-memory filter?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Dec 02 2005 - 15:54:26 EST

  • Next message: Eric Schneider: "Re: limit of objects for in-memory filter?"

    Eric,

    No, there is no artificial limit on how many objects you can filter.
    The only practical limit is the amount of memory. Since you already
    have these objects in memory, this is not a problem either.

    In-memory algorithms do have some limitations though. There is a
    particularly stupid one that came up before - Cayenne can't compare
    different numeric types (e.g. "new Long(5)" will not be equal to "new
    Integer(5)"). So if for instance you have a BigDecimal inside the
    ObjectId, and compare it to an equivalent Integer, you'll get no match.

    So inspect one of the objects to see what Java type is used within
    ObjectId map, and use the same type in comparison.

    Andrus

    On Dec 2, 2005, at 11:10 PM, Eric Schneider wrote:
    > Sure,
    >
    > Expression qual = _playerExpressionForPlayer(player);
    > qual = qual.andExp(ExpressionFactory.matchDbExp
    > (PlayerStats.GAMETYPE_PK_COLUMN,
    > gameType));
    >
    > List results = new ArrayList(_cachedPlayerStats);
    > results = qual.filterObjects(results);
    >
    > ...
    >
    > private Expression _playerExpressionForPlayer(Player player) {
    > Expression qual =
    > ExpressionFactory.matchDbExp(PlayerStats.PLAYERID_PK_COLUMN,
    > player.getPlayerId());
    > return qual;
    > }



    This archive was generated by hypermail 2.0.0 : Fri Dec 02 2005 - 15:54:31 EST