Hi,
I’ve a problem with foreign keys:
I have a table Resources like this : rid (pk) – cid – rname
I’have to create another table like this : did (pk) – dep- rid1 (fk) -rid2(fk)
I have 2 EJB-CMP : ResourcesBean and DepBean for the first and the second table. In ResourceBean I have getRid() and setRid().
In the DepBean I have to use setRid1() and setRid2().
For getter and setter rid1 I have :
/**
* @ejb.relation
* name=”did-rid1″
* role-name=”dep-has-rid1″
* target-ejb = “Resource”
*
* @jboss.relation related-pk-field = “rid”
* fk-column = “rid1″
*
*
*
*/
public abstract ResourceLocal getRid1();
public abstract void setRid1(ResourceLocal c);
…and for rid2 ???
I can’t use :
/**
* @ejb.relation
* name=”did-rid1″
* role-name=”dep-has-rid1”
* target-ejb = “Resource”
*
* @jboss.relation related-pk-field = “rid”
* fk-column = “rid2”
*
*
*
*/
public abstract ResourceLocal getRid2();
public abstract void setRid2(ResourceLocal c);
….beacuse there is the same role-name and the same name…..
What is the solution…..I tried a lot of tricks but I’m not able to resolve this problem….
Thank you very much for the answer !!