1 package org.itracker.persistence.dao;
2
3 import org.apache.log4j.Logger;
4 import org.hibernate.Criteria;
5 import org.hibernate.HibernateException;
6 import org.itracker.model.WorkflowScript;
7
8 import java.util.List;
9
10
11
12
13 public class WorkflowScriptDAOImpl extends BaseHibernateDAOImpl<WorkflowScript>
14 implements WorkflowScriptDAO {
15
16 private static final Logger log = Logger.getLogger(WorkflowScript.class);
17
18
19
20
21
22
23
24 public WorkflowScript findByPrimaryKey(Integer id) {
25 try {
26 WorkflowScriptcker/model/WorkflowScript.html#WorkflowScript">WorkflowScript workflowScriptBean = (WorkflowScript) getSession().get(WorkflowScript.class, id);
27 return workflowScriptBean;
28 } catch (HibernateException ex) {
29 log.error("findByPrimaryKey: failed with hibernate exception", ex);
30 throw convertHibernateAccessException(ex);
31 }
32 }
33
34
35
36
37
38
39 @SuppressWarnings("unchecked")
40 public List<WorkflowScript> findAll() {
41 Criteria criteria = getSession().createCriteria(WorkflowScript.class);
42 try {
43 return criteria.list();
44 } catch (HibernateException e) {
45 throw convertHibernateAccessException(e);
46 }
47 }
48
49 }