Bladeren bron

finished lab

Connor Dunnigan 6 jaren geleden
bovenliggende
commit
ed34883737

+ 14
- 0
ORMLab/.idea/compiler.xml Bestand weergeven

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="ORM" />
10
+        <module name="ORMLab" />
11
+      </profile>
12
+    </annotationProcessing>
13
+  </component>
14
+</project>

+ 14
- 0
ORMLab/.idea/misc.xml Bestand weergeven

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+  <component name="MavenProjectsManager">
5
+    <option name="originalFiles">
6
+      <list>
7
+        <option value="$PROJECT_DIR$/pom.xml" />
8
+      </list>
9
+    </option>
10
+  </component>
11
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
12
+    <output url="file://$PROJECT_DIR$/out" />
13
+  </component>
14
+</project>

+ 620
- 0
ORMLab/.idea/workspace.xml Bestand weergeven

@@ -0,0 +1,620 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="403c6e5c-fa12-4bb3-a56c-c3182778fee1" name="Default Changelist" comment="" />
5
+    <ignored path="$PROJECT_DIR$/out/" />
6
+    <ignored path="$PROJECT_DIR$/target/" />
7
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8
+    <option name="SHOW_DIALOG" value="false" />
9
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+    <option name="LAST_RESOLUTION" value="IGNORE" />
12
+  </component>
13
+  <component name="FUSProjectUsageTrigger">
14
+    <session id="1532277805">
15
+      <usages-collector id="statistics.lifecycle.project">
16
+        <counts>
17
+          <entry key="project.open.time.3" value="1" />
18
+          <entry key="project.opened" value="1" />
19
+        </counts>
20
+      </usages-collector>
21
+      <usages-collector id="statistics.file.extensions.edit">
22
+        <counts>
23
+          <entry key="java" value="324" />
24
+          <entry key="xml" value="20" />
25
+        </counts>
26
+      </usages-collector>
27
+      <usages-collector id="statistics.file.types.edit">
28
+        <counts>
29
+          <entry key="JAVA" value="324" />
30
+          <entry key="XML" value="20" />
31
+        </counts>
32
+      </usages-collector>
33
+      <usages-collector id="statistics.file.extensions.open">
34
+        <counts>
35
+          <entry key="java" value="3" />
36
+        </counts>
37
+      </usages-collector>
38
+      <usages-collector id="statistics.file.types.open">
39
+        <counts>
40
+          <entry key="JAVA" value="3" />
41
+        </counts>
42
+      </usages-collector>
43
+    </session>
44
+    <session id="1616447938">
45
+      <usages-collector id="statistics.lifecycle.project">
46
+        <counts>
47
+          <entry key="project.open.time.2" value="1" />
48
+          <entry key="project.opened" value="1" />
49
+        </counts>
50
+      </usages-collector>
51
+      <usages-collector id="statistics.file.extensions.edit">
52
+        <counts>
53
+          <entry key="java" value="620" />
54
+          <entry key="xml" value="2" />
55
+        </counts>
56
+      </usages-collector>
57
+      <usages-collector id="statistics.file.types.edit">
58
+        <counts>
59
+          <entry key="JAVA" value="620" />
60
+          <entry key="XML" value="2" />
61
+        </counts>
62
+      </usages-collector>
63
+      <usages-collector id="statistics.file.extensions.open">
64
+        <counts>
65
+          <entry key="java" value="5" />
66
+        </counts>
67
+      </usages-collector>
68
+      <usages-collector id="statistics.file.types.open">
69
+        <counts>
70
+          <entry key="JAVA" value="5" />
71
+        </counts>
72
+      </usages-collector>
73
+    </session>
74
+  </component>
75
+  <component name="FileEditorManager">
76
+    <splitter split-orientation="horizontal" split-proportion="0.5">
77
+      <split-first>
78
+        <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
79
+          <file pinned="false" current-in-tab="false">
80
+            <entry file="file://$PROJECT_DIR$/pom.xml">
81
+              <provider selected="true" editor-type-id="text-editor">
82
+                <state relative-caret-position="495">
83
+                  <caret line="33" column="36" selection-start-line="33" selection-start-column="36" selection-end-line="33" selection-end-column="36" />
84
+                </state>
85
+              </provider>
86
+            </entry>
87
+          </file>
88
+          <file pinned="false" current-in-tab="false">
89
+            <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
90
+              <provider selected="true" editor-type-id="text-editor">
91
+                <state relative-caret-position="120">
92
+                  <caret line="8" selection-start-line="8" selection-end-line="8" />
93
+                  <folding>
94
+                    <element signature="imports" expanded="true" />
95
+                    <element signature="e#668#669#0" expanded="true" />
96
+                    <element signature="e#700#701#0" expanded="true" />
97
+                    <element signature="e#844#845#0" expanded="true" />
98
+                    <element signature="e#869#870#0" expanded="true" />
99
+                    <element signature="e#900#901#0" expanded="true" />
100
+                    <element signature="e#927#928#0" expanded="true" />
101
+                    <element signature="e#967#968#0" expanded="true" />
102
+                    <element signature="e#999#1000#0" expanded="true" />
103
+                    <element signature="e#1034#1035#0" expanded="true" />
104
+                    <element signature="e#1065#1066#0" expanded="true" />
105
+                    <element signature="e#1113#1114#0" expanded="true" />
106
+                    <element signature="e#1153#1154#0" expanded="true" />
107
+                    <element signature="e#1196#1197#0" expanded="true" />
108
+                    <element signature="e#1234#1235#0" expanded="true" />
109
+                  </folding>
110
+                </state>
111
+              </provider>
112
+            </entry>
113
+          </file>
114
+          <file pinned="false" current-in-tab="false">
115
+            <entry file="file://$PROJECT_DIR$/src/test/java/TestAccountManager.java">
116
+              <provider selected="true" editor-type-id="text-editor">
117
+                <state relative-caret-position="210">
118
+                  <caret line="14" column="49" selection-start-line="14" selection-start-column="49" selection-end-line="14" selection-end-column="49" />
119
+                  <folding>
120
+                    <element signature="imports" expanded="true" />
121
+                  </folding>
122
+                </state>
123
+              </provider>
124
+            </entry>
125
+          </file>
126
+          <file pinned="false" current-in-tab="false">
127
+            <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
128
+              <provider selected="true" editor-type-id="text-editor">
129
+                <state relative-caret-position="255">
130
+                  <caret line="17" selection-start-line="17" selection-end-line="17" />
131
+                  <folding>
132
+                    <element signature="imports" expanded="true" />
133
+                    <element signature="e#2316#2317#0" expanded="true" />
134
+                    <element signature="e#2351#2352#0" expanded="true" />
135
+                    <element signature="e#2435#2436#0" expanded="true" />
136
+                    <element signature="e#2470#2471#0" expanded="true" />
137
+                    <element signature="e#2554#2555#0" expanded="true" />
138
+                    <element signature="e#2589#2590#0" expanded="true" />
139
+                    <element signature="e#4009#4010#0" expanded="true" />
140
+                    <element signature="e#4044#4045#0" expanded="true" />
141
+                    <element signature="e#4123#4124#0" expanded="true" />
142
+                    <element signature="e#4158#4159#0" expanded="true" />
143
+                    <element signature="e#4586#4587#0" expanded="true" />
144
+                    <element signature="e#4621#4622#0" expanded="true" />
145
+                    <element signature="e#6346#6347#0" expanded="true" />
146
+                    <element signature="e#6381#6382#0" expanded="true" />
147
+                    <element signature="e#6715#6716#0" expanded="true" />
148
+                    <element signature="e#6750#6751#0" expanded="true" />
149
+                    <element signature="e#6834#6835#0" expanded="true" />
150
+                    <element signature="e#6869#6870#0" expanded="true" />
151
+                    <element signature="e#6927#6928#0" expanded="true" />
152
+                    <element signature="e#6963#6964#0" expanded="true" />
153
+                    <element signature="e#7878#7879#0" expanded="true" />
154
+                    <element signature="e#7913#7914#0" expanded="true" />
155
+                    <element signature="e#8351#8352#0" expanded="true" />
156
+                    <element signature="e#8386#8387#0" expanded="true" />
157
+                    <element signature="e#9590#9591#0" expanded="true" />
158
+                    <element signature="e#9625#9626#0" expanded="true" />
159
+                    <element signature="e#9815#9816#0" expanded="true" />
160
+                    <element signature="e#9850#9851#0" expanded="true" />
161
+                  </folding>
162
+                </state>
163
+              </provider>
164
+            </entry>
165
+          </file>
166
+          <file pinned="false" current-in-tab="true">
167
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
168
+              <provider selected="true" editor-type-id="text-editor">
169
+                <state relative-caret-position="690">
170
+                  <caret line="46" column="32" selection-start-line="46" selection-start-column="32" selection-end-line="46" selection-end-column="32" />
171
+                  <folding>
172
+                    <element signature="imports" expanded="true" />
173
+                  </folding>
174
+                </state>
175
+              </provider>
176
+            </entry>
177
+          </file>
178
+          <file pinned="false" current-in-tab="false">
179
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountManager.java">
180
+              <provider selected="true" editor-type-id="text-editor">
181
+                <state relative-caret-position="150">
182
+                  <caret line="10" column="5" selection-start-line="10" selection-start-column="5" selection-end-line="10" selection-end-column="5" />
183
+                  <folding>
184
+                    <element signature="imports" expanded="true" />
185
+                    <element signature="e#165#166#0" expanded="true" />
186
+                    <element signature="e#195#196#0" expanded="true" />
187
+                  </folding>
188
+                </state>
189
+              </provider>
190
+            </entry>
191
+          </file>
192
+        </leaf>
193
+      </split-first>
194
+      <split-second>
195
+        <leaf>
196
+          <file pinned="false" current-in-tab="false">
197
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountManager.java">
198
+              <provider selected="true" editor-type-id="text-editor">
199
+                <state relative-caret-position="15">
200
+                  <caret line="5" column="4" selection-start-line="5" selection-start-column="4" selection-end-line="5" selection-end-column="4" />
201
+                </state>
202
+              </provider>
203
+            </entry>
204
+          </file>
205
+          <file pinned="false" current-in-tab="true">
206
+            <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
207
+              <provider selected="true" editor-type-id="text-editor">
208
+                <state relative-caret-position="495">
209
+                  <caret line="41" column="36" lean-forward="true" selection-start-line="41" selection-start-column="36" selection-end-line="41" selection-end-column="36" />
210
+                </state>
211
+              </provider>
212
+            </entry>
213
+          </file>
214
+        </leaf>
215
+      </split-second>
216
+    </splitter>
217
+  </component>
218
+  <component name="FileTemplateManagerImpl">
219
+    <option name="RECENT_TEMPLATES">
220
+      <list>
221
+        <option value="Class" />
222
+      </list>
223
+    </option>
224
+  </component>
225
+  <component name="FindInProjectRecents">
226
+    <findStrings>
227
+      <find>scanner</find>
228
+      <find>AccountServ</find>
229
+      <find>prntTakeInt</find>
230
+    </findStrings>
231
+    <replaceStrings>
232
+      <replace>stdin</replace>
233
+      <replace>AccountManager</replace>
234
+      <replace>printThenReadStr</replace>
235
+      <replace>printThenReadInt</replace>
236
+    </replaceStrings>
237
+  </component>
238
+  <component name="IdeDocumentHistory">
239
+    <option name="CHANGED_PATHS">
240
+      <list>
241
+        <option value="$PROJECT_DIR$/src/main/java/Account.java" />
242
+        <option value="$PROJECT_DIR$/src/main/java/AccountManager.java" />
243
+        <option value="$PROJECT_DIR$/src/main/java/Console.java" />
244
+        <option value="$PROJECT_DIR$/pom.xml" />
245
+        <option value="$PROJECT_DIR$/src/test/java/MockDao.java" />
246
+        <option value="$PROJECT_DIR$/src/test/java/TestAccountManager.java" />
247
+        <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
248
+      </list>
249
+    </option>
250
+  </component>
251
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
252
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
253
+  <component name="JsGulpfileManager">
254
+    <detection-done>true</detection-done>
255
+    <sorting>DEFINITION_ORDER</sorting>
256
+  </component>
257
+  <component name="MavenImportPreferences">
258
+    <option name="importingSettings">
259
+      <MavenImportingSettings>
260
+        <option name="importAutomatically" value="true" />
261
+      </MavenImportingSettings>
262
+    </option>
263
+  </component>
264
+  <component name="ProjectFrameBounds">
265
+    <option name="x" value="-345" />
266
+    <option name="y" value="-1057" />
267
+    <option name="width" value="1886" />
268
+    <option name="height" value="1057" />
269
+  </component>
270
+  <component name="ProjectView">
271
+    <navigator proportions="" version="1">
272
+      <foldersAlwaysOnTop value="true" />
273
+    </navigator>
274
+    <panes>
275
+      <pane id="Scope" />
276
+      <pane id="ProjectPane">
277
+        <subPane>
278
+          <expand>
279
+            <path>
280
+              <item name="ORMLab" type="b2602c69:ProjectViewProjectNode" />
281
+              <item name="ORMLab" type="462c0819:PsiDirectoryNode" />
282
+            </path>
283
+            <path>
284
+              <item name="ORMLab" type="b2602c69:ProjectViewProjectNode" />
285
+              <item name="ORMLab" type="462c0819:PsiDirectoryNode" />
286
+              <item name="src" type="462c0819:PsiDirectoryNode" />
287
+            </path>
288
+            <path>
289
+              <item name="ORMLab" type="b2602c69:ProjectViewProjectNode" />
290
+              <item name="ORMLab" type="462c0819:PsiDirectoryNode" />
291
+              <item name="src" type="462c0819:PsiDirectoryNode" />
292
+              <item name="main" type="462c0819:PsiDirectoryNode" />
293
+            </path>
294
+            <path>
295
+              <item name="ORMLab" type="b2602c69:ProjectViewProjectNode" />
296
+              <item name="ORMLab" type="462c0819:PsiDirectoryNode" />
297
+              <item name="src" type="462c0819:PsiDirectoryNode" />
298
+              <item name="main" type="462c0819:PsiDirectoryNode" />
299
+              <item name="java" type="462c0819:PsiDirectoryNode" />
300
+            </path>
301
+            <path>
302
+              <item name="ORMLab" type="b2602c69:ProjectViewProjectNode" />
303
+              <item name="ORMLab" type="462c0819:PsiDirectoryNode" />
304
+              <item name="src" type="462c0819:PsiDirectoryNode" />
305
+              <item name="test" type="462c0819:PsiDirectoryNode" />
306
+            </path>
307
+          </expand>
308
+          <select />
309
+        </subPane>
310
+      </pane>
311
+      <pane id="PackagesPane" />
312
+    </panes>
313
+  </component>
314
+  <component name="PropertiesComponent">
315
+    <property name="WebServerToolWindowFactoryState" value="false" />
316
+    <property name="aspect.path.notification.shown" value="true" />
317
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
318
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
319
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
320
+    <property name="project.structure.last.edited" value="Project" />
321
+    <property name="project.structure.proportion" value="0.15" />
322
+    <property name="project.structure.side.proportion" value="0.2" />
323
+    <property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
324
+  </component>
325
+  <component name="RunDashboard">
326
+    <option name="ruleStates">
327
+      <list>
328
+        <RuleState>
329
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
330
+        </RuleState>
331
+        <RuleState>
332
+          <option name="name" value="StatusDashboardGroupingRule" />
333
+        </RuleState>
334
+      </list>
335
+    </option>
336
+  </component>
337
+  <component name="RunManager" selected="Application.AccountApp">
338
+    <configuration name="AccountApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
339
+      <option name="MAIN_CLASS_NAME" value="AccountApp" />
340
+      <module name="ORMLab" />
341
+      <method v="2">
342
+        <option name="Make" enabled="true" />
343
+      </method>
344
+    </configuration>
345
+    <configuration name="TestAccountManager" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
346
+      <module name="ORM" />
347
+      <option name="PACKAGE_NAME" value="" />
348
+      <option name="MAIN_CLASS_NAME" value="TestAccountManager" />
349
+      <method v="2">
350
+        <option name="Make" enabled="true" />
351
+      </method>
352
+    </configuration>
353
+    <list>
354
+      <item itemvalue="Application.AccountApp" />
355
+      <item itemvalue="JUnit.TestAccountManager" />
356
+    </list>
357
+    <recent_temporary>
358
+      <list>
359
+        <item itemvalue="Application.AccountApp" />
360
+        <item itemvalue="JUnit.TestAccountManager" />
361
+      </list>
362
+    </recent_temporary>
363
+  </component>
364
+  <component name="SvnConfiguration">
365
+    <configuration />
366
+  </component>
367
+  <component name="TaskManager">
368
+    <task active="true" id="Default" summary="Default task">
369
+      <changelist id="403c6e5c-fa12-4bb3-a56c-c3182778fee1" name="Default Changelist" comment="" />
370
+      <created>1542661026670</created>
371
+      <option name="number" value="Default" />
372
+      <option name="presentableId" value="Default" />
373
+      <updated>1542661026670</updated>
374
+      <workItem from="1542661029687" duration="5300000" />
375
+      <workItem from="1542726834863" duration="5573000" />
376
+    </task>
377
+    <servers />
378
+  </component>
379
+  <component name="TestHistory">
380
+    <history-entry file="TestAccountManager - 2018.11.21 at 15h 19m 48s.xml">
381
+      <configuration name="TestAccountManager" configurationId="JUnit" />
382
+    </history-entry>
383
+  </component>
384
+  <component name="TimeTrackingManager">
385
+    <option name="totallyTimeSpent" value="10873000" />
386
+  </component>
387
+  <component name="ToolWindowManager">
388
+    <frame x="-345" y="-1057" width="1886" height="1057" extended-state="0" />
389
+    <layout>
390
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.098156184" />
391
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
392
+      <window_info id="Designer" order="2" />
393
+      <window_info id="UI Designer" order="3" />
394
+      <window_info id="Favorites" order="4" side_tool="true" />
395
+      <window_info anchor="bottom" id="Message" order="0" />
396
+      <window_info anchor="bottom" id="Find" order="1" />
397
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.18134715" />
398
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
399
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
400
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
401
+      <window_info anchor="bottom" id="TODO" order="6" />
402
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
403
+      <window_info anchor="bottom" id="Terminal" order="8" />
404
+      <window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
405
+      <window_info anchor="bottom" id="Version Control" order="10" show_stripe_button="false" />
406
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.3284974" />
407
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
408
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
409
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
410
+      <window_info anchor="right" id="Palette" order="3" />
411
+      <window_info anchor="right" id="Database" order="4" />
412
+      <window_info anchor="right" id="Palette&#9;" order="5" />
413
+      <window_info anchor="right" id="Maven Projects" order="6" />
414
+    </layout>
415
+  </component>
416
+  <component name="TypeScriptGeneratedFilesManager">
417
+    <option name="version" value="1" />
418
+  </component>
419
+  <component name="VcsContentAnnotationSettings">
420
+    <option name="myLimit" value="2678400000" />
421
+  </component>
422
+  <component name="editorHistoryManager">
423
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountManager.java">
424
+      <provider selected="true" editor-type-id="text-editor">
425
+        <state relative-caret-position="150">
426
+          <caret line="10" column="5" selection-start-line="10" selection-start-column="5" selection-end-line="10" selection-end-column="5" />
427
+          <folding>
428
+            <element signature="imports" expanded="true" />
429
+            <element signature="e#165#166#0" expanded="true" />
430
+            <element signature="e#195#196#0" expanded="true" />
431
+          </folding>
432
+        </state>
433
+      </provider>
434
+    </entry>
435
+    <entry file="file://$PROJECT_DIR$/pom.xml">
436
+      <provider selected="true" editor-type-id="text-editor">
437
+        <state relative-caret-position="495">
438
+          <caret line="33" column="36" selection-start-line="33" selection-start-column="36" selection-end-line="33" selection-end-column="36" />
439
+        </state>
440
+      </provider>
441
+    </entry>
442
+    <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
443
+      <provider selected="true" editor-type-id="text-editor">
444
+        <state relative-caret-position="255">
445
+          <caret line="17" selection-start-line="17" selection-end-line="17" />
446
+          <folding>
447
+            <element signature="imports" expanded="true" />
448
+            <element signature="e#2316#2317#0" expanded="true" />
449
+            <element signature="e#2351#2352#0" expanded="true" />
450
+            <element signature="e#2435#2436#0" expanded="true" />
451
+            <element signature="e#2470#2471#0" expanded="true" />
452
+            <element signature="e#2554#2555#0" expanded="true" />
453
+            <element signature="e#2589#2590#0" expanded="true" />
454
+            <element signature="e#4009#4010#0" expanded="true" />
455
+            <element signature="e#4044#4045#0" expanded="true" />
456
+            <element signature="e#4123#4124#0" expanded="true" />
457
+            <element signature="e#4158#4159#0" expanded="true" />
458
+            <element signature="e#4586#4587#0" expanded="true" />
459
+            <element signature="e#4621#4622#0" expanded="true" />
460
+            <element signature="e#6346#6347#0" expanded="true" />
461
+            <element signature="e#6381#6382#0" expanded="true" />
462
+            <element signature="e#6715#6716#0" expanded="true" />
463
+            <element signature="e#6750#6751#0" expanded="true" />
464
+            <element signature="e#6834#6835#0" expanded="true" />
465
+            <element signature="e#6869#6870#0" expanded="true" />
466
+            <element signature="e#6927#6928#0" expanded="true" />
467
+            <element signature="e#6963#6964#0" expanded="true" />
468
+            <element signature="e#7878#7879#0" expanded="true" />
469
+            <element signature="e#7913#7914#0" expanded="true" />
470
+            <element signature="e#8351#8352#0" expanded="true" />
471
+            <element signature="e#8386#8387#0" expanded="true" />
472
+            <element signature="e#9590#9591#0" expanded="true" />
473
+            <element signature="e#9625#9626#0" expanded="true" />
474
+            <element signature="e#9815#9816#0" expanded="true" />
475
+            <element signature="e#9850#9851#0" expanded="true" />
476
+          </folding>
477
+        </state>
478
+      </provider>
479
+    </entry>
480
+    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
481
+      <provider selected="true" editor-type-id="text-editor">
482
+        <state relative-caret-position="495">
483
+          <caret line="41" column="36" lean-forward="true" selection-start-line="41" selection-start-column="36" selection-end-line="41" selection-end-column="36" />
484
+        </state>
485
+      </provider>
486
+    </entry>
487
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
488
+      <provider selected="true" editor-type-id="text-editor">
489
+        <state relative-caret-position="120">
490
+          <caret line="8" selection-start-line="8" selection-end-line="8" />
491
+          <folding>
492
+            <element signature="imports" expanded="true" />
493
+            <element signature="e#668#669#0" expanded="true" />
494
+            <element signature="e#700#701#0" expanded="true" />
495
+            <element signature="e#844#845#0" expanded="true" />
496
+            <element signature="e#869#870#0" expanded="true" />
497
+            <element signature="e#900#901#0" expanded="true" />
498
+            <element signature="e#927#928#0" expanded="true" />
499
+            <element signature="e#967#968#0" expanded="true" />
500
+            <element signature="e#999#1000#0" expanded="true" />
501
+            <element signature="e#1034#1035#0" expanded="true" />
502
+            <element signature="e#1065#1066#0" expanded="true" />
503
+            <element signature="e#1113#1114#0" expanded="true" />
504
+            <element signature="e#1153#1154#0" expanded="true" />
505
+            <element signature="e#1196#1197#0" expanded="true" />
506
+            <element signature="e#1234#1235#0" expanded="true" />
507
+          </folding>
508
+        </state>
509
+      </provider>
510
+    </entry>
511
+    <entry file="file://$PROJECT_DIR$/src/test/java/TestAccountManager.java">
512
+      <provider selected="true" editor-type-id="text-editor">
513
+        <state relative-caret-position="210">
514
+          <caret line="14" column="49" selection-start-line="14" selection-start-column="49" selection-end-line="14" selection-end-column="49" />
515
+          <folding>
516
+            <element signature="imports" expanded="true" />
517
+          </folding>
518
+        </state>
519
+      </provider>
520
+    </entry>
521
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
522
+      <provider selected="true" editor-type-id="text-editor">
523
+        <state relative-caret-position="690">
524
+          <caret line="46" column="32" selection-start-line="46" selection-start-column="32" selection-end-line="46" selection-end-column="32" />
525
+          <folding>
526
+            <element signature="imports" expanded="true" />
527
+          </folding>
528
+        </state>
529
+      </provider>
530
+    </entry>
531
+  </component>
532
+  <component name="masterDetails">
533
+    <states>
534
+      <state key="ArtifactsStructureConfigurable.UI">
535
+        <settings>
536
+          <artifact-editor />
537
+          <splitter-proportions>
538
+            <option name="proportions">
539
+              <list>
540
+                <option value="0.2" />
541
+              </list>
542
+            </option>
543
+          </splitter-proportions>
544
+        </settings>
545
+      </state>
546
+      <state key="FacetStructureConfigurable.UI">
547
+        <settings>
548
+          <last-edited>No facets are configured</last-edited>
549
+          <splitter-proportions>
550
+            <option name="proportions">
551
+              <list>
552
+                <option value="0.2" />
553
+              </list>
554
+            </option>
555
+          </splitter-proportions>
556
+        </settings>
557
+      </state>
558
+      <state key="GlobalLibrariesConfigurable.UI">
559
+        <settings>
560
+          <splitter-proportions>
561
+            <option name="proportions">
562
+              <list>
563
+                <option value="0.2" />
564
+              </list>
565
+            </option>
566
+          </splitter-proportions>
567
+        </settings>
568
+      </state>
569
+      <state key="JdkListConfigurable.UI">
570
+        <settings>
571
+          <last-edited>1.8</last-edited>
572
+          <splitter-proportions>
573
+            <option name="proportions">
574
+              <list>
575
+                <option value="0.2" />
576
+              </list>
577
+            </option>
578
+          </splitter-proportions>
579
+        </settings>
580
+      </state>
581
+      <state key="ModuleStructureConfigurable.UI">
582
+        <settings>
583
+          <last-edited>ORM</last-edited>
584
+          <splitter-proportions>
585
+            <option name="proportions">
586
+              <list>
587
+                <option value="0.2" />
588
+                <option value="0.6" />
589
+              </list>
590
+            </option>
591
+          </splitter-proportions>
592
+        </settings>
593
+      </state>
594
+      <state key="ProjectJDKs.UI">
595
+        <settings>
596
+          <last-edited>1.8</last-edited>
597
+          <splitter-proportions>
598
+            <option name="proportions">
599
+              <list>
600
+                <option value="0.2" />
601
+              </list>
602
+            </option>
603
+          </splitter-proportions>
604
+        </settings>
605
+      </state>
606
+      <state key="ProjectLibrariesConfigurable.UI">
607
+        <settings>
608
+          <last-edited>Maven: com.j256.ormlite:ormlite-core:4.48</last-edited>
609
+          <splitter-proportions>
610
+            <option name="proportions">
611
+              <list>
612
+                <option value="0.2" />
613
+              </list>
614
+            </option>
615
+          </splitter-proportions>
616
+        </settings>
617
+      </state>
618
+    </states>
619
+  </component>
620
+</project>

