Rev 1408 | Rev 1425 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1408 | Rev 1409 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | import pt.estgp.estgweb.domain.QuestionarioResposta; |
12 | import pt.estgp.estgweb.domain.QuestionarioResposta; |
13 | import pt.estgp.estgweb.domain.QuestionarioRespostaRequisitada; |
13 | import pt.estgp.estgweb.domain.QuestionarioRespostaRequisitada; |
14 | 14 | ||
15 | import java.util.List; |
15 | import java.util.List; |
16 | 16 | ||
17 | import static org.hibernate.criterion.Restrictions.eq; |
17 | import static org.hibernate.criterion.Restrictions.*; |
18 | 18 | ||
19 | /** |
19 | /** |
20 | * @author Jorge Machado |
20 | * @author Jorge Machado |
21 | * @date 28/Fev/2008 |
21 | * @date 28/Fev/2008 |
22 | * @time 2:51:06 |
22 | * @time 2:51:06 |
Line 63... | Line 63... | ||
63 | return criteria.list(); |
63 | return criteria.list(); |
64 | } |
64 | } |
65 | catch (HibernateException e) |
65 | catch (HibernateException e) |
66 | { |
66 | { |
67 | throw new DaoException(e); |
67 | throw new DaoException(e); |
- | 68 | } |
|
- | 69 | } |
|
- | 70 | ||
- | 71 | public List<QuestionarioImpl> findProcessing() |
|
- | 72 | { |
|
- | 73 | try |
|
- | 74 | { |
|
- | 75 | Criteria criteria = createCriteria(); |
|
- | 76 | criteria.add(or(eq("state",QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.PROCESSING.name()),eq("state",QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.PROCESSING_WITH_ANSWERS.name()))); |
|
- | 77 | return criteria.list(); |
|
- | 78 | } |
|
- | 79 | catch (HibernateException e) |
|
- | 80 | { |
|
- | 81 | throw new DaoException(e); |
|
- | 82 | } |
|
- | 83 | } |
|
- | 84 | ||
- | 85 | public List<QuestionarioImpl> findNotClosed() |
|
- | 86 | { |
|
- | 87 | try |
|
- | 88 | { |
|
- | 89 | Criteria criteria = createCriteria(); |
|
- | 90 | criteria.add(not(or(or(eq("state",QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.CLOSED.name()),eq("state",QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.PROCESSING_OLAP.name())), |
|
- | 91 | eq("state",QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.OLAP.name())))) |
|
- | 92 | .addOrder(Order.desc("id")); |
|
- | 93 | return criteria.list(); |
|
- | 94 | } |
|
- | 95 | catch (HibernateException e) |
|
- | 96 | { |
|
- | 97 | throw new DaoException(e); |
|
68 | } |
98 | } |
69 | } |
99 | } |
70 | 100 | ||
71 | 101 | ||
72 | public long getNumeroRespostas(long questionarioId) |
102 | public long getNumeroRespostas(long questionarioId) |