1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.rice.kew.docsearch.dao.impl; |
17 |
|
|
18 |
|
import java.math.BigDecimal; |
19 |
|
import java.sql.Timestamp; |
20 |
|
import java.util.ArrayList; |
21 |
|
import java.util.Collection; |
22 |
|
import java.util.List; |
23 |
|
|
24 |
|
import org.apache.ojb.broker.query.Criteria; |
25 |
|
import org.apache.ojb.broker.query.QueryByCriteria; |
26 |
|
import org.kuali.rice.kew.docsearch.SearchableAttributeDateTimeValue; |
27 |
|
import org.kuali.rice.kew.docsearch.SearchableAttributeFloatValue; |
28 |
|
import org.kuali.rice.kew.docsearch.SearchableAttributeLongValue; |
29 |
|
import org.kuali.rice.kew.docsearch.SearchableAttributeStringValue; |
30 |
|
import org.kuali.rice.kew.docsearch.dao.SearchableAttributeDAO; |
31 |
|
import org.springmodules.orm.ojb.support.PersistenceBrokerDaoSupport; |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
|
38 |
|
|
|
|
| 0% |
Uncovered Elements: 52 (52) |
Complexity: 12 |
Complexity Density: 0.3 |
|
39 |
|
public class SearchableAttributeDAOOjbImpl extends PersistenceBrokerDaoSupport implements SearchableAttributeDAO { |
40 |
|
|
41 |
|
public static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(SearchableAttributeDAOOjbImpl.class); |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
@see |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
48 |
0
|
public List<Timestamp> getSearchableAttributeDateTimeValuesByKey(... |
49 |
|
Long documentId, String key) { |
50 |
|
|
51 |
0
|
List<Timestamp> lRet = null; |
52 |
|
|
53 |
0
|
Criteria crit = new Criteria(); |
54 |
0
|
crit.addEqualTo("routeHeaderId", documentId); |
55 |
0
|
crit.addEqualTo("searchableAttributeKey", key); |
56 |
0
|
Collection<SearchableAttributeDateTimeValue> collection = getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(SearchableAttributeDateTimeValue.class, crit)); |
57 |
|
|
58 |
0
|
if(collection != null && !collection.isEmpty()){ |
59 |
0
|
lRet = new ArrayList<Timestamp>(); |
60 |
0
|
for(SearchableAttributeDateTimeValue value:collection){ |
61 |
0
|
lRet.add(value.getSearchableAttributeValue()); |
62 |
|
} |
63 |
|
} |
64 |
|
|
65 |
0
|
return lRet; |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
@see |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
73 |
0
|
public List<BigDecimal> getSearchableAttributeFloatValuesByKey(... |
74 |
|
Long documentId, String key) { |
75 |
0
|
List<BigDecimal> lRet = null; |
76 |
|
|
77 |
0
|
Criteria crit = new Criteria(); |
78 |
0
|
crit.addEqualTo("routeHeaderId", documentId); |
79 |
0
|
crit.addEqualTo("searchableAttributeKey", key); |
80 |
0
|
Collection<SearchableAttributeFloatValue> collection = getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(SearchableAttributeFloatValue.class, crit)); |
81 |
|
|
82 |
0
|
if(collection != null && !collection.isEmpty()){ |
83 |
0
|
lRet = new ArrayList<BigDecimal>(); |
84 |
0
|
for(SearchableAttributeFloatValue value:collection){ |
85 |
0
|
lRet.add(value.getSearchableAttributeValue()); |
86 |
|
} |
87 |
|
} |
88 |
|
|
89 |
0
|
return lRet; |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@see |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
97 |
0
|
public List<String> getSearchableAttributeStringValuesByKey(... |
98 |
|
Long documentId, String key) { |
99 |
|
|
100 |
0
|
List<String> lRet = null; |
101 |
|
|
102 |
0
|
Criteria crit = new Criteria(); |
103 |
0
|
crit.addEqualTo("routeHeaderId", documentId); |
104 |
0
|
crit.addEqualTo("searchableAttributeKey", key); |
105 |
0
|
Collection<SearchableAttributeStringValue> collection = getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(SearchableAttributeStringValue.class, crit)); |
106 |
|
|
107 |
0
|
if(collection != null && !collection.isEmpty()){ |
108 |
0
|
lRet = new ArrayList<String>(); |
109 |
0
|
for(SearchableAttributeStringValue value:collection){ |
110 |
0
|
lRet.add(value.getSearchableAttributeValue()); |
111 |
|
} |
112 |
|
} |
113 |
|
|
114 |
0
|
return lRet; |
115 |
|
} |
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
@see |
121 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
122 |
0
|
public List<Long> getSearchableAttributeLongValuesByKey(Long documentId,... |
123 |
|
String key) { |
124 |
0
|
List<Long> lRet = null; |
125 |
|
|
126 |
0
|
Criteria crit = new Criteria(); |
127 |
0
|
crit.addEqualTo("routeHeaderId", documentId); |
128 |
0
|
crit.addEqualTo("searchableAttributeKey", key); |
129 |
0
|
Collection<SearchableAttributeLongValue> collection = getPersistenceBrokerTemplate().getCollectionByQuery(new QueryByCriteria(SearchableAttributeLongValue.class, crit)); |
130 |
|
|
131 |
0
|
if(collection != null && !collection.isEmpty()){ |
132 |
0
|
lRet = new ArrayList<Long>(); |
133 |
0
|
for(SearchableAttributeLongValue value:collection){ |
134 |
0
|
lRet.add(value.getSearchableAttributeValue()); |
135 |
|
} |
136 |
|
} |
137 |
|
|
138 |
0
|
return lRet; |
139 |
|
} |
140 |
|
|
141 |
|
} |