Hello,
I would like to use Hibernate Tools for a project and I need to generate the HBM files and java files from an existing Oracle 10g database.
The both generations work, but the HBM files desn't contain any information about the hierarchy. See the SQL code below :
Code:
create table Employe (
ID integer not null,
NOM varchar(20)
);
alter table Employe
add constraint Employe_pk primary key (ID);
create table Note (
ID integer not null,
valeur varchar(20)
);
alter table Note
add constraint Note_pk primary key (ID);
create table Ouvrier (
EMPLOYE_ID integer not null,
SERVICE varchar(20),
NOTE_ID integer not null
);
alter table Ouvrier
add constraint Ouvrier_pk primary key (EMPLOYE_ID);
alter table Ouvrier
add constraint Employe_fk foreign key (EMPLOYE_ID) references Employe (ID);
alter table Ouvrier
add constraint Note_fk foreign key (NOTE_ID) references NOTE (ID);
Here I would like to have a class Ouvrier wich extends Employe like it's possible with Hibernate.
Is my SQL code wrong to do that or is my Hibernate Tools configuration wrong or perhaps Hibernate Tools reverse ing cannot do that ?