Hi all,
I was just wonder if someone could tell me if I am doing this right. I've got a object defined like below:
Code:
@Entity
@Table(name = "STORE")
public class Store {
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "STORE_ID", nullable = false, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_FIELD_STORE_ID")
@org.hibernate.annotations.IndexColumn(name = "FIELD_POSITION", nullable = false)
private List<Field> fields = new ArrayList<Field>();
// More Fields, Methods Etc. Here
}
I've rearranged the order of the list "fields" and have tried to persist this change but nothing is happening. I get no update SQL command showing (showsql is set to true). I believe my update code is fine as when I change another property on this item (e.g. name), the update goes through fine.
Is just changing the order of the fields list enough for it to show as updated and therefore indicate to Hibernate it needs persisting?
Cheers for any input,
Lee
(Using Hibernate 3.2.6 and MySql 5.x. Will post more info like mappings if people think it's needed)