Sorting table through drag & drop

I am a Vaadin newbie and I want to sort the rows of a table through drag & drop. I partially achieved this result using a TreeTable without child and using moveAfterSibling to move the rows. However this only affects the visual order or the table but it doesn’t change rows ID or the sorting order of the table. How can I get the position of the rows as it’s displayed on the screen?

Thank you for the support.