[XDoclet][JBoss] CMR - Many to Many Relation
Salut
Je cherche à faire le mapping d'une relation many-to-many avec une table relationnelle ayant un champ supplémentaire (en plus du couple de clefs correspondant aux tables jointes).
Pour l'instant, j'ai fait une jointure simple :
Coté Pile :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| /**
* @ejb.interface-method view-type="local"
*
* @jboss.relation-mapping style="relation-table"
* @jboss.relation-table table-name="t_Pile_Face"
* create-table="false"
* remove-table="false"
*
* @ejb.relation name="Pile-Face"
* role-name="Pile-has_many-Face"
* target-multiple="yes"
*
* @jboss.relation fk-column="k_Face"
* related-pk-field="id"
* fk-constraint="false"
*
* @return A Collection of Face
*/
public abstract Collection getFaces();
/**
* @ejb.interface-method view-type="local"
*
* @param faces A Collection of Face
*/
public abstract void setFaces(Collection faces); |
Coté Face :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
/**
* @ejb.interface-method view-type="local"
*
* @ejb.relation name="Pile-Face"
* role-name="Face-has_many-Pile"
* target-multiple="yes"
*
* @jboss.relation fk-column="k_Pile"
* related-pk-field="id"
* fk-constraint="false"
*
* @return A Collection of Pile
*/
public abstract Collection getPiles();
/**
* @ejb.interface-method view-type="local"
*
* @param piles A Collection of Pile
*/
public abstract void setPiles(Collection piles); |
Donc ma table de jointure est t_Pile_Face(k_Pile, k_Face)
Je voudrais obtenir quelque chose comme cela : t_Pile_Face(k_Pile, k_Face, k_Time) en relation "toute clef"
Est ce que cela est possible sans créer un autre Entity Bean CMP ?
Merci d'avance
merci pour plus d'informations
j'aimerais bien savoir des details de ce que tu as fait,car j'ai le meme probleme
merci d'avavce.