Re-selecting cached item before a db refresh still gives me the old instanc

Hi,
We have a lazy-load feature where upon selecting an item in the grid, extra data will be added to the selected item.
We have a detail view where we can make changes to said selected item. If a user cancels the changes made in the detail, the selected is cached and the dataprovider is refreshed (therefor clearing all changes), then the item is re-selected using the old reference. My problem here is that what I presumed is that the SelectionModel would use the “getId()” method or something from the DP to get the corresponding item and select that item, but apparently it just sets the selectedItem reference to the old instance I passed in through the selection model.

Is there a way around this without having to iterate through my dataset manually to find the corresponding item to then pass to the select. Because now my selection listeners always get the wrong instance.

Kind regards