Hi All,
Please help me out, this is driving me insane.
I have made a 1-N relationship but for a strange reason the insert statement
in instrumentcodes has 2 times the FK. I think it is because I did something
wrong with my Xdoclet specification of relationships.
/** generated by Weblogic ejbc compiler **/
as[0] = "INSERT INTO INSTRUMENT_CODES (IC_UID, ROW_VERSION_NR,
CODE_ID, IC_TYP_CD, INS_UID_FK, INS_UID_FK) VALUES (?, ?, ?, ?, ?, ?)";
/** end generated by Weblogic ejbc compiler **/
I included the deploymentdescriptor of Weblogic at the bottom,
I want to put a relation 1*N bidirectional relationship
Fund -------* InstrumentCodes
Fund Bean
Start
/**
* Concrete entity bean that implements the Fund interface.
*
*
* @ejb.bean generate="true"
* name="Fund"
* type="CMP"
* view-type="local"
* local-jndi-name="com.capco.example.instruments.server.Fund"
* schema="Funds"
*
....
*
*/
/**
* @ejb.relation
* name="instrument-instrumentCodes"
* role-name="instrument-has-instrumentCodes"
* target-ejb="InstrumentCode"
* target-role-name="instrumentCode-belongs_to-Instrument"
* target-cascade-delete="no"
*
* @weblogic.target-column-map
* foreign-key-column="INS_UID"
*
*/
public abstract Collection getInstrumentCodes();
public abstract void setInstrumentCodes(Collection aInstrumentCodes);
InstrumentCodes bean
/**
* InstrumentCodes
*
* @ejb.bean generate="true"
* name="InstrumentCode"
* type="CMP"
* view-type="local"
* local-jndi-
name="com.capco.example.instruments.server.InstrumentCode"
* schema="InstrumentCode"
.....
/**
* @return
*
* @ejb.interface-method view-type="local"
* @ejb.relation
* name="instrumentCode-instrument"
* role-name="instrumentCode-refers_to-instrument"
* target-ejb="Fund"
* target-role-name="instrument-is_refered_by-instrumentCode"
* target-multiple="no"
* @weblogic.column-map
* foreign-key-column="INS_UID_FK"
*
*
*/
public abstract Fund getInstrument();
/**
*
*
** @ejb.interface-method view-type="local"
*/
public abstract void setInstrument(Fund aInstrument);
<weblogic-rdbms-relation>
<relation-name>instrumentCode-instrument</relation-name>
<weblogic-relationship-role>
<relationship-role-name>instrumentCode-refers_to-instrument</relationship-ro
le-name>
<relationship-role-map>
<column-map>
<foreign-key-column>INS_UID_FK</foreign-key-column>
<key-column>INS_UID</key-column>
</column-map>
</relationship-role-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
<weblogic-rdbms-relation>
<relation-name>instrument-instrumentCodes</relation-name>
<weblogic-relationship-role>
<relationship-role-name>instrumentCode-belongs_to-Instrument</relationship-r
ole-name>
<relationship-role-map>
<column-map>
<foreign-key-column>INS_UID_FK</foreign-key-column>
<key-column>INS_UID</key-column>
</column-map>
</relationship-role-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
Jan Casteels
Tel : +32497518897
www.capco.com
************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, please notify the sender of this email
immediately. You should not copy, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.
http://www.capco.com
***********************************************************************