After looking again your code sample, I see that you have already created in the correct way a list of PredicateS: you have called it criteria. You are only using them in the wrong way. See the last line of my first example.

EDIT 2

In order to see if the problem is generated by the use of PredicateExpressionS, that are not specifically needed in your case, try to temporarily remove them. Modify your first criteria from

Thanks for your input Perissf. Can you please tell me the type and value for the value variable? Regards.
–
balteoSep 3 '12 at 9:41

That was just pseudo-code. You can use your Predicates instead. You will probably not use the loop but the concept is valid anyway for your if clauses. Hope it's clear.
–
perissfSep 3 '12 at 9:43

The behavior of my test is the same after using the last line of your code i.e. c.where(criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]))); Any other idea?
–
balteoSep 3 '12 at 9:55

I've altered the code as advised in your second edit as well as commented out the following line: q.setParameter("identifiant", "%" + identifiant + "%"); It makes no difference unfortunately...
–
balteoSep 3 '12 at 10:16