This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hbm files generated for One to One Mapping