1
2
3
4
5
6 package com.hack23.cia.service.dao;
7
8 import java.util.Collection;
9 import java.util.List;
10
11 import com.hack23.cia.model.sweden.impl.ParliamentMember;
12 import com.hack23.cia.model.sweden.impl.ParliamentMemberVoteCompareResult;
13 import com.hack23.cia.model.sweden.impl.Vote;
14
15 /***
16 * The Interface ParliamentMemberDAO.
17 */
18 public interface ParliamentMemberDAO extends GenericDAO<ParliamentMember, Long> {
19
20 /***
21 * Delete all parliament member vote compare results.
22 */
23 void deleteAllParliamentMemberVoteCompareResults();
24
25 /***
26 * Find last votes.
27 *
28 * @param id the id
29 * @return the list
30 */
31 List<Vote> findLastVotes(Long id);
32
33 /***
34 * Find last votes by ballot id.
35 *
36 * @param id the id
37 * @return the list
38 */
39 List<Vote> findLastVotesByBallotId(final Long id);
40
41 /***
42 * Find list by name.
43 *
44 * @param searchString the search string
45 * @return the list
46 */
47 List<ParliamentMember> findListByName(String searchString);
48
49 /***
50 * Find votes.
51 *
52 * @param id the id
53 * @return the list
54 */
55 List<Vote> findVotes(Long id);
56
57 /***
58 * Gets the current list.
59 *
60 * @return the current list
61 */
62 List<ParliamentMember> getCurrentList();
63
64 /***
65 * Gets the current top list absent.
66 *
67 * @param number the number
68 * @return the current top list absent
69 */
70 List<ParliamentMember> getCurrentTopListAbsent(int number);
71
72 /***
73 * Gets the current top list absent by party.
74 *
75 * @param i the i
76 * @param party the party
77 * @return the current top list absent by party
78 */
79 List<ParliamentMember> getCurrentTopListAbsentByParty(int i, String party);
80
81 /***
82 * Gets the current top list losers.
83 *
84 * @param i the i
85 * @return the current top list losers
86 */
87 List<ParliamentMember> getCurrentTopListLosers(int i);
88
89 /***
90 * Gets the current top list losers by party.
91 *
92 * @param i the i
93 * @param party the party
94 * @return the current top list losers by party
95 */
96 List<ParliamentMember> getCurrentTopListLosersByParty(int i, String party);
97
98 /***
99 * Gets the current top list loyal.
100 *
101 * @param i the i
102 * @return the current top list loyal
103 */
104 List<ParliamentMember> getCurrentTopListLoyal(int i);
105
106 /***
107 * Gets the current top list loyal by party.
108 *
109 * @param i the i
110 * @param party the party
111 * @return the current top list loyal by party
112 */
113 List<ParliamentMember> getCurrentTopListLoyalByParty(int i, String party);
114
115 /***
116 * Gets the current top list present.
117 *
118 * @param i the i
119 * @return the current top list present
120 */
121 List<ParliamentMember> getCurrentTopListPresent(int i);
122
123 /***
124 * Gets the current top list present by party.
125 *
126 * @param i the i
127 * @param party the party
128 * @return the current top list present by party
129 */
130 List<ParliamentMember> getCurrentTopListPresentByParty(int i, String party);
131
132 /***
133 * Gets the current top list rebels.
134 *
135 * @param i the i
136 * @return the current top list rebels
137 */
138 List<ParliamentMember> getCurrentTopListRebels(int i);
139
140 /***
141 * Gets the current top list rebels by party.
142 *
143 * @param i the i
144 * @param party the party
145 * @return the current top list rebels by party
146 */
147 List<ParliamentMember> getCurrentTopListRebelsByParty(int i, String party);
148
149 /***
150 * Gets the current top list winners.
151 *
152 * @param i the i
153 * @return the current top list winners
154 */
155 List<ParliamentMember> getCurrentTopListWinners(int i);
156
157 /***
158 * Gets the current top list winners by party.
159 *
160 * @param i the i
161 * @param party the party
162 * @return the current top list winners by party
163 */
164 List<ParliamentMember> getCurrentTopListWinnersByParty(int i, String party);
165
166 /***
167 * Gets the positions.
168 *
169 * @param parliamentMember the parliament member
170 * @return the positions
171 */
172 List<Vote.Position> getPositions(ParliamentMember parliamentMember);
173
174 /***
175 * Gets the top enemies.
176 *
177 * @param parliamentMember the parliament member
178 * @return the top enemies
179 */
180 List<ParliamentMemberVoteCompareResult> getTopEnemies(
181 ParliamentMember parliamentMember);
182
183 /***
184 * Gets the top enemies same party.
185 *
186 * @param parliamentMember the parliament member
187 * @return the top enemies same party
188 */
189 List<ParliamentMemberVoteCompareResult> getTopEnemiesSameParty(
190 ParliamentMember parliamentMember);
191
192 /***
193 * Gets the top friends.
194 *
195 * @param parliamentMember the parliament member
196 * @return the top friends
197 */
198 List<ParliamentMemberVoteCompareResult> getTopFriends(
199 ParliamentMember parliamentMember);
200
201 /***
202 * Gets the top friends in same party.
203 *
204 * @param parliamentMember the parliament member
205 * @return the top friends in same party
206 */
207 List<ParliamentMemberVoteCompareResult> getTopFriendsInSameParty(
208 ParliamentMember parliamentMember);
209
210 /***
211 * Save all.
212 *
213 * @param list the list
214 */
215 void saveAll(Collection<ParliamentMember> list);
216
217 /***
218 * Save parliament member vote compare result.
219 *
220 * @param result the result
221 */
222 void saveParliamentMemberVoteCompareResult(
223 Collection<ParliamentMemberVoteCompareResult> result);
224 }