Directionality of a relationship has nothing to do with fk mappings. The
reason you are getting FKs in your address table is because you did not tell
the engine to not create them. Add the following to the
"Addr_has_no_idea_of_TestCust" role:
      <foreign-key-fields/>

-dain
> -----Original Message-----
> From: Dave Smith [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 17, 2002 1:08 PM
> To: [EMAIL PROTECTED]
> Subject: [JBoss-dev] More relationship stuff
> 
> 
> I've pulled the latest jboss head and I am testing a 1-1 uni 
> directional 
> relationship. The database tables are already created. So I have
> 
> create table test_cust (
> test_cust_id int PRIMARY KEY,
> billing_address_id int
> );
> 
> create table test_address (
> test_address_id int PRIMARY KEY,
> an_address varchar(50)
> );
> 
> So TestCust ..
> 
> TestCust {
> 
> AddressLocal getAddress();
> void setAddress(AddressLocal l);
> }
> 
> 
> jbosscmp-jdbc.xml
> 
> sniped ..
> 
> <ejb-relation>
> <ejb-relation-name>Uni_1_to_1</ejb-relation-name>
>   <foreign-key-mapping>
>    <ejb-relationship-role>
> <ejb-relationship-role-name>Cust_has_an_address</ejb-relations
> hip-role-name>
> <fk-constraint>true</fk-constraint>
> <foreign-key-fields>
>   <foreign-key-field>
>    <field-name>test_address_id</field-name>
>    <column-name>billing_address_id</column-name>
> </foreign-key-field>
> </foreign-key-fields>
> </ejb-relationship-role>
> 
> <ejb-relationship-role>
> <ejb-relationship-role-name>Addr_has_no_idea_of_TestCust</ejb-
> relationship-role-name>
>   </ejb-relationship-role>
>    </foreign-key-mapping>
>    </ejb-relation>
> 
> 
> So everything looks cool until it tries to add the address
> INSERT INTO test_address (test_address_id, an_address, 
> TestCust_address) 
> VALUES (?, ?, ?)
> 
> It looks like jboss is throwing in a CMR field even though it 
> is only a 
> 1-1 uni directional relationship.
> 
> Bug?
> 
> 
> 
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 

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

Reply via email to