+ 2
- 0
ORMLab/ORMLab.iml Bestand weergeven

@@ -0,0 +1,2 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4" />

+ 41
- 0
ORMLab/pom.xml Bestand weergeven

@@ -0,0 +1,41 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns="http://maven.apache.org/POM/4.0.0"
3
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+    <modelVersion>4.0.0</modelVersion>
6
+
7
+    <groupId>ORMlab</groupId>
8
+    <artifactId>ORM</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+    <dependencies>
11
+        <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-core -->
12
+        <dependency>
13
+            <groupId>com.j256.ormlite</groupId>
14
+            <artifactId>ormlite-core</artifactId>
15
+            <version>4.48</version>
16
+        </dependency>
17
+
18
+        <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-jdbc -->
19
+        <dependency>
20
+            <groupId>com.j256.ormlite</groupId>
21
+            <artifactId>ormlite-jdbc</artifactId>
22
+            <version>4.48</version>
23
+        </dependency>
24
+
25
+        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
26
+        <dependency>
27
+            <groupId>mysql</groupId>
28
+            <artifactId>mysql-connector-java</artifactId>
29
+            <version>8.0.12</version>
30
+        </dependency>
31
+
32
+        <!-- https://mvnrepository.com/artifact/junit/junit -->
33
+        <dependency>
34
+            <groupId>junit</groupId>
35
+            <artifactId>junit</artifactId>
36
+            <version>4.12</version>
37
+            <scope>test</scope>
38
+        </dependency>
39
+    </dependencies>
40
+
41
+</project>

