for(int i=0; i<5; i++) {
IntervenantHelper ih = new IntervenantHelper();
ih.setNomep(i);
ih.setConventions(new ArrayList());
for(int j=0; j<i; j++) {
ConventionHelper ch = new ConventionHelper();
ch.setCdmec("cdmec" + i + "_" + j);
ch.setCdmem("cdmem" + i + "_" + j);
ch.setCdmed("cdmed" + i + "_" + j);
ch.setNomep(i);
ch.setIntervenant(ih);
ch.setDdmec(Calendar.getInstance().getTime());
ch.setCdmese("cdmese" + i + "_" + j);
ih.getConventions().add(ch);
}
pm.makePersistent(ih);
}
pm.currentTransaction().commit();