Rachelle 6 gadus atpakaļ
vecāks
revīzija
755528df7d

+ 13
- 0
.idea/compiler.xml Parādīt failu

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="ZCW-ORM-SimpleAccount" />
10
+      </profile>
11
+    </annotationProcessing>
12
+  </component>
13
+</project>

+ 14
- 0
.idea/misc.xml Parādīt failu

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>

+ 6
- 0
.idea/vcs.xml Parādīt failu

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="" vcs="Git" />
5
+  </component>
6
+</project>

+ 463
- 0
.idea/workspace.xml Parādīt failu

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="fe0069a8-4d2e-4709-993b-6c2459ea40fc" name="Default" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/src/main/java/Account.java" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/src/main/java/AccountApp.java" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/src/main/java/Console.java" afterDir="false" />
10
+    </list>
11
+    <ignored path="$PROJECT_DIR$/out/" />
12
+    <ignored path="$PROJECT_DIR$/target/" />
13
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
14
+    <option name="TRACKING_ENABLED" value="true" />
15
+    <option name="SHOW_DIALOG" value="false" />
16
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
17
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
18
+    <option name="LAST_RESOLUTION" value="IGNORE" />
19
+  </component>
20
+  <component name="FileEditorManager">
21
+    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
22
+      <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
23
+        <entry file="file://$PROJECT_DIR$/pom.xml">
24
+          <provider selected="true" editor-type-id="text-editor">
25
+            <state relative-caret-position="840">
26
+              <caret line="68" column="10" selection-start-line="68" selection-start-column="10" selection-end-line="68" selection-end-column="10" />
27
+            </state>
28
+          </provider>
29
+        </entry>
30
+      </file>
31
+      <file leaf-file-name="Account.java" pinned="false" current-in-tab="false">
32
+        <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
33
+          <provider selected="true" editor-type-id="text-editor">
34
+            <state>
35
+              <caret column="8" selection-start-column="8" selection-end-column="8" />
36
+            </state>
37
+          </provider>
38
+        </entry>
39
+      </file>
40
+      <file leaf-file-name="AccountApp.java" pinned="false" current-in-tab="false">
41
+        <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
42
+          <provider selected="true" editor-type-id="text-editor">
43
+            <state relative-caret-position="62">
44
+              <caret line="70" lean-forward="true" selection-start-line="70" selection-end-line="70" />
45
+              <folding>
46
+                <element signature="imports" expanded="true" />
47
+              </folding>
48
+            </state>
49
+          </provider>
50
+        </entry>
51
+      </file>
52
+      <file leaf-file-name="Console.java" pinned="false" current-in-tab="true">
53
+        <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
54
+          <provider selected="true" editor-type-id="text-editor">
55
+            <state relative-caret-position="465">
56
+              <caret line="31" column="37" selection-start-line="31" selection-start-column="37" selection-end-line="31" selection-end-column="37" />
57
+              <folding>
58
+                <element signature="e#137#138#0" expanded="true" />
59
+                <element signature="e#173#174#0" expanded="true" />
60
+                <element signature="e#1181#1182#0" expanded="true" />
61
+                <element signature="e#1217#1218#0" expanded="true" />
62
+              </folding>
63
+            </state>
64
+          </provider>
65
+        </entry>
66
+      </file>
67
+    </leaf>
68
+  </component>
69
+  <component name="FileTemplateManagerImpl">
70
+    <option name="RECENT_TEMPLATES">
71
+      <list>
72
+        <option value="Class" />
73
+      </list>
74
+    </option>
75
+  </component>
76
+  <component name="Git.Settings">
77
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
78
+  </component>
79
+  <component name="IdeDocumentHistory">
80
+    <option name="CHANGED_PATHS">
81
+      <list>
82
+        <option value="$PROJECT_DIR$/pom.xml" />
83
+        <option value="$PROJECT_DIR$/src/main/java/Account.java" />
84
+        <option value="$PROJECT_DIR$/src/main/java/AccountApp.java" />
85
+        <option value="$PROJECT_DIR$/src/main/java/Console.java" />
86
+      </list>
87
+    </option>
88
+  </component>
89
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
90
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
91
+  <component name="JsGulpfileManager">
92
+    <detection-done>true</detection-done>
93
+    <sorting>DEFINITION_ORDER</sorting>
94
+  </component>
95
+  <component name="NodePackageJsonFileManager">
96
+    <packageJsonPaths />
97
+  </component>
98
+  <component name="ProjectFrameBounds">
99
+    <option name="x" value="63" />
100
+    <option name="y" value="-950" />
101
+    <option name="width" value="1280" />
102
+    <option name="height" value="880" />
103
+  </component>
104
+  <component name="ProjectLevelVcsManager">
105
+    <ConfirmationsSetting value="2" id="Add" />
106
+  </component>
107
+  <component name="ProjectView">
108
+    <navigator proportions="" version="1">
109
+      <foldersAlwaysOnTop value="true" />
110
+    </navigator>
111
+    <panes>
112
+      <pane id="Scope" />
113
+      <pane id="PackagesPane" />
114
+      <pane id="ProjectPane">
115
+        <subPane>
116
+          <expand>
117
+            <path>
118
+              <item name="ZCW-ORM-SimpleAccount" type="b2602c69:ProjectViewProjectNode" />
119
+              <item name="ZCW-ORM-SimpleAccount" type="462c0819:PsiDirectoryNode" />
120
+            </path>
121
+            <path>
122
+              <item name="ZCW-ORM-SimpleAccount" type="b2602c69:ProjectViewProjectNode" />
123
+              <item name="ZCW-ORM-SimpleAccount" type="462c0819:PsiDirectoryNode" />
124
+              <item name="src" type="462c0819:PsiDirectoryNode" />
125
+            </path>
126
+            <path>
127
+              <item name="ZCW-ORM-SimpleAccount" type="b2602c69:ProjectViewProjectNode" />
128
+              <item name="ZCW-ORM-SimpleAccount" type="462c0819:PsiDirectoryNode" />
129
+              <item name="src" type="462c0819:PsiDirectoryNode" />
130
+              <item name="main" type="462c0819:PsiDirectoryNode" />
131
+            </path>
132
+            <path>
133
+              <item name="ZCW-ORM-SimpleAccount" type="b2602c69:ProjectViewProjectNode" />
134
+              <item name="ZCW-ORM-SimpleAccount" type="462c0819:PsiDirectoryNode" />
135
+              <item name="src" type="462c0819:PsiDirectoryNode" />
136
+              <item name="main" type="462c0819:PsiDirectoryNode" />
137
+              <item name="java" type="462c0819:PsiDirectoryNode" />
138
+            </path>
139
+            <path>
140
+              <item name="ZCW-ORM-SimpleAccount" type="b2602c69:ProjectViewProjectNode" />
141
+              <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
142
+            </path>
143
+          </expand>
144
+          <select />
145
+        </subPane>
146
+      </pane>
147
+      <pane id="AndroidView" />
148
+    </panes>
149
+  </component>
150
+  <component name="PropertiesComponent">
151
+    <property name="WebServerToolWindowFactoryState" value="false" />
152
+    <property name="aspect.path.notification.shown" value="true" />
153
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
154
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
155
+    <property name="project.structure.last.edited" value="Modules" />
156
+    <property name="project.structure.proportion" value="0.0" />
157
+    <property name="project.structure.side.proportion" value="0.2" />
158
+    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
159
+  </component>
160
+  <component name="RunDashboard">
161
+    <option name="ruleStates">
162
+      <list>
163
+        <RuleState>
164
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
165
+        </RuleState>
166
+        <RuleState>
167
+          <option name="name" value="StatusDashboardGroupingRule" />
168
+        </RuleState>
169
+      </list>
170
+    </option>
171
+  </component>
172
+  <component name="RunManager">
173
+    <configuration name="AccountApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
174
+      <option name="MAIN_CLASS_NAME" value="AccountApp" />
175
+      <module name="ZCW-ORM-SimpleAccount" />
176
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
177
+    </configuration>
178
+    <configuration default="true" type="Application" factoryName="Application">
179
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
180
+    </configuration>
181
+    <configuration default="true" type="JUnit" factoryName="JUnit">
182
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
183
+      <option name="ALTERNATIVE_JRE_PATH" />
184
+      <option name="PACKAGE_NAME" />
185
+      <option name="MAIN_CLASS_NAME" />
186
+      <option name="METHOD_NAME" />
187
+      <option name="TEST_OBJECT" value="class" />
188
+      <option name="VM_PARAMETERS" value="-ea" />
189
+      <option name="PARAMETERS" />
190
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
191
+      <option name="PASS_PARENT_ENVS" value="true" />
192
+      <option name="TEST_SEARCH_SCOPE">
193
+        <value defaultName="singleModule" />
194
+      </option>
195
+      <patterns />
196
+    </configuration>
197
+    <configuration default="true" type="TestNG" factoryName="TestNG">
198
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
199
+      <option name="ALTERNATIVE_JRE_PATH" />
200
+      <option name="SUITE_NAME" />
201
+      <option name="PACKAGE_NAME" />
202
+      <option name="MAIN_CLASS_NAME" />
203
+      <option name="METHOD_NAME" />
204
+      <option name="GROUP_NAME" />
205
+      <option name="TEST_OBJECT" value="CLASS" />
206
+      <option name="VM_PARAMETERS" value="-ea" />
207
+      <option name="PARAMETERS" />
208
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
209
+      <option name="OUTPUT_DIRECTORY" />
210
+      <option name="PASS_PARENT_ENVS" value="true" />
211
+      <option name="TEST_SEARCH_SCOPE">
212
+        <value defaultName="singleModule" />
213
+      </option>
214
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
215
+      <option name="PROPERTIES_FILE" />
216
+      <properties />
217
+      <listeners />
218
+    </configuration>
219
+    <recent_temporary>
220
+      <list>
221
+        <item itemvalue="Application.AccountApp" />
222
+      </list>
223
+    </recent_temporary>
224
+  </component>
225
+  <component name="SvnConfiguration">
226
+    <configuration />
227
+  </component>
228
+  <component name="TaskManager">
229
+    <task active="true" id="Default" summary="Default task">
230
+      <changelist id="fe0069a8-4d2e-4709-993b-6c2459ea40fc" name="Default" comment="" />
231
+      <created>1529102401598</created>
232
+      <option name="number" value="Default" />
233
+      <option name="presentableId" value="Default" />
234
+      <updated>1529102401598</updated>
235
+      <workItem from="1529102403026" duration="3412000" />
236
+      <workItem from="1529186314800" duration="144000" />
237
+      <workItem from="1529247413903" duration="5957000" />
238
+    </task>
239
+    <servers />
240
+  </component>
241
+  <component name="TimeTrackingManager">
242
+    <option name="totallyTimeSpent" value="9513000" />
243
+  </component>
244
+  <component name="ToolWindowManager">
245
+    <frame x="63" y="-950" width="1280" height="880" extended-state="0" />
246
+    <layout>
247
+      <window_info anchor="right" id="Palette" order="3" />
248
+      <window_info anchor="bottom" id="TODO" order="6" />
249
+      <window_info anchor="bottom" id="Messages" order="7" weight="0.32913387" />
250
+      <window_info anchor="right" id="Palette&#9;" order="3" />
251
+      <window_info id="Image Layers" order="2" />
252
+      <window_info anchor="right" id="Capture Analysis" order="3" />
253
+      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.5015625" side_tool="true" visible="true" weight="0.41935483" />
254
+      <window_info anchor="right" id="Maven Projects" order="3" />
255
+      <window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
256
+      <window_info anchor="bottom" id="Version Control" order="7" sideWeight="0.49921876" weight="0.32913387" />
257
+      <window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.4984375" visible="true" weight="0.41935483" />
258
+      <window_info anchor="bottom" id="Terminal" order="7" />
259
+      <window_info id="Capture Tool" order="2" />
260
+      <window_info id="Designer" order="2" />
261
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.25" />
262
+      <window_info anchor="right" id="Database" order="3" />
263
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
264
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
265
+      <window_info id="UI Designer" order="2" />
266
+      <window_info anchor="right" id="Theme Preview" order="3" />
267
+      <window_info id="Favorites" order="2" side_tool="true" />
268
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
269
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
270
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
271
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
272
+      <window_info anchor="bottom" id="Message" order="0" />
273
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
274
+      <window_info anchor="bottom" id="Find" order="1" />
275
+    </layout>
276
+  </component>
277
+  <component name="TypeScriptGeneratedFilesManager">
278
+    <option name="version" value="1" />
279
+  </component>
280
+  <component name="VcsContentAnnotationSettings">
281
+    <option name="myLimit" value="2678400000" />
282
+  </component>
283
+  <component name="XDebuggerManager">
284
+    <breakpoint-manager>
285
+      <option name="time" value="1" />
286
+    </breakpoint-manager>
287
+  </component>
288
+  <component name="editorHistoryManager">
289
+    <entry file="file://$PROJECT_DIR$/pom.xml">
290
+      <provider selected="true" editor-type-id="text-editor">
291
+        <state relative-caret-position="840">
292
+          <caret line="56" column="10" selection-start-line="56" selection-start-column="10" selection-end-line="56" selection-end-column="10" />
293
+        </state>
294
+      </provider>
295
+    </entry>
296
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
297
+      <provider selected="true" editor-type-id="text-editor">
298
+        <state relative-caret-position="945">
299
+          <caret line="63" column="1" selection-start-line="63" selection-start-column="1" selection-end-line="63" selection-end-column="1" />
300
+        </state>
301
+      </provider>
302
+    </entry>
303
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
304
+      <provider selected="true" editor-type-id="text-editor">
305
+        <state relative-caret-position="795">
306
+          <caret line="56" column="8" selection-start-line="56" selection-start-column="8" selection-end-line="56" selection-end-column="8" />
307
+          <folding>
308
+            <element signature="imports" expanded="true" />
309
+          </folding>
310
+        </state>
311
+      </provider>
312
+    </entry>
313
+    <entry file="file://$PROJECT_DIR$/pom.xml">
314
+      <provider selected="true" editor-type-id="text-editor">
315
+        <state relative-caret-position="840">
316
+          <caret line="56" column="10" selection-start-line="56" selection-start-column="10" selection-end-line="56" selection-end-column="10" />
317
+        </state>
318
+      </provider>
319
+    </entry>
320
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
321
+      <provider selected="true" editor-type-id="text-editor">
322
+        <state relative-caret-position="945">
323
+          <caret line="63" column="1" selection-start-line="63" selection-start-column="1" selection-end-line="63" selection-end-column="1" />
324
+        </state>
325
+      </provider>
326
+    </entry>
327
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
328
+      <provider selected="true" editor-type-id="text-editor">
329
+        <state relative-caret-position="795">
330
+          <caret line="56" column="8" selection-start-line="56" selection-start-column="8" selection-end-line="56" selection-end-column="8" />
331
+          <folding>
332
+            <element signature="imports" expanded="true" />
333
+          </folding>
334
+        </state>
335
+      </provider>
336
+    </entry>
337
+    <entry file="file://$PROJECT_DIR$/pom.xml">
338
+      <provider selected="true" editor-type-id="text-editor">
339
+        <state relative-caret-position="840">
340
+          <caret line="68" column="10" selection-start-line="68" selection-start-column="10" selection-end-line="68" selection-end-column="10" />
341
+        </state>
342
+      </provider>
343
+    </entry>
344
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
345
+      <provider selected="true" editor-type-id="text-editor">
346
+        <state>
347
+          <caret column="8" selection-start-column="8" selection-end-column="8" />
348
+        </state>
349
+      </provider>
350
+    </entry>
351
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
352
+      <provider selected="true" editor-type-id="text-editor">
353
+        <state relative-caret-position="62">
354
+          <caret line="70" lean-forward="true" selection-start-line="70" selection-end-line="70" />
355
+          <folding>
356
+            <element signature="imports" expanded="true" />
357
+          </folding>
358
+        </state>
359
+      </provider>
360
+    </entry>
361
+    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
362
+      <provider selected="true" editor-type-id="text-editor">
363
+        <state relative-caret-position="465">
364
+          <caret line="31" column="37" selection-start-line="31" selection-start-column="37" selection-end-line="31" selection-end-column="37" />
365
+          <folding>
366
+            <element signature="e#137#138#0" expanded="true" />
367
+            <element signature="e#173#174#0" expanded="true" />
368
+            <element signature="e#1181#1182#0" expanded="true" />
369
+            <element signature="e#1217#1218#0" expanded="true" />
370
+          </folding>
371
+        </state>
372
+      </provider>
373
+    </entry>
374
+  </component>
375
+  <component name="masterDetails">
376
+    <states>
377
+      <state key="ArtifactsStructureConfigurable.UI">
378
+        <settings>
379
+          <artifact-editor />
380
+          <splitter-proportions>
381
+            <option name="proportions">
382
+              <list>
383
+                <option value="0.2" />
384
+              </list>
385
+            </option>
386
+          </splitter-proportions>
387
+        </settings>
388
+      </state>
389
+      <state key="FacetStructureConfigurable.UI">
390
+        <settings>
391
+          <last-edited>No facets are configured</last-edited>
392
+          <splitter-proportions>
393
+            <option name="proportions">
394
+              <list>
395
+                <option value="0.2" />
396
+              </list>
397
+            </option>
398
+          </splitter-proportions>
399
+        </settings>
400
+      </state>
401
+      <state key="GlobalLibrariesConfigurable.UI">
402
+        <settings>
403
+          <splitter-proportions>
404
+            <option name="proportions">
405
+              <list>
406
+                <option value="0.2" />
407
+              </list>
408
+            </option>
409
+          </splitter-proportions>
410
+        </settings>
411
+      </state>
412
+      <state key="JdkListConfigurable.UI">
413
+        <settings>
414
+          <last-edited>1.8</last-edited>
415
+          <splitter-proportions>
416
+            <option name="proportions">
417
+              <list>
418
+                <option value="0.2" />
419
+              </list>
420
+            </option>
421
+          </splitter-proportions>
422
+        </settings>
423
+      </state>
424
+      <state key="ModuleStructureConfigurable.UI">
425
+        <settings>
426
+          <last-edited>ZCW-ORM-SimpleAccount</last-edited>
427
+          <splitter-proportions>
428
+            <option name="proportions">
429
+              <list>
430
+                <option value="0.2" />
431
+                <option value="0.6" />
432
+              </list>
433
+            </option>
434
+          </splitter-proportions>
435
+        </settings>
436
+      </state>
437
+      <state key="ProjectJDKs.UI">
438
+        <settings>
439
+          <last-edited>1.8</last-edited>
440
+          <splitter-proportions>
441
+            <option name="proportions">
442
+              <list>
443
+                <option value="0.2" />
444
+              </list>
445
+            </option>
446
+          </splitter-proportions>
447
+        </settings>
448
+      </state>
449
+      <state key="ProjectLibrariesConfigurable.UI">
450
+        <settings>
451
+          <last-edited>Maven: com.j256.ormlite:ormlite-core:4.48</last-edited>
452
+          <splitter-proportions>
453
+            <option name="proportions">
454
+              <list>
455
+                <option value="0.2" />
456
+              </list>
457
+            </option>
458
+          </splitter-proportions>
459
+        </settings>
460
+      </state>
461
+    </states>
462
+  </component>
463
+</project>

