When we get the list, it has NULLs in it. This is likely due to gaps in the values of the index column. Until we have time to do a thorough cleaning of the database, is there an option we can set to have missing numbers be skipped instead of inserting NULL in the list?
If the list [0=null,1=Obj1] should have nulls filtered out, it would turn to [0=Obj1] which means Hibernate has to remove the row with index 0 and change the index 1 to 0, hence data has to be changed.
Note though, that if you do this filtering yourself in a @PostLoad listener, the collection is “dirty” and the data changes I described will be flushed on transaction commit. Here you can find information on entity listeners: Hibernate ORM 5.6.12.Final User Guide
Well, it’s something we want to be written back and it saves us having to do it on deletes. Thanks again for the help, I guess I didn’t read the guide well enough.