+ 64
- 0
ORMLab/src/main/java/Account.java Bestand weergeven

@@ -0,0 +1,64 @@
1
+import com.j256.ormlite.field.DatabaseField;
2
+import com.j256.ormlite.table.DatabaseTable;
3
+
4
+@DatabaseTable(tableName = "account")
5
+public class Account {
6
+
7
+    public static final String NAME_FIELD_NAME = "name";
8
+    public static final String PASSWORD_FIELD_NAME = "password";
9
+
10
+    @DatabaseField(columnName = "id", generatedId = true)
11
+    private int id;
12
+
13
+    @DatabaseField(columnName = "name", canBeNull = false)
14
+    private String name;
15
+
16
+    @DatabaseField(columnName = "password")
17
+    private String password;
18
+
19
+    Account() {
20
+        // all persisted classes must define a no-arg constructor with at least package visibility
21
+    }
22
+
23
+    public Account(String name) {
24
+        this.name = name;
25
+    }
26
+
27
+    public Account(String name, String password) {
28
+        this.name = name;
29
+        this.password = password;
30
+    }
31
+
32
+    public int getId() {
33
+        return id;
34
+    }
35
+
36
+    public String getName() {
37
+        return name;
38
+    }
39
+
40
+    public void setName(String name) {
41
+        this.name = name;
42
+    }
43
+
44
+    public String getPassword() {
45
+        return password;
46
+    }
47
+
48
+    public void setPassword(String password) {
49
+        this.password = password;
50
+    }
51
+
52
+    @Override
53
+    public int hashCode() {
54
+        return name.hashCode();
55
+    }
56
+
57
+    @Override
58
+    public boolean equals(Object other) {
59
+        if (other == null || other.getClass() != getClass()) {
60
+            return false;
61
+        }
62
+        return name.equals(((Account) other).name);
63
+    }
64
+}

