-->
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: how to restrict hibernate not to add extra column in db.
PostPosted: Fri Apr 13, 2007 9:06 am 
Newbie

Joined: Fri Apr 13, 2007 8:38 am
Posts: 12
problem:
iam unsing postgresql database.

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.in postgresql database.. i dont want this to happen adding unnecessary extra column...

is there any attribute to avoid creation of extra column?

ex: table1 : class_definition
columns: class_id_pk, class_name;
class_id_pk primary key btree (class_id_pk)


table2: state_classes
columns: state_classes_id_pk, class_id_fk

class_id_fk FOREIGN KEY (class_id_fk) REFERENCES class_definition(class_id_pk) MATCH FULL ON UPDATE NO ACTION ON DELETE CASCADE,

after running session factory, with in hibernate.cfg.xml having attribute hbmddl_auto update propery,,


it creates extra columns in state_classes, after generating hibernate generating mappings we get in postgres data base with

table2: state_classes
columns: state_classes_id_pk, class_id_fk. class_id_pk
,

is their is any option not to add extra column in postgres....


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.