1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package ch.elca.el4j.tests.services.persistence.generic.dao;
19
20 import java.lang.reflect.ParameterizedType;
21 import java.util.Collection;
22 import java.util.List;
23
24 import org.springframework.dao.DataAccessException;
25 import org.springframework.dao.DataIntegrityViolationException;
26 import org.springframework.dao.DataRetrievalFailureException;
27 import org.springframework.dao.OptimisticLockingFailureException;
28
29 import ch.elca.el4j.services.persistence.generic.dao.GenericDao;
30 import ch.elca.el4j.services.search.QueryObject;
31
32
33
34
35
36
37
38
39
40 public class DummyDao<T> implements GenericDao<T>{
41
42 private Class<T> m_persistentClass;
43
44 @SuppressWarnings("unchecked")
45 public DummyDao() {
46 this.m_persistentClass = (Class<T>) ((ParameterizedType) getClass()
47 .getGenericSuperclass()).getActualTypeArguments()[0];
48 }
49
50 public void delete(Collection<T> entities)
51 throws OptimisticLockingFailureException, DataAccessException {
52 }
53
54 public List<T> findByQuery(QueryObject q) throws DataAccessException {
55 return null;
56 }
57
58 public int findCountByQuery(QueryObject query) throws DataAccessException {
59 return 0;
60 }
61
62 public List<T> getAll() throws DataAccessException {
63 return null;
64 }
65
66 public Class<T> getPersistentClass() {
67 return m_persistentClass;
68 }
69
70 public void setPersistentClass(Class<T> c) {
71 m_persistentClass = c;
72 }
73
74 public T refresh(T entity) throws DataAccessException,
75 DataRetrievalFailureException {
76 return null;
77 }
78
79 public T saveOrUpdate(T entity) throws DataAccessException,
80 DataIntegrityViolationException, OptimisticLockingFailureException {
81 return null;
82 }
83
84 public T reload(T entity) throws DataAccessException, DataRetrievalFailureException {
85 return null;
86 }
87
88 }