Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Using p2 expression or QL to query all IUs which provide a capability in a specific namespace

On 02/23/2010 07:25 PM, Thomas Watson wrote:

This is where I got confused.

everything.select(<some selection expression>).latest()

Here it seems like everything.select(<some selection expression>) would return a collection of IUs. Then the latest() would just go through the collection of IUs regardless of the id and find the one that has the largest version and the result would be a single IU. Does latest() actually pick the latest version of each group of IUs with the same id?

Yes. The latest can only act on instances that implements the IVersionedId interface. It will collect the instances in a map keyed by id and discard all but the latest version. You got the same result before using the LatestIUVersionQuery in a query pipe.

- thomas



Back to the top