+ 79
- 0
ORMLab/src/main/java/AccountApp.java Bestand weergeven

@@ -0,0 +1,79 @@
1
+import com.j256.ormlite.dao.Dao;
2
+import com.j256.ormlite.dao.DaoManager;
3
+import com.j256.ormlite.jdbc.JdbcConnectionSource;
4
+import com.j256.ormlite.support.ConnectionSource;
5
+
6
+public class AccountApp {
7
+
8
+    // we are using a MySQl database
9
+    private final static String DATABASE_URL = "jdbc:mysql://localhost:3306/orm_lab?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
10
+    private final static String USERNAME = "root";
11
+    private final static String PASSWORD = null;
12
+
13
+    private Dao<Account, Integer> accountDao;
14
+    Console console = new Console();
15
+
16
+    public static void main(String[] args) throws Exception {
17
+        // turn our static method into an instance of Main
18
+        new AccountApp().doMain(args);
19
+    }
20
+
21
+    private void doMain(String[] args) throws Exception {
22
+        ConnectionSource connectionSource = null;
23
+        try {
24
+            // create our data-source for the database
25
+            connectionSource = new JdbcConnectionSource(DATABASE_URL, USERNAME, PASSWORD);
26
+            // setup our  DAOs
27
+            setupDao(connectionSource);
28
+            // read, write and delete some data
29
+            processData();
30
+
31
+            System.out.println("\n\nIt seems to have worked\n\n");
32
+        } finally {
33
+            // destroy the data source which should close underlying connections
34
+            if (connectionSource != null) {
35
+                connectionSource.close();
36
+            }
37
+        }
38
+    }
39
+
40
+    /**
41
+     * Read and write some example data.
42
+     */
43
+    private void processData() throws Exception {
44
+        AccountManager accManager = new AccountManager(accountDao);
45
+        boolean isRunning = true;
46
+        while(isRunning) {
47
+            console.printMenu();
48
+            int usrInput = console.printThenReadInt("Enter choice:\n > ");
49
+            switch (usrInput) {
50
+                case 1:
51
+                    accManager.createAccount();
52
+                    break;
53
+                case 2:
54
+                    accManager.accountString(console.getUserId());
55
+                    break;
56
+                case 3:
57
+                    accManager.updateAccount();
58
+                    break;
59
+                case 4:
60
+                    accManager.deleteAccount();
61
+                    break;
62
+                case 5:
63
+                    isRunning = false;
64
+                    break;
65
+                default:
66
+                    break;
67
+            }
68
+        }
69
+    }
70
+
71
+    /**
72
+     * Setup our  DAOs
73
+     */
74
+    private void setupDao(ConnectionSource connectionSource) throws Exception {
75
+
76
+        accountDao = DaoManager.createDao(connectionSource, Account.class);
77
+
78
+    }
79
+}

