The first one is definitely wrong, but the second should work. Try it 
again and make sure the jar is correctly updated (common problem).  If 
it doesn't go away, post a *simple* bug report with a test case at 
sourceforge.net.

-dain

Ingo Bruell wrote:

> Hi,
> 
> i am using JBoss3.0.0RC1, J2SDK1.4 on Windows 2000 and try to use relations.
> 
> I have the following beans:
> 
> person (PK: mandant, number, type) and some attributes
> employee (PK: mandant, number) type as attribute and others.
> 
> In this case i want to use one-to-one unidirectional relation.
> 
> In the standard way JBoss generates additional columns in employee
> called person_mandant_id, person_number_id and person_type_id.
> 
> But i won't that, because the attributes always exist and could be
> reused.
> 
> if i use in jbosscmp-jdbc.xml:
> 
> ---
>     <ejb-relation>
>       <ejb-relation-name>EmployeePerson</ejb-relation-name>
>       <foreign-key-mapping/>
>       <ejb-relationship-role>
>           <ejb-relationship-role-name>employee-is-person</ejb-relationship-role-name>
>           <key-fields>
>              <key-field>
>                <field-name>mandant</field-name>
>                <column-name>mandant</column-name>
>              </key-field>
>              <key-field>
>                <field-name>number</field-name>
>                <column-name>number</column-name>
>              </key-field>
>              <key-field>
>                <field-name>type</field-name>
>                <column-name>type</column-name>
>              </key-field>
>           </key-fields>
>       </ejb-relationship-role>
>       <ejb-relationship-role>
>           <ejb-relationship-role-name>person-employee</ejb-relationship-role-name>
>           <key-fields/>
>       </ejb-relationship-role>
>     </ejb-relation>
> ---
> 
> JBoss throws the message:
> 
> ---
> org.jboss.deployment.DeploymentException: CMP field for key not found: field 
>name=type
>         at 
>org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRe
> lationshipRoleMetaData.java:374)
> ---
> 
> if i use this in jbosscmp-jdbc:
> 
> ---
>     <ejb-relation>
>       <ejb-relation-name>EmployeePerson</ejb-relation-name>
>       <foreign-key-mapping/>
>       <ejb-relationship-role>
>           <ejb-relationship-role-name>employee-is-person</ejb-relationship-role-name>
>           <key-fields/>
>       </ejb-relationship-role>
>       <ejb-relationship-role>
>           <ejb-relationship-role-name>person-employee</ejb-relationship-role-name>
>           <key-fields>
>              <key-field>
>                <field-name>mandant</field-name>
>                <column-name>mandant</column-name>
>              </key-field>
>              <key-field>
>                <field-name>number</field-name>
>                <column-name>number</column-name>
>              </key-field>
>              <key-field>
>                <field-name>type</field-name>
>                <column-name>type</column-name>
>              </key-field>
>           </key-fields>
>       </ejb-relationship-role>
>     </ejb-relation>
> ---
> 
> than jboss throws thiss error:
> 
> ---
> org.jboss.deployment.DeploymentException: CMP field for key not found: field 
>name=type
>         at 
>org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRe
> lationshipRoleMetaData.java:374)
> ---
> 
> What is the right way ?
> 
>     
> so long
> 
> 
> Ingo Bruell
> 
> ---
> <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]>
> <ICQ# 40377720>
> Oldenburg    PGP-Fingerprint: CB01 AE12 B359 87C4 BF1C  953C 8FE7 C648 169E E5FC
> Germany      PGP-Public-Key available at pgpkeys.mit.edu
> 
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to