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 Marcelo Magno <mm...@blumar.com.br> on 2003/06/04 22:35:41 UTC
1 n Maps
Hi, I am having some misunderstandings on implementing 1,n mappings.
The mapping is this one, as follows right bellow. My doubt is in the collectin-descriptor: What is the field that I need to reference on the inverse-foreignkey?
This colection is a vector of EntidadeExternaPessoaContato, and this field _idPessoaContato does not seem right to me.
Can anyone point me what is the right way to think about this problem?
Best regards,
Marcelo Magno
<class-descriptor class="dom.EntidadeExterna" table="EntidadeExterna">
<field-descriptor name="_idEntidadeExterna" column="PkEntidadeExterna" jdbc-type="INTEGER"
primarykey="true" autoincrement="true" />
<field-descriptor name="_nome" column="Nome" jdbc-type="VARCHAR" />
<collection-descriptor name="_listaPessoaContato" element-class-ref="dom.EntidadeExternaPessoaContato"
auto-retrieve="true" auto-update="true">
<inverse-foreignkey field-ref="_idPessoaContato"/> <!-- from EntidadeExternaPessoaContato ???-->
</collection-descriptor>
</class-descriptor>
<class-descriptor class="dom.EntidadeExternaPessoaContato" table="EntidadeExternaPessoaContato">
<field-descriptor name="_idPessoaContato" column="PkEntidadeExternaPessoaContato" jdbc-type="INTEGER"
primarykey="true" autoincrement="true" />
<field-descriptor name="_nome" column="Nome" jdbc-type="VARCHAR" />
<field-descriptor name="_telefone" column="Telefone" jdbc-type="VARCHAR" />
<field-descriptor name="_email" column="Email" jdbc-type="VARCHAR" />
<field-descriptor name="_unidadeId" column="FkUnidade" jdbc-type="INTEGER" />
<reference-descriptor name="_unidade" class-ref="dom.Unidade" >
<foreignkey field-ref="_unidadeId"/>
</reference-descriptor>
</class-descriptor>