This week's book giveaway is in the
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!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Object Relational Mapping
Hbm files generated for One to One Mapping
Ravi Kiran Va
Joined: Apr 18, 2009
Dec 15, 2009 09:23:11
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 .
create table Car (
CarName Varchar2(20) primary key,
create table Registration (
RegNumber Varchar2(20) primary key,
CarName Varchar2(20) unique,
FOREIGN KEY (CarName)
HBM Files :
<hibernate-mapping> <class name="MYPACK.Registration" table="REGISTRATION" schema="CHENNAISPAT"> <id name="regnumber" type="java.lang.String"> <column name="REGNUMBER" length="20" /> <generator class="assigned" /> </id> <many-to-one name="car" class="MYPACK.Car" fetch="select"> <column name="CARNAME" length="20" /> </many-to-one> </class> </hibernate-mapping>
Please tell me where i am doing wrong .
Save India From Corruption - Anna Hazare.
Joined: Dec 14, 2009
Dec 15, 2009 10:04:40
Please look in below link, you will get useful information
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Hbm files generated for One to One Mapping
Replacing *.hbm.xml files with @Annotations.
Hibernate - Creating .hbm file for link table
How to achieve One to One mapping between two tables
Hibernate mapping doubt
Hibernate One to One Example
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014