Kaynağa Gözat

More changes

Whitney Martinez 6 yıl önce
ebeveyn
işleme
0d4c064471

+ 109
- 65
.idea/workspace.xml Dosyayı Görüntüle

@@ -3,11 +3,12 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="fef9ff3b-ca8c-4f4d-811e-e01ed8ef169a" name="Default Changelist" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
-      <change beforePath="$PROJECT_DIR$/src/main/java/Account.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Account.java" afterDir="false" />
7 6
       <change beforePath="$PROJECT_DIR$/src/main/java/AccountApp.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountApp.java" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/src/main/java/AccountService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountService.java" afterDir="false" />
9 7
       <change beforePath="$PROJECT_DIR$/src/main/java/Console.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Console.java" afterDir="false" />
10
-      <change beforePath="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/AccountServiceTest.java" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/target/classes/Account.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/Account.class" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/target/classes/AccountApp.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/AccountApp.class" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/target/classes/Console.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/Console.class" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/target/test-classes/AccountServiceTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/AccountServiceTest.class" afterDir="false" />
11 12
     </list>
12 13
     <ignored path="$PROJECT_DIR$/out/" />
13 14
     <ignored path="$PROJECT_DIR$/target/" />
@@ -51,11 +52,12 @@
51 52
     <session id="-2012361872">
52 53
       <usages-collector id="statistics.lifecycle.project">
53 54
         <counts>
54
-          <entry key="project.closed" value="2" />
55
-          <entry key="project.open.time.3" value="1" />
55
+          <entry key="project.closed" value="4" />
56
+          <entry key="project.open.time.3" value="2" />
57
+          <entry key="project.open.time.4" value="1" />
56 58
           <entry key="project.open.time.5" value="1" />
57 59
           <entry key="project.open.time.9" value="1" />
58
-          <entry key="project.opened" value="3" />
60
+          <entry key="project.opened" value="5" />
59 61
         </counts>
60 62
       </usages-collector>
61 63
       <usages-collector id="statistics.file.extensions.open">
@@ -64,29 +66,29 @@
64 66
           <entry key="JAVA/Account" value="1" />
65 67
           <entry key="JavaScript-modules-diagram//Users/whitneymartinez/Labs/Week5/ZCW-ORM-SimpleAccount/src/main/java" value="1" />
66 68
           <entry key="class" value="2" />
67
-          <entry key="java" value="9" />
69
+          <entry key="java" value="11" />
68 70
           <entry key="sql" value="1" />
69
-          <entry key="xml" value="1" />
71
+          <entry key="xml" value="2" />
70 72
         </counts>
71 73
       </usages-collector>
72 74
       <usages-collector id="statistics.file.types.open">
73 75
         <counts>
74 76
           <entry key="CLASS" value="2" />
75
-          <entry key="JAVA" value="9" />
77
+          <entry key="JAVA" value="11" />
76 78
           <entry key="Scratch" value="1" />
77 79
           <entry key="UML" value="4" />
78
-          <entry key="XML" value="1" />
80
+          <entry key="XML" value="2" />
79 81
         </counts>
80 82
       </usages-collector>
81 83
       <usages-collector id="statistics.file.extensions.edit">
82 84
         <counts>
83
-          <entry key="java" value="4080" />
85
+          <entry key="java" value="4294" />
84 86
           <entry key="xml" value="7" />
85 87
         </counts>
86 88
       </usages-collector>
87 89
       <usages-collector id="statistics.file.types.edit">
88 90
         <counts>
89
-          <entry key="JAVA" value="4080" />
91
+          <entry key="JAVA" value="4294" />
90 92
           <entry key="XML" value="7" />
91 93
         </counts>
92 94
       </usages-collector>
@@ -95,18 +97,21 @@
95 97
   <component name="FileEditorManager">
96 98
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
97 99
       <file pinned="false" current-in-tab="false">
