Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hbm files generated for One to One Mapping

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am trying to do establish a One to One Mapping between These two Tables Car and Registrion .

So i added a Unique Constriant on to the foreign Key .

But When i generated hbm files for these two tables it still has a Many to One mapping .


Tables :

create table Car (
CarName Varchar2(20) primary key,
CarModel Varchar2(20)
)


create table Registration (
RegNumber Varchar2(20) primary key,
CarName Varchar2(20) unique,
FOREIGN KEY (CarName)
REFERENCES Car(CarName)

)


HBM Files :
Registration.xml :



Please tell me where i am doing wrong .
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please look in below link, you will get useful information

http://www.vaannila.com/hibernate/hibernate-example/hibernate-mapping-one-to-one-1.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic