We use Hibernate to save a list of entities using OrderColumn to maintain their order.
class MyObject {
...
@OneToMany(mappedBy = "myobject", cascade = {CascadeType.PERSIST, CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH})
@OrderColumn(name = "index_number")
private List<sampleElement> sampleElement;
}
When saving the list of elements, the index_number starts with 1 while the documentation suggests it should start from 0. This also causes an issue upon reading because the read list then contains a null element at position 0.
We have looked around quite a bit and are somewhat out of ideas. Any suggestions?