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 :
Code:
Registration.xml :
<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 .