Browse Source

first two parts done

Jose Bedolla 6 years ago
parent
commit
6fc3a54b09

+ 1
- 0
.idea/.name View File

@@ -0,0 +1 @@
1
+ORMLAB

+ 16
- 0
.idea/compiler.xml View File

@@ -0,0 +1,16 @@
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="ORMLAB" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="ORMLAB" target="1.5" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 13
- 0
.idea/libraries/Maven__com_google_protobuf_protobuf_java_2_6_0.xml View File

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: com.google.protobuf:protobuf-java:2.6.0">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.6.0/protobuf-java-2.6.0.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.6.0/protobuf-java-2.6.0-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.6.0/protobuf-java-2.6.0-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__com_j256_ormlite_ormlite_core_4_48.xml View File

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: com.j256.ormlite:ormlite-core:4.48">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-core/4.48/ormlite-core-4.48.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-core/4.48/ormlite-core-4.48-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-core/4.48/ormlite-core-4.48-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__com_j256_ormlite_ormlite_jdbc_4_48.xml View File

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: com.j256.ormlite:ormlite-jdbc:4.48">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-jdbc/4.48/ormlite-jdbc-4.48.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-jdbc/4.48/ormlite-jdbc-4.48-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/com/j256/ormlite/ormlite-jdbc/4.48/ormlite-jdbc-4.48-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/libraries/Maven__mysql_mysql_connector_java_8_0_12.xml View File

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: mysql:mysql-connector-java:8.0.12">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.12/mysql-connector-java-8.0.12.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.12/mysql-connector-java-8.0.12-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/mysql/mysql-connector-java/8.0.12/mysql-connector-java-8.0.12-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
.idea/misc.xml View File

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

+ 8
- 0
.idea/modules.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/ORMLAB.iml" filepath="$PROJECT_DIR$/ORMLAB.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml View File

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

+ 384
- 0
.idea/workspace.xml View File

