-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exclude foreign key from update statements
PostPosted: Fri Sep 28, 2012 3:03 pm 
Newbie

Joined: Fri Sep 28, 2012 2:51 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.