[Mapping]Encore un problème
je vais essayer d'être clair
j'ai 4 tables client,contact_client,historique,langue
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| table client(
clientid;
historiqueid;
...
)
table historique(
historiqueid;
...
)
table langue(
langueid;
..
)
table langue_client(
clientid;
langueid;
)
//table d'association client vers client contient la liste des contacts pour 1 client
table contact_client(
clientid;
contact_clientid;
) |
voici la bean client
Code:
1 2 3 4 5 6
| public class ClientBean(){
private int clientid;
...
private HistoriqueBean historique = new HistoriqueBean();
private Set contacts = new HashSet();
private Set langues = new HashSet(); |
pour les fichiers de configuration langue,historique, c'est classique le problème reside dans le mapping de la classe client voici un extrait
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<class name="com.myapp.ClientBean" table="client">
..
<many-to-one name="historique" column="historiqueid" not-null="false"/>
<set name="contacts" table="contact_client">
<key column="clientid" on-delete="cascade"/>
<many-to-many column="clientid" class="ClientBean"/>
</set>
<set name="langues" table="langue_client">
<key column="clientid" on-delete="cascade"/>
<many-to-many column="langueid" class="LangueBean"/>
</set> |
voici le message erreur
Code:
Caused by: org.hibernate.MappingException: An association from the table contact_client refers to an unmapped class: ClientBean
la table client est bien mappée pcq j'arrive à faire des opération ajout,modif,suppression, mais seulement quand j'ajoute les associations avec d'autres tables ça pose problème quelqu'un voit quelque chose?