|
@@ -0,0 +1,307 @@
|
|
1
|
+import com.j256.ormlite.dao.*;
|
|
2
|
+import com.j256.ormlite.field.DataType;
|
|
3
|
+import com.j256.ormlite.field.FieldType;
|
|
4
|
+import com.j256.ormlite.stmt.*;
|
|
5
|
+import com.j256.ormlite.support.ConnectionSource;
|
|
6
|
+import com.j256.ormlite.support.DatabaseConnection;
|
|
7
|
+import com.j256.ormlite.support.DatabaseResults;
|
|
8
|
+import com.j256.ormlite.table.ObjectFactory;
|
|
9
|
+
|
|
10
|
+import java.sql.SQLException;
|
|
11
|
+import java.util.ArrayList;
|
|
12
|
+import java.util.Collection;
|
|
13
|
+import java.util.List;
|
|
14
|
+import java.util.Map;
|
|
15
|
+import java.util.concurrent.Callable;
|
|
16
|
+
|
|
17
|
+public class MockDao implements Dao<Account, Integer> {
|
|
18
|
+ Account account = new Account();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+ public Account queryForId(Integer integer) throws SQLException {
|
|
22
|
+ return null;
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ public Account queryForFirst(PreparedQuery<Account> preparedQuery) throws SQLException {
|
|
26
|
+ return null;
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ public List<Account> queryForAll() throws SQLException {
|
|
30
|
+ List<Account> accounts = new ArrayList<Account>();
|
|
31
|
+ account.setName("xyz");
|
|
32
|
+ account.setPassword("raw");
|
|
33
|
+ return accounts;
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ public List<Account> queryForEq(String s, Object o) throws SQLException {
|
|
37
|
+ return null;
|
|
38
|
+ }
|
|
39
|
+
|
|
40
|
+ public List<Account> queryForMatching(Account account) throws SQLException {
|
|
41
|
+ return null;
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ public List<Account> queryForMatchingArgs(Account account) throws SQLException {
|
|
45
|
+ return null;
|
|
46
|
+ }
|
|
47
|
+
|
|
48
|
+ public List<Account> queryForFieldValues(Map<String, Object> map) throws SQLException {
|
|
49
|
+ return null;
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+ public List<Account> queryForFieldValuesArgs(Map<String, Object> map) throws SQLException {
|
|
53
|
+ return null;
|
|
54
|
+ }
|
|
55
|
+
|
|
56
|
+ public Account queryForSameId(Account account) throws SQLException {
|
|
57
|
+ return null;
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ public QueryBuilder<Account, Integer> queryBuilder() {
|
|
61
|
+ return null;
|
|
62
|
+ }
|
|
63
|
+
|
|
64
|
+ public UpdateBuilder<Account, Integer> updateBuilder() {
|
|
65
|
+ return null;
|
|
66
|
+ }
|
|
67
|
+
|
|
68
|
+ public DeleteBuilder<Account, Integer> deleteBuilder() {
|
|
69
|
+ return null;
|
|
70
|
+ }
|
|
71
|
+
|
|
72
|
+ public List<Account> query(PreparedQuery<Account> preparedQuery) throws SQLException {
|
|
73
|
+ return null;
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
+ public int create(Account account) throws SQLException {
|
|
77
|
+ return 1;
|
|
78
|
+ }
|
|
79
|
+
|
|
80
|
+ public Account createIfNotExists(Account account) throws SQLException {
|
|
81
|
+ return null;
|
|
82
|
+ }
|
|
83
|
+
|
|
84
|
+ public CreateOrUpdateStatus createOrUpdate(Account account) throws SQLException {
|
|
85
|
+ return null;
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+ public int update(Account account) throws SQLException {
|
|
89
|
+ return 1;
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ public int updateId(Account account, Integer integer) throws SQLException {
|
|
93
|
+ return 0;
|
|
94
|
+ }
|
|
95
|
+
|
|
96
|
+ public int update(PreparedUpdate<Account> preparedUpdate) throws SQLException {
|
|
97
|
+ return 0;
|
|
98
|
+ }
|
|
99
|
+
|
|
100
|
+ public int refresh(Account account) throws SQLException {
|
|
101
|
+ return 0;
|
|
102
|
+ }
|
|
103
|
+
|
|
104
|
+ public int delete(Account account) throws SQLException {
|
|
105
|
+ return 1;
|
|
106
|
+ }
|
|
107
|
+
|
|
108
|
+ public int deleteById(Integer integer) throws SQLException {
|
|
109
|
+ return 0;
|
|
110
|
+ }
|
|
111
|
+
|
|
112
|
+ public int delete(Collection<Account> collection) throws SQLException {
|
|
113
|
+ return 0;
|
|
114
|
+ }
|
|
115
|
+
|
|
116
|
+ public int deleteIds(Collection<Integer> collection) throws SQLException {
|
|
117
|
+ return 0;
|
|
118
|
+ }
|
|
119
|
+
|
|
120
|
+ public int delete(PreparedDelete<Account> preparedDelete) throws SQLException {
|
|
121
|
+ return 1;
|
|
122
|
+ }
|
|
123
|
+
|
|
124
|
+ public CloseableIterator<Account> iterator() {
|
|
125
|
+ return null;
|
|
126
|
+ }
|
|
127
|
+
|
|
128
|
+ public CloseableIterator<Account> iterator(int i) {
|
|
129
|
+ return null;
|
|
130
|
+ }
|
|
131
|
+
|
|
132
|
+ public CloseableIterator<Account> iterator(PreparedQuery<Account> preparedQuery) throws SQLException {
|
|
133
|
+ return null;
|
|
134
|
+ }
|
|
135
|
+
|
|
136
|
+ public CloseableIterator<Account> iterator(PreparedQuery<Account> preparedQuery, int i) throws SQLException {
|
|
137
|
+ return null;
|
|
138
|
+ }
|
|
139
|
+
|
|
140
|
+ public CloseableWrappedIterable<Account> getWrappedIterable() {
|
|
141
|
+ return null;
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ public CloseableWrappedIterable<Account> getWrappedIterable(PreparedQuery<Account> preparedQuery) {
|
|
145
|
+ return null;
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ public void closeLastIterator() throws SQLException {
|
|
149
|
+
|
|
150
|
+ }
|
|
151
|
+
|
|
152
|
+ public GenericRawResults<String[]> queryRaw(String s, String... strings) throws SQLException {
|
|
153
|
+ return null;
|
|
154
|
+ }
|
|
155
|
+
|
|
156
|
+ public <UO> GenericRawResults<UO> queryRaw(String s, RawRowMapper<UO> rawRowMapper, String... strings) throws SQLException {
|
|
157
|
+ return null;
|
|
158
|
+ }
|
|
159
|
+
|
|
160
|
+ public <UO> GenericRawResults<UO> queryRaw(String s, DataType[] dataTypes, RawRowObjectMapper<UO> rawRowObjectMapper, String... strings) throws SQLException {
|
|
161
|
+ return null;
|
|
162
|
+ }
|
|
163
|
+
|
|
164
|
+ public GenericRawResults<Object[]> queryRaw(String s, DataType[] dataTypes, String... strings) throws SQLException {
|
|
165
|
+ return null;
|
|
166
|
+ }
|
|
167
|
+
|
|
168
|
+ public long queryRawValue(String s, String... strings) throws SQLException {
|
|
169
|
+ return 0;
|
|
170
|
+ }
|
|
171
|
+
|
|
172
|
+ public int executeRaw(String s, String... strings) throws SQLException {
|
|
173
|
+ return 0;
|
|
174
|
+ }
|
|
175
|
+
|
|
176
|
+ public int executeRawNoArgs(String s) throws SQLException {
|
|
177
|
+ return 0;
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ public int updateRaw(String s, String... strings) throws SQLException {
|
|
181
|
+ return 0;
|
|
182
|
+ }
|
|
183
|
+
|
|
184
|
+ public <CT> CT callBatchTasks(Callable<CT> callable) throws Exception {
|
|
185
|
+ return null;
|
|
186
|
+ }
|
|
187
|
+
|
|
188
|
+ public String objectToString(Account account) {
|
|
189
|
+ return null;
|
|
190
|
+ }
|
|
191
|
+
|
|
192
|
+ public boolean objectsEqual(Account account, Account t1) throws SQLException {
|
|
193
|
+ return false;
|
|
194
|
+ }
|
|
195
|
+
|
|
196
|
+ public Integer extractId(Account account) throws SQLException {
|
|
197
|
+ return null;
|
|
198
|
+ }
|
|
199
|
+
|
|
200
|
+ public Class<Account> getDataClass() {
|
|
201
|
+ return null;
|
|
202
|
+ }
|
|
203
|
+
|
|
204
|
+ public FieldType findForeignFieldType(Class<?> aClass) {
|
|
205
|
+ return null;
|
|
206
|
+ }
|
|
207
|
+
|
|
208
|
+ public boolean isUpdatable() {
|
|
209
|
+ return false;
|
|
210
|
+ }
|
|
211
|
+
|
|
212
|
+ public boolean isTableExists() throws SQLException {
|
|
213
|
+ return false;
|
|
214
|
+ }
|
|
215
|
+
|
|
216
|
+ public long countOf() throws SQLException {
|
|
217
|
+ return 0;
|
|
218
|
+ }
|
|
219
|
+
|
|
220
|
+ public long countOf(PreparedQuery<Account> preparedQuery) throws SQLException {
|
|
221
|
+ return 0;
|
|
222
|
+ }
|
|
223
|
+
|
|
224
|
+ public void assignEmptyForeignCollection(Account account, String s) throws SQLException {
|
|
225
|
+
|
|
226
|
+ }
|
|
227
|
+
|
|
228
|
+ public <FT> ForeignCollection<FT> getEmptyForeignCollection(String s) throws SQLException {
|
|
229
|
+ return null;
|
|
230
|
+ }
|
|
231
|
+
|
|
232
|
+ public void setObjectCache(boolean b) throws SQLException {
|
|
233
|
+
|
|
234
|
+ }
|
|
235
|
+
|
|
236
|
+ public void setObjectCache(ObjectCache objectCache) throws SQLException {
|
|
237
|
+
|
|
238
|
+ }
|
|
239
|
+
|
|
240
|
+ public ObjectCache getObjectCache() {
|
|
241
|
+ return null;
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ public void clearObjectCache() {
|
|
245
|
+
|
|
246
|
+ }
|
|
247
|
+
|
|
248
|
+ public Account mapSelectStarRow(DatabaseResults databaseResults) throws SQLException {
|
|
249
|
+ return null;
|
|
250
|
+ }
|
|
251
|
+
|
|
252
|
+ public GenericRowMapper<Account> getSelectStarRowMapper() throws SQLException {
|
|
253
|
+ return null;
|
|
254
|
+ }
|
|
255
|
+
|
|
256
|
+ public RawRowMapper<Account> getRawRowMapper() {
|
|
257
|
+ return null;
|
|
258
|
+ }
|
|
259
|
+
|
|
260
|
+ public boolean idExists(Integer integer) throws SQLException {
|
|
261
|
+ return false;
|
|
262
|
+ }
|
|
263
|
+
|
|
264
|
+ public DatabaseConnection startThreadConnection() throws SQLException {
|
|
265
|
+ return null;
|
|
266
|
+ }
|
|
267
|
+
|
|
268
|
+ public void endThreadConnection(DatabaseConnection databaseConnection) throws SQLException {
|
|
269
|
+
|
|
270
|
+ }
|
|
271
|
+
|
|
272
|
+ public void setAutoCommit(boolean b) throws SQLException {
|
|
273
|
+
|
|
274
|
+ }
|
|
275
|
+
|
|
276
|
+ public void setAutoCommit(DatabaseConnection databaseConnection, boolean b) throws SQLException {
|
|
277
|
+
|
|
278
|
+ }
|
|
279
|
+
|
|
280
|
+ public boolean isAutoCommit() throws SQLException {
|
|
281
|
+ return false;
|
|
282
|
+ }
|
|
283
|
+
|
|
284
|
+ public boolean isAutoCommit(DatabaseConnection databaseConnection) throws SQLException {
|
|
285
|
+ return false;
|
|
286
|
+ }
|
|
287
|
+
|
|
288
|
+ public void commit(DatabaseConnection databaseConnection) throws SQLException {
|
|
289
|
+
|
|
290
|
+ }
|
|
291
|
+
|
|
292
|
+ public void rollBack(DatabaseConnection databaseConnection) throws SQLException {
|
|
293
|
+
|
|
294
|
+ }
|
|
295
|
+
|
|
296
|
+ public ConnectionSource getConnectionSource() {
|
|
297
|
+ return null;
|
|
298
|
+ }
|
|
299
|
+
|
|
300
|
+ public void setObjectFactory(ObjectFactory<Account> objectFactory) {
|
|
301
|
+
|
|
302
|
+ }
|
|
303
|
+
|
|
304
|
+ public CloseableIterator<Account> closeableIterator() {
|
|
305
|
+ return null;
|
|
306
|
+ }
|
|
307
|
+}
|