@@ -0,0 +1,384 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="98671698-8376-45c5-9f1e-a49ae9f47f29" name="Default Changelist" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__com_google_protobuf_protobuf_java_2_6_0.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__com_j256_ormlite_ormlite_core_4_48.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__com_j256_ormlite_ormlite_jdbc_4_48.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_12.xml" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
12
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
13
+      <change afterPath="$PROJECT_DIR$/ORMLAB.iml" afterDir="false" />
14
+      <change afterPath="$PROJECT_DIR$/java/Account.java" afterDir="false" />
15
+      <change afterPath="$PROJECT_DIR$/java/AccountApp.java" afterDir="false" />
16
+      <change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
17
+    </list>
18
+    <ignored path="$PROJECT_DIR$/target/" />
19
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
20
+    <option name="SHOW_DIALOG" value="false" />
21
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
22
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
23
+    <option name="LAST_RESOLUTION" value="IGNORE" />
24
+  </component>
25
+  <component name="FUSProjectUsageTrigger">
26
+    <session id="-263137605">
27
+      <usages-collector id="statistics.lifecycle.project">
28
+        <counts>
29
+          <entry key="project.closed" value="1" />
30
+          <entry key="project.open.time.0" value="1" />
31
+          <entry key="project.opened" value="1" />
32
+        </counts>
33
+      </usages-collector>
34
+      <usages-collector id="statistics.file.extensions.open">
35
+        <counts>
36
+          <entry key="java" value="3" />
37
+          <entry key="xml" value="2" />
38
+        </counts>
39
+      </usages-collector>
40
+      <usages-collector id="statistics.file.types.open">
41
+        <counts>
42
+          <entry key="JAVA" value="3" />
43
+          <entry key="XML" value="2" />
44
+        </counts>
45
+      </usages-collector>
46
+      <usages-collector id="statistics.file.extensions.edit">
47
+        <counts>
48
+          <entry key="java" value="186" />
49
+          <entry key="xml" value="6" />
50
+        </counts>
51
+      </usages-collector>
52
+      <usages-collector id="statistics.file.types.edit">
53
+        <counts>
54
+          <entry key="JAVA" value="186" />
55
+          <entry key="XML" value="6" />
56
+        </counts>
57
+      </usages-collector>
58
+    </session>
59
+  </component>
60
+  <component name="FileEditorManager">
61
+    <leaf>
62
+      <file pinned="false" current-in-tab="false">
63
+        <entry file="file://$PROJECT_DIR$/java/Account.java">
64
+          <provider selected="true" editor-type-id="text-editor">
65
+            <state relative-caret-position="140">
66
+              <caret line="12" column="49" selection-start-line="12" selection-start-column="40" selection-end-line="12" selection-end-column="49" />
67
+              <folding>
68
+                <element signature="imports" expanded="true" />
69
+                <element signature="e#668#669#0" expanded="true" />
70
+                <element signature="e#700#701#0" expanded="true" />
71
+                <element signature="e#844#845#0" expanded="true" />
72
+                <element signature="e#869#870#0" expanded="true" />
73
+                <element signature="e#900#901#0" expanded="true" />
74
+                <element signature="e#927#928#0" expanded="true" />
75
+                <element signature="e#967#968#0" expanded="true" />
76
+                <element signature="e#999#1000#0" expanded="true" />
77
+                <element signature="e#1034#1035#0" expanded="true" />
78
+                <element signature="e#1065#1066#0" expanded="true" />
79
+                <element signature="e#1113#1114#0" expanded="true" />
80
+                <element signature="e#1153#1154#0" expanded="true" />
81
+                <element signature="e#1196#1197#0" expanded="true" />
82
+                <element signature="e#1234#1235#0" expanded="true" />
83
+              </folding>
84
+            </state>
85
+          </provider>
86
+        </entry>
87
+      </file>
88
+      <file pinned="false" current-in-tab="true">
89
+        <entry file="file://$PROJECT_DIR$/java/AccountApp.java">
90
+          <provider selected="true" editor-type-id="text-editor">
91
+            <state relative-caret-position="60">
92
+              <caret line="4" lean-forward="true" selection-start-line="4" selection-end-line="4" />
93
+            </state>
94
+          </provider>
95
+        </entry>
96
+      </file>
97
+      <file pinned="false" current-in-tab="false">
98
+        <entry file="file://$PROJECT_DIR$/pom.xml">
99
+          <provider selected="true" editor-type-id="text-editor">
100
+            <state relative-caret-position="203">
101
+              <caret line="31" column="21" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
102
+            </state>
103
+          </provider>
104
+        </entry>
105
+      </file>
106
+    </leaf>
107
+  </component>
108
+  <component name="FileTemplateManagerImpl">
109
+    <option name="RECENT_TEMPLATES">
110
+      <list>
111
+        <option value="Class" />
112
+      </list>
113
+    </option>
114
+  </component>
115
+  <component name="Git.Settings">
116
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
117
+  </component>
118
+  <component name="IdeDocumentHistory">
119
+    <option name="CHANGED_PATHS">
120
+      <list>
121
+        <option value="$PROJECT_DIR$/java/Account.java" />
122
+        <option value="$PROJECT_DIR$/pom.xml" />
123
+        <option value="$PROJECT_DIR$/java/AccountApp.java" />
124
+      </list>
125
+    </option>
126
+  </component>
127
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
128
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
129
+  <component name="JsGulpfileManager">
130
+    <detection-done>true</detection-done>
131
+    <sorting>DEFINITION_ORDER</sorting>
132
+  </component>
133
+  <component name="MavenImportPreferences">
134
+    <option name="importingSettings">
135
+      <MavenImportingSettings>
136
+        <option name="importAutomatically" value="true" />
137
+      </MavenImportingSettings>
138
+    </option>
139
+  </component>
140
+  <component name="ProjectFrameBounds">
141
+    <option name="x" value="301" />
142
+    <option name="y" value="-960" />
143
+    <option name="width" value="1247" />
144
+    <option name="height" value="680" />
145
+  </component>
146
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
147
+  <component name="ProjectView">
148
+    <navigator proportions="" version="1">
149
+      <foldersAlwaysOnTop value="true" />
150
+    </navigator>
151
+    <panes>
152
+      <pane id="PackagesPane" />
153
+      <pane id="Scope" />
154
+      <pane id="ProjectPane">
155
+        <subPane>
156
+          <expand>
157
+            <path>
158
+              <item name="ORMLAB" type="b2602c69:ProjectViewProjectNode" />
159
+              <item name="ZCW-ORM-SimpleAccount" type="462c0819:PsiDirectoryNode" />
160
+            </path>
161
+          </expand>
162
+          <select />
163
+        </subPane>
164
+      </pane>
165
+    </panes>
166
+  </component>
167
+  <component name="PropertiesComponent">
168
+    <property name="WebServerToolWindowFactoryState" value="false" />
169
+    <property name="aspect.path.notification.shown" value="true" />
170
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1542644870097" />
171
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
172
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
173
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
174
+    <property name="project.structure.last.edited" value="Modules" />
175
+    <property name="project.structure.proportion" value="0.0" />
176
+    <property name="project.structure.side.proportion" value="0.0" />
177
+  </component>
178
+  <component name="RunDashboard">
179
+    <option name="ruleStates">
180
+      <list>
181
+        <RuleState>
182
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
183
+        </RuleState>
184
+        <RuleState>
185
+          <option name="name" value="StatusDashboardGroupingRule" />
186
+        </RuleState>
187
+      </list>
188
+    </option>
189
+  </component>
190
+  <component name="RunManager">
191
+    <configuration name="AccountApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
192
+      <option name="MAIN_CLASS_NAME" value="AccountApp" />
193
+      <module name="ORMLAB" />
194
+      <method v="2">
195
+        <option name="Make" enabled="true" />
196
+      </method>
197
+    </configuration>
198
+    <recent_temporary>
199
+      <list>
200
+        <item itemvalue="Application.AccountApp" />
201
+      </list>
202
+    </recent_temporary>
203
+  </component>
204
+  <component name="SvnConfiguration">
205
+    <configuration />
206
+  </component>
207
+  <component name="TaskManager">
208
+    <task active="true" id="Default" summary="Default task">
209
+      <changelist id="98671698-8376-45c5-9f1e-a49ae9f47f29" name="Default Changelist" comment="" />
210
+      <created>1542574051782</created>
211
+      <option name="number" value="Default" />
212
+      <option name="presentableId" value="Default" />
213
+      <updated>1542574051782</updated>
214
+      <workItem from="1542574053199" duration="7239000" />
215
+    </task>
216
+    <servers />
217
+  </component>
218
+  <component name="TimeTrackingManager">
219
+    <option name="totallyTimeSpent" value="7239000" />
220
+  </component>
221
+  <component name="ToolWindowManager">
222
+    <frame x="301" y="-960" width="1247" height="680" extended-state="0" />
223
+    <editor active="true" />
224
+    <layout>
225
+      <window_info id="Image Layers" />
226
+      <window_info id="Designer" />
227
+      <window_info id="UI Designer" />
228
+      <window_info id="Capture Tool" />
229
+      <window_info id="Favorites" side_tool="true" />
230
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24979253" />
231
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
232
+      <window_info anchor="bottom" id="Messages" weight="0.32993197" />
233
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
234
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
235
+      <window_info anchor="bottom" id="Terminal" />
236
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
237
+      <window_info anchor="bottom" id="Message" order="0" />
238
+      <window_info anchor="bottom" id="Find" order="1" />
239
+      <window_info anchor="bottom" id="Run" order="2" weight="0.5680272" />
240
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
241
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
242
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
243
+      <window_info anchor="bottom" id="TODO" order="6" />
244
+      <window_info anchor="right" id="Palette" />
245
+      <window_info anchor="right" id="Theme Preview" />
246
+      <window_info anchor="right" id="Capture Analysis" />
247
+      <window_info anchor="right" id="Palette&#9;" />
248
+      <window_info anchor="right" id="Database" />
249
+      <window_info anchor="right" id="Maven Projects" />
250
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
251
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
252
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
253
+    </layout>
254
+  </component>
255
+  <component name="TypeScriptGeneratedFilesManager">
256
+    <option name="version" value="1" />
257
+  </component>
258
+  <component name="VcsContentAnnotationSettings">
259
+    <option name="myLimit" value="2678400000" />
260
+  </component>
261
+  <component name="editorHistoryManager">
262
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/src.zip!/java.base/jdk/internal/reflect/NativeConstructorAccessorImpl.java">
263
+      <provider selected="true" editor-type-id="text-editor">
264
+        <state relative-caret-position="-229">
265
+          <caret line="34" column="31" selection-start-line="34" selection-start-column="31" selection-end-line="34" selection-end-column="31" />
266
+        </state>
267
+      </provider>
268
+    </entry>
269
+    <entry file="file://$PROJECT_DIR$/pom.xml">
270
+      <provider selected="true" editor-type-id="text-editor">
271
+        <state relative-caret-position="203">
272
+          <caret line="31" column="21" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
273
+        </state>
274
+      </provider>
275
+    </entry>
276
+    <entry file="file://$PROJECT_DIR$/java/Account.java">
277
+      <provider selected="true" editor-type-id="text-editor">
278
+        <state relative-caret-position="140">
279
+          <caret line="12" column="49" selection-start-line="12" selection-start-column="40" selection-end-line="12" selection-end-column="49" />
280
+          <folding>
281
+            <element signature="imports" expanded="true" />
282
+            <element signature="e#668#669#0" expanded="true" />
283
+            <element signature="e#700#701#0" expanded="true" />
284
+            <element signature="e#844#845#0" expanded="true" />
285
+            <element signature="e#869#870#0" expanded="true" />
286
+            <element signature="e#900#901#0" expanded="true" />
287
+            <element signature="e#927#928#0" expanded="true" />
288
+            <element signature="e#967#968#0" expanded="true" />
289
+            <element signature="e#999#1000#0" expanded="true" />
290
+            <element signature="e#1034#1035#0" expanded="true" />
291
+            <element signature="e#1065#1066#0" expanded="true" />
292
+            <element signature="e#1113#1114#0" expanded="true" />
293
+            <element signature="e#1153#1154#0" expanded="true" />
294
+            <element signature="e#1196#1197#0" expanded="true" />
295
+            <element signature="e#1234#1235#0" expanded="true" />
296
+          </folding>
297
+        </state>
298
+      </provider>
299
+    </entry>
300
+    <entry file="file://$PROJECT_DIR$/java/AccountApp.java">
301
+      <provider selected="true" editor-type-id="text-editor">
302
+        <state relative-caret-position="60">
303
+          <caret line="4" lean-forward="true" selection-start-line="4" selection-end-line="4" />
304
+        </state>
305
+      </provider>
306
+    </entry>
307
+  </component>
308
+  <component name="masterDetails">
309
+    <states>
310
+      <state key="ArtifactsStructureConfigurable.UI">
311
+        <settings>
312
+          <artifact-editor />
313
+          <splitter-proportions>
314
+            <option name="proportions">
315
+              <list>
316
+                <option value="0.2" />
317
+              </list>
318
+            </option>
319
+          </splitter-proportions>
320
+        </settings>
321
+      </state>
322
+      <state key="FacetStructureConfigurable.UI">
323
+        <settings>
324
+          <last-edited>No facets are configured</last-edited>
325
+          <splitter-proportions>
326
+            <option name="proportions">
327
+              <list>
328
+                <option value="0.2" />
329
+              </list>
330
+            </option>
331
+          </splitter-proportions>
332
+        </settings>
333
+      </state>
334
+      <state key="GlobalLibrariesConfigurable.UI">
335
+        <settings>
336
+          <splitter-proportions>
337
+            <option name="proportions">
338
+              <list>
339
+                <option value="0.2" />
340
+              </list>
341
+            </option>
342
+          </splitter-proportions>
343
+        </settings>
344
+      </state>
345
+      <state key="JdkListConfigurable.UI">
346
+        <settings>
347
+          <last-edited>1.8</last-edited>
348
+          <splitter-proportions>
349
+            <option name="proportions">
350
+              <list>
351
+                <option value="0.2" />
352
+              </list>
353
+            </option>
354
+          </splitter-proportions>
355
+        </settings>
356
+      </state>
357
+      <state key="ModuleStructureConfigurable.UI">
358
+        <settings>
359
+          <last-edited>ORMLAB</last-edited>
360
+          <splitter-proportions>
361
+            <option name="proportions">
362
+              <list>
363
+                <option value="0.2" />
364
+                <option value="0.6" />
365
+              </list>
366
+            </option>
367
+          </splitter-proportions>
368
+        </settings>
369
+      </state>
370
+      <state key="ProjectLibrariesConfigurable.UI">
371
+        <settings>
372
+          <last-edited>Maven: com.j256.ormlite:ormlite-core:4.48</last-edited>
373
+          <splitter-proportions>
374
+            <option name="proportions">
375
+              <list>
376
+                <option value="0.2" />
377
+              </list>
378
+            </option>
379
+          </splitter-proportions>
380
+        </settings>
381
+      </state>
382
+    </states>
383
+  </component>
384
+</project>

