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: hibernate tries to recreate existing foreign keys
PostPosted: Mon Apr 04, 2011 12:14 pm 
Beginner
Beginner

Joined: Mon Apr 04, 2011 12:08 pm
Posts: 32
Hi,

I generated annotated beans with hiberante-tools from an already existing model, with it's contraints etcetera

the debug shows "org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: fk_foobar" wich means the metadata from the database are understood.
However it doesn't prevent hibernate when it's un ddl=update mode to try to create the same constraint but with it's own name.

putting @ForeignKey(name="fk_foobar") on the manyToOne getter seems to prevent hibernate to try to recreate it, but I don't see why hibernate just don't try to create it since it was already able to know there was one to create the bean model.


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.