+ 70
- 0
ORMLab/src/main/java/AccountManager.java Bestand weergeven

@@ -0,0 +1,70 @@
1
+import com.j256.ormlite.dao.Dao;
2
+
3
+import java.sql.SQLException;
4
+
5
+public class AccountManager {
6
+    private Dao<Account, Integer> dao;
7
+    private Console console = new Console();
8
+
9
+    public AccountManager(Dao<Account, Integer> dao) {
10
+        this.dao = dao;
11
+    }
12
+
13
+    public void createAccount() throws SQLException {
14
+        String name = console.printThenReadStr("Enter account name\n > ");
15
+        String password = console.printThenReadStr("Enter account password\n > ");
16
+        Account account = new Account(name, password);
17
+        dao.create(account);
18
+    }
19
+
20
+    private int create(Account account) throws SQLException {
21
+        return dao.create(account);
22
+    }
23
+
24
+    public Account read(int id) throws SQLException {
25
+        return dao.queryForId(id);
26
+    }
27
+
28
+    public void accountString(int id) throws SQLException{
29
+        Account account =  read(id);
30
+        console.print("\n" + account.getName() + " " + account.getPassword() + "\n");
31
+    }
32
+
33
+    private Account getAcccount()throws SQLException {
34
+        return read(console.getUserId());
35
+    }
36
+
37
+    public void updateAccount() throws SQLException {
38
+        Account account = getAcccount();
39
+        int input = console.printThenReadInt("1. Change password\n 2. Change name\n > ");
40
+        if(input == 1) {setPassword(account);}
41
+        else if (input == 2){
42
+            setName(account);}
43
+        else {console.invalid();}
44
+    }
45
+
46
+    private void setPassword(Account account) throws SQLException {
47
+        String password =  console.printThenReadStr("Enter new password\n > ");
48
+        account.setPassword(password);
49
+        dao.update(account);
50
+    }
51
+
52
+    private void setName(Account account) throws SQLException {
53
+        String name = console.printThenReadStr("Enter new name\n > ");
54
+        account.setName(name);
55
+        dao.update(account);
56
+    }
57
+
58
+    public void deleteAccount() throws SQLException{
59
+        Account account = getAcccount();
60
+        String input =  console.printThenReadStr("Confirm delete account? (Y / N)\n > ");
61
+        if (input.equalsIgnoreCase("y")){
62
+            delete(account);
63
+            console.printLn("Account deleted");
64
+        }
65
+    }
66
+
67
+    private int delete(Account account) throws SQLException {
68
+        return dao.delete(account);
69
+    }
70
+}

