-->
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.  [ 2 posts ] 
Author Message
 Post subject: unique constraint and hbm2ddl not to generate extra columns
PostPosted: Fri Apr 13, 2007 8:54 am 
Newbie

Joined: Fri Apr 13, 2007 8:38 am
Posts: 12
first problem:

I have a UNIQUE constraint in postgres database, on a column class_name in a table class_definition, and also have primary key with class_id_pk , when i load a session Factory, with option in hibernate.cfg.xml <property>name="hibernate.hbm2ddl.auto"> update </property>

i get error schema could not be completed, and null pointer exception. i have used attribute unique="true" in hbm.xml, but still i am getting the same error.

second problem:

i have two tables one is class_definition with having column named class_id_pk which is primary key, and there is another table state_classes with column class_id_fk having the foreign key reference of class_id_pk. when i load session factory, it creates the extra empty column with name class_id_pk in state_classes table... i dont want this to happen adding unnecessary extra column...

how to solve these two problems in hibernate? is there any attribute to avoid creation of extra column?


Top
 Profile  
 
 Post subject: please explain why i'm getting exception
PostPosted: Tue Apr 17, 2007 1:55 am 
Newbie

Joined: Fri Apr 13, 2007 8:38 am
Posts: 12
plz any help, want quick reply

bye


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

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.