1
00:00:00,180 --> 00:00:01,020
Hello everyone.

2
00:00:01,140 --> 00:00:08,850
So in this story we are going to add another method in order to allow the user to update the new light.

3
00:00:08,910 --> 00:00:12,290
Ok to update our specific martial art object inside the school light.

4
00:00:12,380 --> 00:00:17,510
So after the end in the place of this method is martial art object from databased my ID.

5
00:00:17,760 --> 00:00:23,670
And before the end in curly brace of this class martial art actually a database handler before the ading

6
00:00:23,670 --> 00:00:24,900
calibrator of this class.

7
00:00:24,900 --> 00:00:33,460
I'm going to create another method so public voit updates all I can say modify its more meaningful modify

8
00:00:34,150 --> 00:00:40,090
martial art object modified martial art object and put a pair of Prentice's here.

9
00:00:40,180 --> 00:00:47,380
So if you want to specify the ID so int martial arts I-T come up and then add the second prime if it

10
00:00:47,380 --> 00:00:53,380
is going to be off the upstreams martial arts name martial art name Karma.

11
00:00:53,520 --> 00:00:56,100
So now you need to specify the first argument.

12
00:00:56,130 --> 00:01:00,470
Right the first privater but there is a problem here let me show that problem to you here.

13
00:01:00,660 --> 00:01:05,780
Inside is uncreate method where we created this as Q As your database here.

14
00:01:05,970 --> 00:01:09,180
You can see that for the price key.

15
00:01:09,240 --> 00:01:11,920
We said that the data type is going to be real.

16
00:01:11,970 --> 00:01:14,960
Real means floats or decimal value.

17
00:01:15,200 --> 00:01:21,720
And if I go to this a martial art class you can see that if actually created an instance variable for

18
00:01:21,720 --> 00:01:25,440
this modular price here and the data type is integer.

19
00:01:25,440 --> 00:01:26,530
So this is wrong.

20
00:01:26,730 --> 00:01:29,540
OK it should be of type double right.

21
00:01:29,610 --> 00:01:34,830
So if we actually change the data type of this small the price to double.

22
00:01:35,040 --> 00:01:38,000
So let's actually also change this specific method.

23
00:01:38,010 --> 00:01:44,820
For example they get here for this instance value but which the return type should be double OK and

24
00:01:45,450 --> 00:01:49,830
we have also this setter for this Marshall Price.

25
00:01:49,870 --> 00:01:53,700
You can see that the data type of this argument or privater is affect integer.

26
00:01:53,730 --> 00:01:55,470
So let's change the state to double.

27
00:01:55,500 --> 00:01:57,130
Right now the problem is solved.

28
00:01:57,150 --> 00:02:03,180
Now if I go to this database handler class we can see that because we specified that at the price key

29
00:02:03,270 --> 00:02:07,280
is of hyperreal which is actually double a decimal value here.

30
00:02:07,590 --> 00:02:13,840
Now we can go into the Smurfette modify emotional objects and for the first parameter the data type

31
00:02:13,840 --> 00:02:15,100
should be double.

32
00:02:15,300 --> 00:02:21,120
Ok i should it must be double and then we must specify the name which is going to be a martial art twice

33
00:02:21,210 --> 00:02:21,970
martial art.

34
00:02:22,080 --> 00:02:23,940
Price.

35
00:02:23,980 --> 00:02:28,630
So let me create a new line here so that you can see what's going on here exactly.

36
00:02:28,790 --> 00:02:30,590
So now come on.

37
00:02:30,730 --> 00:02:35,980
And here we need to specify define all Prime which is going to be of type string and the name is martial

38
00:02:35,980 --> 00:02:36,240
arts.

39
00:02:36,240 --> 00:02:38,430
Color martial art color.

40
00:02:38,440 --> 00:02:42,070
So let's open and closed this method by using these curly braces.

41
00:02:42,190 --> 00:02:47,950
So inside the body of the Smurfit I can't say so first of all we need to have a reference to the writer

42
00:02:48,090 --> 00:02:53,910
database so I can't say it's q like database database assignment operator.

43
00:02:53,950 --> 00:02:56,630
Get the right table database semicolon.

44
00:02:57,070 --> 00:03:04,960
So notice that when I say Cathro table database I am calling this method on an instance of this database