+ 2
- 0
ZCW-ORM-SimpleAccount.iml Parādīt failu

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

+ 69
- 0
pom.xml Parādīt failu

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
+         xmlns="http://maven.apache.org/POM/4.0.0"
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>groupId</groupId>
8
+    <artifactId>ZCW-ORM-SimpleAccount</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+    <build>
11
+        <plugins>
12
+            <plugin>
13
+                <groupId>org.apache.maven.plugins</groupId>
14
+                <artifactId>maven-compiler-plugin</artifactId>
15
+                <configuration>
16
+                    <source>7</source>
17
+                    <target>7</target>
18
+                </configuration>
19
+            </plugin>
20
+        </plugins>
21
+    </build>
22
+
23
+    <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-core -->
24
+    <dependencies>
25
+        <dependency>
26
+            <groupId>com.j256.ormlite</groupId>
27
+            <artifactId>ormlite-core</artifactId>
28
+            <version>4.48</version>
29
+        </dependency>
30
+
31
+        <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-jdbc -->
32
+        <dependency>
33
+            <groupId>com.j256.ormlite</groupId>
34
+            <artifactId>ormlite-jdbc</artifactId>
35
+            <version>4.48</version>
36
+        </dependency>
37
+
38
+        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
39
+        <dependency>
40
+            <groupId>mysql</groupId>
41
+            <artifactId>mysql-connector-java</artifactId>
42
+            <version>5.1.6</version>
43
+        </dependency>
44
+
45
+        <dependency>
46
+            <groupId>junit</groupId>
47
+            <artifactId>junit</artifactId>
48
+            <version>4.12</version>
49
+            <scope>test</scope>
50
+        </dependency>
51
+
52
+        <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
53
+        <dependency>
54
+            <groupId>org.mockito</groupId>
55
+            <artifactId>mockito-all</artifactId>
56
+            <version>1.9.5</version>
57
+            <scope>test</scope>
58
+        </dependency>
59
+        <dependency>
60
+            <groupId>junit</groupId>
61
+            <artifactId>junit</artifactId>
62
+            <version>RELEASE</version>
63
+            <scope>test</scope>
64
+        </dependency>
65
+
66
+
67
+    </dependencies>
68
+
69
+</project>