100
+        <entry file="file://$PROJECT_DIR$/pom.xml">
101
+          <provider selected="true" editor-type-id="text-editor">
102
+            <state relative-caret-position="285">
103
+              <caret line="19" column="18" selection-start-line="19" selection-start-column="18" selection-end-line="19" selection-end-column="18" />
104
+            </state>
105
+          </provider>
106
+        </entry>
107
+      </file>
108
+      <file pinned="false" current-in-tab="false">
98 109
         <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
99 110
           <provider selected="true" editor-type-id="text-editor">
100
-            <state relative-caret-position="420">
101
-              <caret line="28" column="25" lean-forward="true" selection-start-line="28" selection-start-column="25" selection-end-line="28" selection-end-column="25" />
111
+            <state relative-caret-position="750">
112
+              <caret line="66" column="5" selection-start-line="66" selection-start-column="5" selection-end-line="66" selection-end-column="5" />
102 113
               <folding>
103 114
                 <element signature="imports" expanded="true" />
104
-                <element signature="e#668#669#0" expanded="true" />
105
-                <element signature="e#700#701#0" expanded="true" />
106
-                <element signature="e#844#845#0" expanded="true" />
107
-                <element signature="e#869#870#0" expanded="true" />
108
-                <element signature="e#902#903#0" expanded="true" />
109
-                <element signature="e#930#931#0" expanded="true" />
110 115
               </folding>
111 116
             </state>
112 117
           </provider>
@@ -115,8 +120,20 @@
115 120
       <file pinned="false" current-in-tab="false">
116 121
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
117 122
           <provider selected="true" editor-type-id="text-editor">
118
-            <state relative-caret-position="601">
119
-              <caret line="46" column="39" selection-start-line="46" selection-start-column="39" selection-end-line="46" selection-end-column="39" />
123
+            <state relative-caret-position="840">
124
+              <caret line="56" lean-forward="true" selection-start-line="56" selection-end-line="56" />
125
+              <folding>
126
+                <element signature="imports" expanded="true" />
127
+              </folding>
128
+            </state>
129
+          </provider>
130
+        </entry>
131
+      </file>
132
+      <file pinned="false" current-in-tab="false">
133
+        <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
134
+          <provider selected="true" editor-type-id="text-editor">
135
+            <state relative-caret-position="1196">
136
+              <caret line="111" column="18" selection-start-line="111" selection-start-column="18" selection-end-line="111" selection-end-column="18" />
120 137
               <folding>
121 138
                 <element signature="imports" expanded="true" />
122 139
               </folding>
@@ -125,10 +142,26 @@
125 142
         </entry>
126 143
       </file>
127 144
       <file pinned="false" current-in-tab="true">
145
+        <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
146
+          <provider selected="true" editor-type-id="text-editor">
147
+            <state relative-caret-position="204">
148
+              <caret line="47" column="21" selection-start-line="47" selection-start-column="21" selection-end-line="47" selection-end-column="21" />
149
+              <folding>
150
+                <element signature="imports" expanded="true" />
151
+              </folding>
152
+            </state>
153
+          </provider>
154
+        </entry>
155
+      </file>
156
+      <file pinned="false" current-in-tab="false">
128 157
         <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
129 158
           <provider selected="true" editor-type-id="text-editor">
130
-            <state relative-caret-position="346">
131
-              <caret line="38" column="5" lean-forward="true" selection-start-line="38" selection-start-column="5" selection-end-line="38" selection-end-column="5" />
159
+            <state relative-caret-position="200">
160
+              <caret line="35" selection-start-line="35" selection-end-line="35" />
161
+              <folding>
162
+                <element signature="e#842#843#0" expanded="true" />
163
+                <element signature="e#873#874#0" expanded="true" />
164
+              </folding>
132 165
             </state>
133 166
           </provider>
134 167
         </entry>
@@ -136,8 +169,8 @@
136 169
       <file pinned="false" current-in-tab="false">
137 170
         <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
138 171
           <provider selected="true" editor-type-id="text-editor">
139
-            <state relative-caret-position="465">
140
-              <caret line="125" selection-start-line="125" selection-end-line="125" />
172
+            <state relative-caret-position="218">
173
+              <caret line="19" column="74" lean-forward="true" selection-start-line="19" selection-start-column="74" selection-end-line="19" selection-end-column="74" />
141 174
               <folding>
