You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thomas Mahler <th...@web.de> on 2003/08/01 15:22:04 UTC
Re: Why foreignkey field-ref and not column-ref ?
Hi Sebastien,
It's possible to use anonymous fields for foreign keys. an anonymous
field does not specify a java attribute, only a column in the db.
See:
http://db.apache.org/ojb/howto-use-anonymous-keys.html
cheers,
Thomas
Sebastien Cesbron wrote:
> Hi,
>
> I want to specify a relation between an object A (table T_A) and one
> object B (table T_B) with a foreignkey on the column idB of the table T_A.
> To do that I have to create an attribute idB in the class A and to put a
> <foreignkey field-ref="idB"/> in my <reference-descriptor> tag.
> Why it is not possible to act as in the "non decomposed m:n mapping" and
> specify a db column in stead of a class attribute.
> For example I would like to write <foreignkey column-ref="idB"/> where
> idB is a column of T_B. With this version, I don't have to put an
> artificial idB attribute in my class A.
>
> Is it something difficult to do or is it an implementation choice ?
>
> Thanx
>
> Seb
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org