45
00:03:04,960 --> 00:03:06,000
handler class.

46
00:03:06,100 --> 00:03:12,640
OK the start gate gets writable database in this way we can actually access this method because the

47
00:03:12,640 --> 00:03:20,060
state of his handler class is and actually is a light open help look at this math class here.

48
00:03:20,080 --> 00:03:23,100
Database handler is a school that open helper.

49
00:03:23,170 --> 00:03:26,890
So that's why we can't call this gets right up and gets right over the top.

50
00:03:27,190 --> 00:03:29,700
So let me delete this here at the start.

51
00:03:29,800 --> 00:03:31,940
So now after this line of code I can't say.

52
00:03:31,960 --> 00:03:39,120
So let's create of idea of type string here so strange and the name of a valuable is going to be update

53
00:03:39,790 --> 00:03:44,090
or modify modify martial arts.

54
00:03:45,540 --> 00:03:49,600
Martial art is to l.com an assignment operator.

55
00:03:49,710 --> 00:04:01,080
So I just say to put two quotes here and then I can't see update update space or key update space plus.

56
00:04:01,400 --> 00:04:08,380
And I just need to refer to these monsters table plus Let's create a new line here and then put two

57
00:04:08,380 --> 00:04:09,660
quotes here.

58
00:04:09,850 --> 00:04:23,930
Two double quotes actually and in space said space plus named je ne ke plus and then put two quotes

59
00:04:23,930 --> 00:04:27,820
here and space equal operator.

60
00:04:28,010 --> 00:04:36,560
And here after this equal operator we need to put a single code here k and then after these codes just

61
00:04:36,560 --> 00:04:42,900
put a concatenation operator and refer to this martial arts name argument.

62
00:04:43,010 --> 00:04:49,040
So I can say martial arts name and let's put another can and issue an operator here.

63
00:04:49,070 --> 00:04:54,020
Let's create a new line here and again put two quotes here.

64
00:04:54,020 --> 00:05:02,320
Come on space and then after these quotes another concatenation operator and this time refer to these.

65
00:05:02,420 --> 00:05:13,580
Actually to this price key so I can just say price cheap plus to quote space equal operator space single

66
00:05:13,580 --> 00:05:20,280
quotes after these quotes just put concatenation operator and then refer to this martial arts prize

67
00:05:20,290 --> 00:05:20,840
here.

68
00:05:20,960 --> 00:05:23,600
This argument martial arts prize.

69
00:05:23,690 --> 00:05:27,980
So now let's actually put another concatenation operator here.

70
00:05:28,010 --> 00:05:34,640
Let me tell you that we forgot to put the end in a code I didn't send a single code of these martial

71
00:05:34,640 --> 00:05:35,390
arts in here.

72
00:05:35,450 --> 00:05:41,420
So you can see that after this equal operator here we put this single quote here in order to put this

73
00:05:41,420 --> 00:05:44,010
Montral our name inside the single quotes.

74
00:05:44,090 --> 00:05:45,540
But this is the first single code.

75
00:05:45,560 --> 00:05:49,240
And the final single code should be after this name right.

76
00:05:49,250 --> 00:05:56,030
So here inside these codes before this come all of you need to put a single code here so that this martial

77
00:05:56,030 --> 00:05:59,240
arts name here is going to be inside these single cards.

78
00:05:59,330 --> 00:05:59,810
Right.

79
00:05:59,840 --> 00:06:05,160
Because are using these concatenation operators in order to contaminate these values together.

80
00:06:05,420 --> 00:06:10,940
So again and here we said price plus two cards equal.

81
00:06:11,090 --> 00:06:15,590
And then here we put the single card here plus Marshall Price.

82
00:06:15,830 --> 00:06:18,180
And again we put this plus here.

83
00:06:18,420 --> 00:06:20,030
Let me create a new line here.

84
00:06:20,120 --> 00:06:26,350
And I just need to put two quotes here again another single quote here come comma space.

85
00:06:26,480 --> 00:06:29,130
And finally you need to put the colored key right.

86
00:06:29,210 --> 00:06:38,250
So plus color key plus two coats space equal space single code.

87
00:06:38,690 --> 00:06:43,750
And then after these codes just put a plus operator and this time refers to this marshal or a color

