Hi,
I have an entity (Item) which holds a ManyToOne relationship to another entity (Product). The related entity cannot be modified once an Item has been created (an Item always refer to the same product).
I'd like to know if there is a way to prevent Hibernate from adding the foreign key to the update statements. This would help the database as it would not need to check the referential integrity.
I tried to annotate the getter with @Column(updatable=false, nullable=false) and @JoinColumn(updatable=false, nullable=false) but the foreign key is still updated in the SQL statements.
I'm using Hibernate 3.3.1.GA
Thanks, Nicolas.
|