Rev 1538 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
995 | jmachado | 1 | package pt.estgp.estgweb.domain.dao.impl; |
2 | |||
1538 | jmachado | 3 | import jomm.dao.DaoException; |
4 | import org.hibernate.HibernateException; |
||
5 | import org.hibernate.criterion.Order; |
||
6 | import pt.estgp.estgweb.domain.JobServiceTaskScheduler; |
||
7 | |||
8 | import java.util.List; |
||
9 | |||
1791 | jmachado | 10 | import static org.hibernate.criterion.Restrictions.eq; |
11 | |||
995 | jmachado | 12 | /** |
13 | * @author Jorge Machado |
||
14 | * @date 28/Fev/2008 |
||
15 | * @time 2:51:06 |
||
16 | * @see pt.estgp.estgweb.domain.dao.impl |
||
17 | */ |
||
18 | public class JobServiceTaskSchedulerDaoImpl extends JobServiceTaskSchedulerDao |
||
19 | { |
||
20 | public static JobServiceTaskSchedulerDaoImpl getInstance() |
||
21 | { |
||
22 | if (myInstance == null) |
||
23 | myInstance = new JobServiceTaskSchedulerDaoImpl(); |
||
24 | return (JobServiceTaskSchedulerDaoImpl) myInstance; |
||
25 | } |
||
26 | |||
27 | |||
1538 | jmachado | 28 | public List<JobServiceTaskScheduler> findAllOrderByDescription() |
29 | { |
||
30 | try |
||
31 | { |
||
32 | return createCriteria().addOrder(Order.asc("description")).list(); |
||
33 | } |
||
34 | catch (HibernateException e) |
||
35 | { |
||
36 | throw new DaoException(e); |
||
37 | } |
||
38 | } |
||
995 | jmachado | 39 | |
1791 | jmachado | 40 | public List<JobServiceTaskScheduler> findFilteredByClassService(1.5.0/docs/api/java/lang/String.html">String classTarget) |
41 | { |
||
42 | try |
||
43 | { |
||
44 | return createCriteria(). |
||
45 | add(eq("targetService",classTarget)) |
||
46 | .addOrder(Order.asc("description")).list(); |
||
47 | } |
||
48 | catch (HibernateException e) |
||
49 | { |
||
50 | throw new DaoException(e); |
||
51 | } |
||
52 | } |
||
995 | jmachado | 53 | |
1538 | jmachado | 54 | |
1791 | jmachado | 55 | |
995 | jmachado | 56 | } |