@ManyToOne(updatable=false) - how it should work?
问题 I want to have a read-only functionality in one of my entities. I know that in JPA 2.0 we don't have such functionality per se. I thought we can achieve it using updateable=false, insertable=false but I don't think I get how it works. Assume that I have two entities: OrderedItem and Customer : @Entity public class OrderedItem { @Id @GeneratedValue private int id; private String name; @ManyToOne @JoinColumn(updatable = false) private Customer owner; // bunch of simple getters and setters }