I change my mind and go to try ERXBatchingDisplayGroup with a qualifier I built (see below)
nom like $nom
or prenom like $prenom
or indivId = $numero
or etuInscrAdms.diplomec like $etuInscrAdms.diplomec
or (etuInscrAdms.anUniv like $etuInscrAdms.anUniv and etuInscrAdms.prdUniv like $etuInscrAdms.prdUniv)
or etuInscrAdms.niveauAdm = $etuInscrAdms.niveauAdm
or (etuInscrAdms.eoVueInsuvs.uvc = $etuInscrAdms.eoVueInsuvs.uvc
and etuInscrAdms.eoVueInsuvs.anUniv = $etuInscrAdms.eoVueInsuvs.anUniv
and etuInscrAdms.eoVueInsuvs.prdUniv = $etuInscrAdms.eoVueInsuvs.prdUniv)
In this qualifier to use with my ERXBatchingDisplayGroup
NSMutableArray qualFinal = new NSMutableArray();
NSMutableArray args = new NSMutableArray();
NSMutableArray argsUv = new NSMutableArray();
NSMutableArray argsEtu = new NSMutableArray();
args.addObject(anUniv);
args.addObject(prdUniv);
argsUvaddObject(uv);
argsUv.addObject(anUniv);
argsUv.addObject(prdUniv);
argsEtu.add("03");
argsEtu.add("UTT");
EOQualifier qualNom = EOQualifier.qualifierWithQualifierFormat("nom like %@", new NSArray(nom+"*"));
EOQualifier qualPrenom = EOQualifier.qualifierWithQualifierFormat("prenom like %@", new NSArray(prenom+"*"));
EOQualifier qualNumero = EOQualifier.qualifierWithQualifierFormat("individ=%@", new NSArray(nombre));
EOQualifier qualPeriode = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.anUniv=%@ AND etuInscrAdms.prdUniv=%@", args);
EOQualifier qualDiplome = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.diplomec=%@",new NSArray(diplome));
EOQualifier qualNiveau = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.niveauAdm=%@",new NSArray(niveau));
EOQualifier qualNiveau = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.niveauAdm=%@",new NSArray(niveau));
EOQualifier qualUv = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.eoVueInsuvs.anUniv=%@ AND etuInscrAdms.eoVueInsuvs.prdUniv=%@ AND etuInscrAdms.eoVueInsuvs.uvc=%@",argsUv);
EOQualifier qualEtudiant = EOQualifier.qualifierWithQualifierFormat("etuInscrAdms.diplSpecc<>%@ AND indEmails.emailTypec=%@",argsEtu);
qualFinal.addObject(qualNom);
qualFinal.addObject(qualPrenom);
qualFinal.addObject(qualNumero);
qualFinal.addObject(qualPeriode);
qualFinal.addObject(qualDiplome);
qualFinal.addObject(qualNiveau);
qualFinal.addObject(qualUv);
**EOSort
NSArray dgSort = new NSArray(new Object[] {EOSortOrdering.sortOrderingWithKey(EOIndividu.NOM_KEY, EOSortOrdering.CompareAscending),
EOSortOrdering.sortOrderingWithKey(EOIndividu.PRENOM_KEY,EOSortOrdering.CompareAscending) });
fetchEtudiantViaUvDg.setQualifier(new EOOrQualifier(qualFinal));
fetchEtudiantViaUvDg.setSortOrderings(dgSort);
fetchEtudiantViaUvDg.fetch();
Here is result :
45478 [WorkerThread0] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "select count(*) FROM GERRY.INDIVIDU t0, GEST_UV.VUE_INSUV T2, GERRY.IND_EMAIL T3, GERRY.ETU_INSCR_ADM T1 WHERE ((T1.AN_UNIV = ? AND T1.PRD_UNIV = ?) OR T1.DIPLOME_$C = ? OR T1.NIVEAU_ADM = ? OR (T2.AN_UNIV = ? AND T2.PRD_UNIV = ? AND T2.UV_$C = ?) OR (T1.DIPL_SPEC_$C <> ? AND T3.EMAIL_TYPE_$C = ?)) AND T1.AN_UNIV = T2.AN_UNIV AND T1.DIPLOME_$C = T2.DIPLOME_$C AND T1.ETU_ID = T2.ETU_ID AND T1.PRD_UNIV = T2.PRD_UNIV AND t0.INDIV_ID = T3.INDIV_ID AND t0.INDIV_ID = T1.CONSEILLER_ID" withBindings: 1:"2010"(anUniv), 2:"1A"(prdUniv), 3:"ING2"(diplomec), 4:"4"(niveauAdm), 5:"2010"(anUniv), 6:"1A"(prdUniv), 7:"11420"(uvc), 8:"03"(diplSpecc), 9:"UTT"(emailTypec)>
47102 [WorkerThread0] DEBUG NSLog - 1 row(s) processed //All students
47132 [WorkerThread0] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "select * from (select INDIV_ID, rownum eo_rownum from (SELECT t0.INDIV_ID FROM GERRY.INDIVIDU t0, GEST_UV.VUE_INSUV T2, GERRY.IND_EMAIL T3, GERRY.ETU_INSCR_ADM T1 WHERE ((T1.AN_UNIV = ? AND T1.PRD_UNIV = ?) OR T1.DIPLOME_$C = ? OR T1.NIVEAU_ADM = ? OR (T2.AN_UNIV = ? AND T2.PRD_UNIV = ? AND T2.UV_$C = ?) OR (T1.DIPL_SPEC_$C <> ? AND T3.EMAIL_TYPE_$C = ?)) AND T1.AN_UNIV = T2.AN_UNIV AND T1.DIPLOME_$C = T2.DIPLOME_$C AND T1.ETU_ID = T2.ETU_ID AND T1.PRD_UNIV = T2.PRD_UNIV AND t0.INDIV_ID = T3.INDIV_ID AND t0.INDIV_ID = T1.CONSEILLER_ID ORDER BY UPPER(t0.NOM) ASC, UPPER(t0.PRENOM) ASC)) where eo_rownum between 1 and 10" withBindings: 1:"2010"(anUniv), 2:"1A"(prdUniv), 3:"ING2"(diplomec), 4:"4"(niveauAdm), 5:"2010"(anUniv), 6:"1A"(prdUniv), 7:"11420"(uvc), 8:"03"(diplSpecc), 9:"UTT"(emailTypec)>
50212 [WorkerThread0] DEBUG NSLog - 10 row(s) processed //10 students per batch(don't use distinct)
My problem is this fetch don't use *disctinct* and I have several time the same student. The another problem is how to set qualifier to do natural join like :