parenthesis « HQL « JPA Q&A





1. Problems with OR parenthesis in HQL    forum.hibernate.org

Hi all I have 2 date ranges startDate and endDate I need to write an HQL that covers 4 conditions: 1. The range between startDate and endDate. 2. A range that can start before the startDate and can finish after the endDate. 3. A range that can start before the startDate and finishes in range (between) the startDate and endDate 4. ...

2. Problem with parenthesis in HQL    forum.hibernate.org

Hi all, Here is my little problem. I try to make a request with HQL using AND and OR clause. Here is the HQL : Query query = session.createQuery(""from Planning where Utilisateur.Id = " + oUtilisateur.getId() + " AND ( (DateDebut >= '01/05/2008' AND DateDebut <= '31/05/2008') OR (DateFin >= '01/05/2008' AND DateFin <= '31/05/2008') ) ORDER BY DateDebut"") ; Problem ...