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?
|