J ai dans mon entité Affaire une collection de communes qui elle possède un district

je créer donc des Criteria de cette manière

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
	private Criteria createCriteriaForCommune(Criteria criteria, Commune commune, YaminaDistrict district) {
		Criteria manyToMany = criteria.createCriteria("communes");
		if (commune.getLibelleDe() != null && commune.getLibelleDe().length() > 0)
			manyToMany.add(Expression.like("libelleDe", "%" +commune.getLibelleDe() + "%"));
 
		if (commune.getLibelleFr() != null && commune.getLibelleFr().length() > 0) {
			manyToMany.add(Expression.like("libelleFr", "%" +commune.getLibelleFr() +"%"));	
		}
		if (commune.getNumeroOFS() > 0) {
			manyToMany.add(Expression.eq("numeroOFS", commune.getNumeroOFS()));
		}
		if (district.getId() > 0) {
			manyToMany.add(Expression.eq("district.id", district.getId()));
		}
		if (district.getLibelleFr()!= null && district.getLibelleFr().length() > 0) {
			Criteria districtCriteria= manyToMany.createCriteria("district");
			districtCriteria.add(Expression.like("libelleFr", "%" + district.getLibelleFr()) + "%");
		}
		return criteria;
cependant j'obtiens une liste vide ... dois je ajouter moi meme un join ?
(je précise une valeur pour le libelleFr)
d avance merci