aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hbm files generated for One to One Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hbm files generated for One to One Mapping " Watch "Hbm files generated for One to One Mapping " New topic
Author

Hbm files generated for One to One Mapping

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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 .


Save India From Corruption - Anna Hazare.
xsunil kumar
Ranch Hand

Joined: Dec 14, 2009
Posts: 133
Please look in below link, you will get useful information

http://www.vaannila.com/hibernate/hibernate-example/hibernate-mapping-one-to-one-1.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hbm files generated for One to One Mapping