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-relationship-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

Reply via email to