+ 17
- 0
ORMLAB.iml View File

@@ -0,0 +1,17 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
4
+    <output url="file://$MODULE_DIR$/target/classes" />
5
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
+    <content url="file://$MODULE_DIR$">
7
+      <sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
8
+      <excludeFolder url="file://$MODULE_DIR$/target" />
9
+    </content>
10
+    <orderEntry type="inheritedJdk" />
11
+    <orderEntry type="sourceFolder" forTests="false" />
12
+    <orderEntry type="library" name="Maven: com.j256.ormlite:ormlite-core:4.48" level="project" />
13
+    <orderEntry type="library" name="Maven: com.j256.ormlite:ormlite-jdbc:4.48" level="project" />
14
+    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.12" level="project" />
15
+    <orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
16
+  </component>
17
+</module>

+ 64
- 0
java/Account.java View File

@@ -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
+}

+ 68
- 0
java/AccountApp.java View File

@@ -0,0 +1,68 @@
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
+import java.util.Scanner;
7
+
8
+public class AccountApp {
9
+
10
+    // we are using a MySQl database
11
+    private final static String DATABASE_URL = "jdbc:mysql://localhost:3306/orm_lab?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
12
+
13
+    private Dao<Account, Integer> accountDao;
14
+
15
+    public static void main(String[] args) throws Exception {
16
+        // turn our static method into an instance of Main
17
+        new AccountApp().doMain(args);
18
+    }
19
+
20
+    private void doMain(String[] args) throws Exception {
21
+        ConnectionSource connectionSource = null;
22
+        try {
23
+            // create our data-source for the database
24
+            connectionSource = new JdbcConnectionSource(DATABASE_URL, "root", "morol3on");
25
+            // setup our  DAOs
26
+            setupDao(connectionSource);
27
+            // read, write and delete some data
28
+            processData();
29
+
30
+            System.out.println("\n\nIt seems to have worked\n\n");
31
+            Scanner sc = new Scanner(System.in);
32
+            sc.next();
33
+        } finally {
34
+            // destroy the data source which should close underlying connections
35
+            if (connectionSource != null) {
36
+                connectionSource.close();
37
+            }
38
+        }
39
+    }
40
+
41
+    /**
42
+     * Read and write some example data.
43
+     */
44
+    private void processData() throws Exception {
45
+        // create an instance of Account
46
+        String name = "Jim Coakley";
47
+        Account account = new Account(name);
48
+
49
+        // persist the account object to the database
50
+        accountDao.create(account);
51
+        int id = account.getId();
52
+        System.out.println(id);
53
+        // assign a password
54
+        account.setPassword("_secret");
55
+        // update the database after changing the object
56
+        accountDao.update(account);
57
+        // delete the account
58
+        //accountDao.deleteById(id);
59
+    }
60
+    /**
61
+     * Setup our  DAOs
62
+     */
63
+    private void setupDao(ConnectionSource connectionSource) throws Exception {
64
+
65
+        accountDao = DaoManager.createDao(connectionSource, Account.class);
66
+
67
+    }
68
+}

+ 36
- 0
pom.xml View File

@@ -0,0 +1,36 @@
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>io.zipcoder</groupId>
8
+    <artifactId>ORMLAB</artifactId>
9
+    <version>1.0-SNAPSHOT</version>
10
+
11
+    <dependencies>
12
+
13
+        <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-core -->
14
+        <dependency>
15
+            <groupId>com.j256.ormlite</groupId>
16
+            <artifactId>ormlite-core</artifactId>
17
+            <version>4.48</version>
18
+        </dependency>
19
+
20
+        <!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-jdbc -->
21
+        <dependency>
22
+            <groupId>com.j256.ormlite</groupId>
23
+            <artifactId>ormlite-jdbc</artifactId>
24
+            <version>4.48</version>
25
+        </dependency>
26
+
27
+        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
28
+        <dependency>
29
+            <groupId>mysql</groupId>
30
+            <artifactId>mysql-connector-java</artifactId>
31
+            <version>8.0.12</version>
32
+        </dependency>
33
+
34
+    </dependencies>
35
+
36
+</project>

BIN
target/classes/Account.class View File


BIN
target/classes/AccountApp.class View File