88
00:06:43,760 --> 00:06:46,360
actually the martial art color.

89
00:06:46,470 --> 00:06:48,980
Plus let's create a new line here.

90
00:06:49,950 --> 00:06:55,740
And just put two coats here and put the final Actually the final single code here in order to put this

91
00:06:55,740 --> 00:06:58,140
martial art color inside these single coats.

92
00:06:58,140 --> 00:06:58,720
Right.

93
00:06:59,030 --> 00:07:03,080
And here because we don't have any other cheese here we don't.

94
00:07:03,090 --> 00:07:07,250
We must not put the comma here OK because it's finished.

95
00:07:07,500 --> 00:07:09,130
And now I just say.

96
00:07:09,210 --> 00:07:13,280
Just put our space here after this single code just put a space.

97
00:07:13,360 --> 00:07:20,850
Don't put a comma here just put a space here and then put a plus year and put two coats here and just

98
00:07:20,850 --> 00:07:32,490
type in here where space plus she Id actually the ID key id key actually a plus two quotes space equal

99
00:07:32,490 --> 00:07:39,660
operator space plus and refer to the smashing of ID martial art ID semi-colon.

100
00:07:39,910 --> 00:07:46,890
So this is the SU command if you want to actually update your school database database.

101
00:07:46,930 --> 00:07:49,060
So in order to do that you need to have this come on here.

102
00:07:49,060 --> 00:07:49,600
Right.

103
00:07:49,600 --> 00:07:52,960
So firstly you say update space martial arts table.

104
00:07:52,960 --> 00:07:56,360
So we want to update our martial arts table right plus.

105
00:07:56,560 --> 00:08:02,880
And then we say space set space named ciii plus.

106
00:08:02,890 --> 00:08:10,840
And then if we say equal operator and we assign marshal that name to the name key here and then we say

107
00:08:11,050 --> 00:08:16,910
okay after this one we say price ske space equal operator space.

108
00:08:16,920 --> 00:08:24,450
Marshall Price and then we specify the color key we said Marshal of color we assign the marshal of colors

109
00:08:24,450 --> 00:08:25,280
to these kind of cheap.

110
00:08:25,500 --> 00:08:33,340
And then we say where Id key is equal to marshal or ID right.

111
00:08:33,390 --> 00:08:40,290
So if the user wants to update our specific martial art the user must pass these values to these methods.

112
00:08:40,340 --> 00:08:46,950
MARSHALL The name Marshall Price and martial art color in this way that specific martial art object

113
00:08:46,950 --> 00:08:52,740
is going to be updated in the database like this is this kulak comment and let me tell you that this

114
00:08:53,180 --> 00:08:55,230
will come and here is very important.

115
00:08:55,230 --> 00:08:58,640
Your comment must be actually the same as mine here.

116
00:08:58,740 --> 00:09:04,110
Dont forget to put a comma here for example if you forget to put this comma here later when you want

117
00:09:04,110 --> 00:09:07,320
to refer to the Smurfit if you forget to put the comma.

118
00:09:07,500 --> 00:09:09,130
Your application is going to crash.

119
00:09:09,220 --> 00:09:11,590
OK so I'll talk more about this later.

120
00:09:11,610 --> 00:09:16,380
I will talk more about how we can actually debug your school applications.

121
00:09:16,500 --> 00:09:19,680
But for now just know that there is light come on here.

122
00:09:19,680 --> 00:09:22,070
This comment is very important.

123
00:09:22,080 --> 00:09:31,930
And finally I just need to say database that as you well modify the martial art command modified martial

124
00:09:31,950 --> 00:09:33,820
or you will comment.

125
00:09:33,840 --> 00:09:38,830
And finally if you need to close the database database that close that's it.

126
00:09:39,120 --> 00:09:42,400
So now I can't say if that's enough for this tutorial.

127
00:09:42,440 --> 00:09:46,760
It's just really got to create another method inside the database handler class.

128
00:09:47,010 --> 00:09:47,500
So.

129
00:09:47,580 --> 00:09:48,630
Thank you very much for watching.

130
00:09:48,630 --> 00:09:52,740
If you have any questions about the concepts that they told you so far please suppose the discussion

131
00:09:52,740 --> 00:09:55,510
in the course and then I do my best to answer all of your questions.

