I have been trying many to many
relationship between two classes Person
and Address
. I don't know but somewhere I am not thinking along the correct lines. For example for many to many mapping, I made two tables
CREATE TABLE person(p_id INTEGER,p_name TEXT,PRIMARY KEY(p_id));
CREATE TABLE address(a_id INTEGER,address TEXT);
and then I tried something in the mapping xml. After some unsuccessful attempts I read that you need three tables for many to many mapping, just as an answer to one of my question says.
Please explain me the reason for this ? Why do I need the third table ? Why cannot I make an association just with the two tables ?