Hi Guillaume,

[EMAIL PROTECTED] wrote:
Hello,

as I'm new on this list, forgive me if the question was already asked.

I'm right now trying to create the mapping for 2 class I've developped:
  - A contains a Collection of class B
  - B doesn't have any relation back to A

With my current understanding of OJB, I'll need to create in B a reference
back to A to be able to make the mapping (using an inverse-foreignkey
element). Is that right ? If yes why ?
What you need is not a full reference object pointing back to A, but an attribute that holds the foreign attribute.

If the table A has a Primary key A_ID then the B table must contain a column FK_A_ID to allow the RDBMS to manage the foreign constraints.

OJB simply parallels the foreign mechanisms of relational databases here and thus you need attributes in your persistent classes to hold primary- and foreign-key data.

cheers,
Thomas

Thanks,
    Guillaume




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




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

Reply via email to