Hi Sylvain,

> For OJB, to do an association between Person and Address you need a
foreign key attribute in your database. Normally you 
> should put a foreign key in the relationnal table Person (which contains
an addressID). But you can also put a foreign key > in the table Address
(which contains an personID)

Those solutions are not really the same .. if you put the (fk)personid into
the address table, it means that each address can only belong to one person
and that each person can have multiple addresses.
The otherway around means that an address may be associated with multiple
people put that one person can only have one.

Its a matter of design really. Usually you'd go with the personid in the
address table since thats mostly the case in real life (where people have
multiple addresses but *usually* an address has no more than one
inhabitant), strictly speaking that'd be wrong though, the db-design-proper
way to do this would be to create an association table to map people to
addresses with maybe different phone numbers attached to address+person
(like phone at home, phone at work, cell etc).
For more information on database design, google up 'normalisation +db' or
'database +modelling', that should get you started ...

You need to map every primary key attribute in the database, I'd say (I am
not so sure about that, though) ...

And yes, with OJB you should be able to implement every *proper* database
design where tables are normalized and the model is tailored to 'the real
world'.

Greetings,
Wulf


<<application/ms-tnef>>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to