+ 43
- 0
ORMLab/src/main/java/Console.java Bestand weergeven

@@ -0,0 +1,43 @@
1
+import java.util.Scanner;
2
+public class Console {
3
+    private Scanner stdin = new Scanner(System.in);
4
+
5
+    public void printMenu() {
6
+        printLn("Account menu: \n 1. Create account\n" +
7
+                "2. Confirm account info\n 3. Update account info\n" +
8
+                " 4. Delete account\n 5. Exit");
9
+    }
10
+
11
+    public int getUserId() {
12
+        print("Enter account ID\n > ");
13
+        return stdin.nextInt();
14
+    }
15
+
16
+    public void printLn(String string) {
17
+        System.out.println(string);
18
+    }
19
+
20
+    public void print(String string) {
21
+        System.out.print(string);
22
+    }
23
+
24
+    public String stringInput() {
25
+        return stdin.nextLine();
26
+    }
27
+
28
+    public int intInput() {
29
+        return stdin.nextInt();
30
+    }
31
+
32
+    public int printThenReadInt(String output) {
33
+        print(output);
34
+        return intInput();
35
+    }
36
+
37
+    public String printThenReadStr(String output) {
38
+        print(output);
39
+        return stringInput();
40
+    }
41
+
42
+    public void invalid() { printLn("Invalid entry... try again"); }
43
+}s