142 175
                 <element signature="imports" expanded="true" />
143 176
               </folding>
@@ -193,11 +226,22 @@
193 226
       </MavenImportingSettings>
194 227
     </option>
195 228
   </component>
196
-  <component name="ProjectFrameBounds" extendedState="1">
197
-    <option name="x" value="190" />
198
-    <option name="y" value="75" />
199
-    <option name="width" value="890" />
200
-    <option name="height" value="709" />
229
+  <component name="MavenProjectNavigator">
230
+    <treeState>
231
+      <expand>
232
+        <path>
233
+          <item name="" type="16c1761:MavenProjectsStructure$RootNode" />
234
+          <item name="ormsql" type="9519ce18:MavenProjectsStructure$ProjectNode" />
235
+        </path>
236
+      </expand>
237
+      <select />
238
+    </treeState>
239
+  </component>
240
+  <component name="ProjectFrameBounds">
241
+    <option name="x" value="40" />
242
+    <option name="y" value="74" />
243
+    <option name="width" value="1218" />
244
+    <option name="height" value="613" />
201 245
   </component>
202 246
   <component name="ProjectView">
203 247
     <navigator proportions="" version="1">
@@ -321,7 +365,9 @@
321 365
       <updated>1542472590688</updated>
322 366
       <workItem from="1542472595444" duration="17001000" />
323 367
       <workItem from="1542638526297" duration="2309000" />
324
-      <workItem from="1542659351017" duration="1134000" />
368
+      <workItem from="1542659351017" duration="1153000" />
369
+      <workItem from="1542726614951" duration="1534000" />
370
+      <workItem from="1542736848940" duration="8243000" />
325 371
     </task>
326 372
     <servers />
327 373
   </component>
@@ -340,14 +386,14 @@
340 386
     </history-entry>
341 387
   </component>
342 388
   <component name="TimeTrackingManager">
343
-    <option name="totallyTimeSpent" value="20444000" />
389
+    <option name="totallyTimeSpent" value="30240000" />
344 390
   </component>
345 391
   <component name="ToolWindowManager">
346
-    <frame x="190" y="75" width="890" height="709" extended-state="1" />
392
+    <frame x="40" y="74" width="1218" height="613" extended-state="1" />
347 393
     <editor active="true" />
348 394
     <layout>
349
-      <window_info content_ui="combo" id="Project" order="0" weight="0.2606132" />
350
-      <window_info active="true" id="Structure" order="1" side_tool="true" visible="true" weight="0.25" />
395
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.23639455" />
396
+      <window_info id="Structure" order="1" side_tool="true" weight="0.20706107" />
351 397
       <window_info id="Image Layers" order="2" />
352 398
       <window_info id="Designer" order="3" />
353 399
       <window_info id="UI Designer" order="4" />
@@ -355,7 +401,7 @@
355 401
       <window_info id="Favorites" order="6" side_tool="true" />
356 402
       <window_info anchor="bottom" id="Message" order="0" />
357 403
       <window_info anchor="bottom" id="Find" order="1" />
358
-      <window_info anchor="bottom" id="Run" order="2" weight="0.32901135" />
404
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.2284069" />
359 405
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
360 406
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
361 407
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -373,7 +419,7 @@
373 419
       <window_info anchor="right" id="Database" order="5" weight="0.25425246" />
374 420
       <window_info anchor="right" id="Theme Preview" order="6" />
375 421
       <window_info anchor="right" id="Palette&#9;" order="7" />
376
-      <window_info anchor="right" id="Maven Projects" order="8" />
422
+      <window_info anchor="right" id="Maven Projects" order="8" weight="0.32900944" />
377 423
     </layout>
378 424
     <layout-to-restore>
379 425
       <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2606132" />
@@ -586,71 +632,69 @@
586 632
     </entry>
587 633
     <entry file="file://$PROJECT_DIR$/pom.xml">
588 634
       <provider selected="true" editor-type-id="text-editor">
