I have a single object with two items in it. I want to write the contents of this object to two differant tables using hibernate, where each table will take a single item from the object.
A simple example is given below
Object contains
name,
address
and the two tables are
name_table
address_table
where name will be written to name_table,
address will be written to address_table
The two tables are having a 1-1 (primary key – foreign key) relationship
My questions are:
1.I would like to know if it is possible to write in such a manner into the DB tables from a single object.
1.If yes
a.will the foreign key also be written to the second table by hibernate automatically or do we have to use some indirect mechanism to do this
b.then could someone possible point out how one should go about writing the mapping file for it
1.Does anyone know if any documentation is available explaining Hibernate mapping files and its syntax and how one can go about writing it from scratch, instead of referring to examples to learn it.
respond to me in
piku.mishra@gmail.com