Mapper table d'association many-to-many
Bonjour,
Mapper une table d'association many-to-many contenant 3 autres atributs3.
les 3 tables sont :
* absence ( code_a pk,libelle string)
* personnel(code_p pk,nom string,prenom string)
*absence_personnel
( ( code_a,code_p) pk, date_absence Date, duree int,motif sring)
absence.hbm.xml:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.gh.model">
<class name="Absence" table="absence">
<id name="code_a" column="CODE_A" type="java.lang.Integer">
<generator class="native"/>
</id>
<property name="libelle" column="LIBELLE" type="java.lang.String"/>
<set name="absences" table="absence_personnel">
<key column="CODE_A" />
<many-to-many column="MATRICULE_P" class="Personnel"/>
</set>
</class>
</hibernate-mapping> |
de meme pr personnel.hbm.xml
on a du mal a mapper la table d'association absence_personnel car elle contient des attributs propres a elle :(
Merci d'avance.