+ 64
- 0
src/main/java/Account.java Parādīt failu

1
+import com.j256.ormlite.table.DatabaseTable;
2
+import com.j256.ormlite.field.DatabaseField;
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
+}

+ 117
- 0
src/main/java/AccountApp.java Parādīt failu

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";
10
+
11
+    private Dao<Account, Integer> accountDao;
12
+
13
+    private boolean programActive = true;
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, "root", "");
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
+     * Setup our  DAOs
42
+     */
43
+    private void setupDao(ConnectionSource connectionSource) throws Exception {
44
+
45
+        accountDao = DaoManager.createDao(connectionSource, Account.class);
46
+
47
+    }
48
+
49
+    /**
50
+     * Read and write some example data.
51
+     */
52
+    private void processData() throws Exception {
53
+        console.welcomeScreen();
54
+        while (programActive) {
55
+            menuSelect();
56
+        }
57
+
58
+    }
59
+
60
+    public void menuSelect() throws Exception {
61
+        console.menuOptions();
62
+        switch (console.getMenuSelection()) {
63
+            case "c":
64
+                createAccount(console.getName(), console.getPassword());
65
+                break;
66
+            case "v":
67
+                viewAccount(console.getId());
68
+                break;
69
+            case "n":
70
+                updateAccountName(console.getId(), console.getName());
71
+                break;
72
+            case "p":
73
+                updateAccountPassword(console.getId(),console.getPassword());
74
+                break;
75
+            case "d":
76
+                deleteAccount(console.getId());
77
+                break;
78
+            case "exit":
79
+                exit();
80
+                break;
81
+        }
82
+    }
83
+
84
+    public void createAccount(String name, String password) throws Exception {
85
+        Account account = new Account(name);
86
+        accountDao.create(account);
87
+        account.setPassword(password);
88
+        accountDao.update(account);
89
+    }
90
+
91
+    public void viewAccount(int id) throws Exception {
92
+        Account account = accountDao.queryForId(id);
93
+        console.printAccountDetails(account.getId(), account.getName(), account.getPassword());
94
+    }
95
+
96
+    public void updateAccountName(int id, String name) throws Exception {
97
+        Account account = accountDao.queryForId(id);
98
+        account.setName(name);
99
+        accountDao.update(account);
100
+    }
101
+
102
+    public void updateAccountPassword(int id, String password) throws Exception {
103
+        Account account = accountDao.queryForId(id);
104
+        account.setPassword(password);
105
+        accountDao.update(account);
106
+    }
107
+
108
+    public void deleteAccount(int id) throws Exception{
109
+        Account account = accountDao.queryForId(id);
110
+        accountDao.deleteById(id);
111
+    }
112
+
113
+    public void exit() {
114
+        programActive = false;
115
+        console.exitMessage();
116
+    }
117
+}

