1
2
3
4
5
6 package com.hack23.cia.service.dao;
7
8 import java.util.List;
9
10 import com.hack23.cia.model.application.impl.common.AbstractActionEvent;
11
12 /***
13 * The Class EventDAOImpl.
14 */
15 public class EventDAOImpl extends
16 GenericHibernateDAO<AbstractActionEvent, Long> implements EventDAO {
17
18 /***
19 * Instantiates a new event dao impl.
20 */
21 public EventDAOImpl() {
22 super(AbstractActionEvent.class);
23 }
24
25
26
27
28
29
30 @SuppressWarnings("unchecked")
31 @Override
32 public final List getActionEventHistory() {
33 return this
34 .getHibernateTemplate()
35 .find(
36 "select hour(event.createdDate),count(*) from AbstractActionEvent event group by hour(createdDate)");
37 }
38
39
40
41
42
43
44 @Override
45 @SuppressWarnings("unchecked")
46 public final List getResponseTimeHistory() {
47 return this
48 .getHibernateTemplate()
49 .find(
50 "select hour(event.createdDate),avg(event.executionTime),min(event.executionTime),max(event.executionTime) from AbstractActionEvent event group by hour(createdDate)");
51 }
52
53 }