| According to JSR 338, this does not appear to be a valid case. {{ @Entity public class Parent extends Base implements Serializable { ... @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL) @OrderColumn(name = "idx") public List<Child> getChildren() { return children; } ... } @Entity @Cache(usage = CacheConcurrencyStrategy.NONE) public class Child extends BaseChild implements Serializable { ... } @MappedSuperclass public abstract class BaseChild extends Base { ... @Column(name="idx", nullable = false) public int getIndex() { return index; } ... } }} 11.1.43 OrderColumn Annotation says: "The order column is not visible as part of the state of the entity or embeddable class.[117]" Footnote 117: "[117] The OrderBy annotation should be used for ordering that is visible as persistent state and maintained by the application" Even if it were a valid use case, BaseChild#index is not being updated to reflect the objects' order in Parent#children. On flush, the Child entities are not dirty, so they remain in the second-level cache with the old values for BaseChild#index. This is expected behavior. I confirmed that updating BaseChild#index to reflect the objects' order in Parent#children results in the tests passing, except for the test using a read-only cache (since a read-only cache can't be updated). |