589
-        <state relative-caret-position="270">
590
-          <caret line="30" column="65" selection-start-line="30" selection-start-column="65" selection-end-line="30" selection-end-column="65" />
635
+        <state relative-caret-position="285">
636
+          <caret line="19" column="18" selection-start-line="19" selection-start-column="18" selection-end-line="19" selection-end-column="18" />
591 637
         </state>
592 638
       </provider>
593 639
     </entry>
594
-    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
640
+    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
595 641
       <provider selected="true" editor-type-id="text-editor">
596
-        <state relative-caret-position="705">
597
-          <caret line="47" column="21" selection-start-line="47" selection-start-column="21" selection-end-line="47" selection-end-column="21" />
642
+        <state relative-caret-position="750">
643
+          <caret line="66" column="5" selection-start-line="66" selection-start-column="5" selection-end-line="66" selection-end-column="5" />
598 644
           <folding>
599 645
             <element signature="imports" expanded="true" />
600 646
           </folding>
601 647
         </state>
602 648
       </provider>
603 649
     </entry>
604
-    <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
650
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
605 651
       <provider selected="true" editor-type-id="text-editor">
606
-        <state relative-caret-position="659">
607
-          <caret line="111" column="18" selection-start-line="111" selection-start-column="18" selection-end-line="111" selection-end-column="18" />
652
+        <state relative-caret-position="218">
653
+          <caret line="19" column="74" lean-forward="true" selection-start-line="19" selection-start-column="74" selection-end-line="19" selection-end-column="74" />
608 654
           <folding>
609 655
             <element signature="imports" expanded="true" />
610 656
           </folding>
611 657
         </state>
612 658
       </provider>
613 659
     </entry>
614
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountService.java">
660
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
615 661
       <provider selected="true" editor-type-id="text-editor">
616
-        <state relative-caret-position="465">
617
-          <caret line="125" selection-start-line="125" selection-end-line="125" />
662
+        <state relative-caret-position="840">
663
+          <caret line="56" lean-forward="true" selection-start-line="56" selection-end-line="56" />
618 664
           <folding>
619 665
             <element signature="imports" expanded="true" />
620 666
           </folding>
621 667
         </state>
622 668
       </provider>
623 669
     </entry>
624
-    <entry file="file://$PROJECT_DIR$/src/main/java/Account.java">
670
+    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
625 671
       <provider selected="true" editor-type-id="text-editor">
626
-        <state relative-caret-position="420">
627
-          <caret line="28" column="25" lean-forward="true" selection-start-line="28" selection-start-column="25" selection-end-line="28" selection-end-column="25" />
672
+        <state relative-caret-position="200">
673
+          <caret line="35" selection-start-line="35" selection-end-line="35" />
628 674
           <folding>
629
-            <element signature="imports" expanded="true" />
630
-            <element signature="e#668#669#0" expanded="true" />
631
-            <element signature="e#700#701#0" expanded="true" />
632
-            <element signature="e#844#845#0" expanded="true" />
633
-            <element signature="e#869#870#0" expanded="true" />
634
-            <element signature="e#902#903#0" expanded="true" />
635
-            <element signature="e#930#931#0" expanded="true" />
675
+            <element signature="e#842#843#0" expanded="true" />
676
+            <element signature="e#873#874#0" expanded="true" />
636 677
           </folding>
637 678
         </state>
638 679
       </provider>
639 680
     </entry>
640
-    <entry file="file://$PROJECT_DIR$/src/main/java/AccountApp.java">
681
+    <entry file="file://$PROJECT_DIR$/src/test/java/MockDao.java">
641 682
       <provider selected="true" editor-type-id="text-editor">
642
-        <state relative-caret-position="601">
643
-          <caret line="46" column="39" selection-start-line="46" selection-start-column="39" selection-end-line="46" selection-end-column="39" />
683
+        <state relative-caret-position="1196">
684
+          <caret line="111" column="18" selection-start-line="111" selection-start-column="18" selection-end-line="111" selection-end-column="18" />
644 685
           <folding>
645 686
             <element signature="imports" expanded="true" />
646 687
           </folding>