+ 378
- 0
ORMLab/src/test/java/MockDao.java Bestand weergeven

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

+ 45
- 0
ORMLab/src/test/java/TestAccountManager.java Bestand weergeven

@@ -0,0 +1,45 @@
1
+import com.j256.ormlite.dao.Dao;
2
+import org.junit.*;
3
+
4
+import java.sql.SQLException;
5
+
6
+public class TestAccountManager {
7
+    Dao<Account, Integer> dao;
8
+    Account account;
9
+    AccountManager manager;
10
+
11
+    @Before
12
+    public void setup() {
13
+        dao = new MockDao();
14
+        manager = new AccountManager(dao);
15
+        account = new Account("Joe", "password");
16
+    }
17
+
18
+    @Test
19
+    public void createTest() throws SQLException {
20
+        int expected = 100;
21
+        int actual = dao.create(account);
22
+        Assert.assertEquals(expected, actual);
23
+    }
24
+
25
+    @Test
26
+    public void updateTest() throws SQLException {
27
+        int expected = 300;
28
+        int actual = dao.update(account);
29
+        Assert.assertEquals(expected, actual);
30
+    }
31
+
32
+    @Test
33
+    public void readTest() throws SQLException{
34
+        Account expected = manager.read(0);
35
+        Account actual = dao.queryForId(0);
36
+        Assert.assertEquals(expected, actual);
37
+    }
38
+
39
+    @Test
40
+    public void destroyTest() throws SQLException{
41
+        int expected = 200;
42
+        int actual = dao.delete(account);
43
+        Assert.assertEquals(expected, actual);
44
+    }
45
+}

BIN
ORMLab/target/classes/Account.class Bestand weergeven


BIN
ORMLab/target/classes/AccountApp.class Bestand weergeven


BIN
ORMLab/target/classes/AccountManager.class Bestand weergeven


BIN
ORMLab/target/classes/Console.class Bestand weergeven


BIN
ORMLab/target/test-classes/MockDao.class Bestand weergeven


BIN
ORMLab/target/test-classes/TestAccountManager.class Bestand weergeven