create table Registration(registration_number varchar(20),car_name varchar(20) not null, primary key(registration_number),unique(car_name))
Made car_name as Unique , so to have one to One mapping .
By IDE Reverseengineering i got these hbm files
This is for Car
This is for Registration :
Please tell me is this mapping correct because i have a seen a example in a site of One to One Hibernate where the author uses
<many-to-one> inside the hbm file .
Please let me know .
Save India From Corruption - Anna Hazare.
posted 6 years ago
Your both hbm files are telling about individual entity. They are not telling about one to one relationship.You need to provide this in any one of your entity depends upon which entity you want to make it as souce. means which entity has foreign column.