647 688
         </state>
648 689
       </provider>
649 690
     </entry>
650
-    <entry file="file://$PROJECT_DIR$/src/main/java/Console.java">
691
+    <entry file="file://$PROJECT_DIR$/src/test/java/AccountServiceTest.java">
651 692
       <provider selected="true" editor-type-id="text-editor">
652
-        <state relative-caret-position="346">
653
-          <caret line="38" column="5" lean-forward="true" selection-start-line="38" selection-start-column="5" selection-end-line="38" selection-end-column="5" />
693
+        <state relative-caret-position="204">
694
+          <caret line="47" column="21" selection-start-line="47" selection-start-column="21" selection-end-line="47" selection-end-column="21" />
695
+          <folding>
696
+            <element signature="imports" expanded="true" />
697
+          </folding>
654 698
         </state>
655 699
       </provider>
656 700
     </entry>

+ 16
- 9
src/main/java/AccountApp.java Dosyayı Görüntüle

@@ -28,6 +28,7 @@ public class AccountApp {
28 28
             // create data-source for db
29 29
             connectionSource = new JdbcConnectionSource(DATABASE_URL,"root","");
30 30
             setupDao(connectionSource);
31
+            processData();
31 32
         } finally {
32 33
             c.print("Laters!");
33 34
             if (connectionSource !=null){
@@ -47,26 +48,32 @@ public class AccountApp {
47 48
         System.out.println("This is the Database Manager!\n");
48 49
 
49 50
         while (continueMenu){
50
-
51 51
             c.printMenu();
52
-            String input = c.printingOutAStringInput("Select by the number: ");
53
-            if(input.equals("1")){
52
+            c.printingOutAStringInput("Select by the number: ");
53
+            c.line();
54
+           switch (c.nextInt()){
55
+
56
+            case 1:
54 57
 
55 58
                 Account creatingAcc = accountService.createNewAccount();
56 59
                 accountService.create(creatingAcc);
57
-            }else if (input.equals("2")){
60
+                break;
61
+            case 2:
58 62
 
59 63
                 accountService.readingAllTheAccounts(accountService.read());
60
-            }else if (input.equals("3")){
64
+                break;
65
+            case 3:
61 66
 
62 67
                 accountService.fullUppdatingMenu();
68
+                break;
63 69
 
64
-            }else if (input.equals("4")) {
65
-
66
-                accountService.deleteEverythingInTheMenu();
67
-            }else{
70
+            case 4:
71
+                   accountService.deleteEverythingInTheMenu();
72
+                   break;
68 73
 
74
+            default:
69 75
                 continueMenu = false;
76
+
70 77
             }
71 78
 
72 79
         }

+ 8
- 2
src/main/java/Console.java Dosyayı Görüntüle

@@ -38,6 +38,11 @@ public class Console {
38 38
 
39 39
     }
40 40
 
41
+
42
+    public String line(){
43
+       return in.nextLine();
44
+    }
45
+
41 46
     public void goodByeAll(){
42 47
 
43 48
         System.out.println("U+2605U+2605U+2605U+2605U+2605U+2605U+2605");
@@ -51,13 +56,14 @@ public class Console {
51 56
     }
52 57
 
53 58
     public void print(String s) {
54
-        System.out.println(s);
59
+
60
+       System.out.println(s);
55 61
     }
56 62
 
57 63
     public void printMenu() {
58 64
         System.out.println("Menu Screen: \n"
59 65
                 + "1: New Account - Like it saids\n"
60
-                + "2: Read - Listing all the accounts \n "
66
+                + "2: Read - Listing all the accounts \n"
61 67
                 + "3: Update - Update an existing account \n"
62 68
                 + "4: Deleting - Existing accounts are now deleted \n"
63 69
                 + "5: Quit - Exit the menu \n");

BIN
target/classes/Account.class Dosyayı Görüntüle


BIN
target/classes/AccountApp.class Dosyayı Görüntüle


BIN
target/classes/Console.class Dosyayı Görüntüle


BIN
target/test-classes/AccountServiceTest.class Dosyayı Görüntüle