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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
public List selectSousSections(String refSection)
{
List sections = null;
int niveau = refSection.length();
String requete = "";
if (niveau==1){
requete = "select new com.bull.crnpc.analytique.Section(s.CodeSectionNiv3,s.LibelleSectionNiv3)" +
" from TeSections s" +
" where s.CodeSectionNiv4='" + refSection + "' order by s.LibelleSectionNiv3 asc" +
" group by s.CodeSectionNiv3";
}
else if (niveau==2){
requete = "select new com.bull.crnpc.analytique.Section(s.CodeSectionNiv2,s.LibelleSectionNiv2)" +
" from TeSections s" +
" where s.CodeSectionNiv3='" + refSection + "' order by s.LibelleSectionNiv2 asc" +
" group by s.CodeSectionNiv2";
}
else if (niveau==3){
requete = "select new com.bull.crnpc.analytique.Section(s.CodeSectionNiv1,s.LibelleSectionNiv1)" +
" from TeSections s" +
" where s.CodeSectionNiv2='" + refSection + "' order by s.LibelleSectionNiv1 asc" +
" group by s.CodeSectionNiv1";
}
else if (niveau==4)
{
requete = "select new com.bull.crnpc.analytique.Section(s.CodeSection,s.LibelleSection)" +
" from TeSections s" +
" where s.CodeSectionNiv1='" + refSection + "' order by s.LibelleSection asc";
}
try {
com.bull.crnpc.hibernate.dao._RootDAO.initialize();
sections = find(requete);
}
catch (HibernateException e) {
//TODO logger
}
return sections;
} |