+ 45
- 0
src/main/java/Console.java Parādīt failu

1
+import java.util.Scanner;
2
+
3
+public class Console {
4
+
5
+    public void welcomeScreen(){
6
+        System.out.println("Hello! Please select an option from the menu below.");
7
+    }
8
+
9
+    public void menuOptions(){
10
+        System.out.println("(C)reate a new client account.\n(V)iew client account details.\nUpdate client account (n)ame.\nUpdate client account (p)assword.\n(D)elete client account.\n(Exit) to quit program.");
11
+    }
12
+
13
+    public String getMenuSelection(){
14
+        Scanner scanner = new Scanner(System.in);
15
+        return scanner.nextLine().toLowerCase();
16
+    }
17
+
18
+    public String getName(){
19
+        System.out.println("Enter name.");
20
+        Scanner scanner = new Scanner(System.in);
21
+        return scanner.nextLine();
22
+    }
23
+
24
+    public String getPassword(){
25
+        System.out.println("Enter password.");
26
+        Scanner scanner = new Scanner(System.in);
27
+        return scanner.nextLine();
28
+    }
29
+
30
+    public int getId(){
31
+        Scanner scanner = new Scanner(System.in);
32
+        System.out.println("Enter ID.");
33
+        int input = scanner.nextInt();
34
+        scanner.nextLine();
35
+        return input;
36
+    }
37
+
38
+    public void printAccountDetails(int id, String name, String password){
39
+        System.out.println("ID: " + id + "\nName: " + name + "\nPassword: " + password);
40
+    }
41
+
42
+    public void exitMessage(){
43
+        System.out.println("Bye!");
44
+    }
45
+}

Binārs
target/classes/Account.class Parādīt failu


Binārs
target/classes/AccountApp.class Parādīt failu


Binārs
target/classes/Console.class Parādīt failu