Opened 4 years ago

Closed 4 years ago

#2216 closed enhancement (fixed)

Improve API for adding and removing items to an item list

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.17
Component: core Version:
Keywords: Cc:

Description

There currently existing methods for adding or removing items to item lists typically require that Listable items are passed. It would be nice and more efficient to have some more possibilities:

  • add(ItemQuery) and remove(ItemQuery): This could use ItemQuery.idList() method to only load id values which should be a lot more efficient than ItemQuery.iterate() which load full items.
  • add(Collection<Integer>) and remove(Collection<Integer>): ID values are typically easy to pass around and there is really no need to first load the full items.

Change History (2)

comment:1 by Nicklas Nordborg, 4 years ago

In 7833:

References #2216: Improve API for adding and removing items to an item list

Added methods to ItemList. The new methods are overloaded variants of the existing add() and removeItems() methods.

comment:2 by Nicklas Nordborg, 4 years ago

Resolution: fixed
Status: newclosed

In 7834:

Fixes #2216: Improve API for adding and removing items to an item list

Added a test case for the new add and remove methods.

Existing functionality in the web client has been updated to use the new API.

Note: See TracTickets for help on using tickets.