1
00:00:00,180 --> 00:00:00,800
Play everybody.

2
00:00:00,810 --> 00:00:07,020
So now it's time to override the uncreate method that we inherit from this is to light up and help her

3
00:00:07,230 --> 00:00:07,900
class.

4
00:00:08,130 --> 00:00:13,560
So if I hold on to comment on my keyboard and then click on a school like an helper here you can see

5
00:00:13,560 --> 00:00:15,650
that it is actually an abstract class.

6
00:00:15,690 --> 00:00:22,950
So what is an abstract class an abstract class is a class that contains one or more accurately abstract

7
00:00:22,950 --> 00:00:23,660
methods.

8
00:00:23,670 --> 00:00:28,980
So what is and what is an abstract method and abstract and if it is an effort that does not have and

9
00:00:28,980 --> 00:00:30,220
then an implementation.

10
00:00:30,420 --> 00:00:33,620
So let me search for the uncreate method here.

11
00:00:34,140 --> 00:00:36,830
Let me actually show you the uncreate method here.

12
00:00:36,870 --> 00:00:38,380
So here it is the uncreate method.

13
00:00:38,400 --> 00:00:39,090
Right.

14
00:00:39,090 --> 00:00:42,150
You can see that it is actually an abstract method.

15
00:00:42,170 --> 00:00:48,590
This if it does if it accepts an argument of type as you like database and it does not have any implementations.

16
00:00:48,720 --> 00:00:52,580
So let's go to the data handler class after the constructor.

17
00:00:52,590 --> 00:00:54,710
I can just type in and create.

18
00:00:54,720 --> 00:00:58,620
So now I can pro-white an implementation for this.

19
00:00:58,650 --> 00:00:59,930
Uncreate method.

20
00:01:00,150 --> 00:01:03,660
So remember this uncreate method is an abstract method.

21
00:01:03,690 --> 00:01:06,070
Inside this school I often helper class.

22
00:01:06,120 --> 00:01:06,660
Right.

23
00:01:06,870 --> 00:01:12,530
So let's go inside the curly braces of this uncreate Mefford and let's actually put our own logic here.

24
00:01:12,630 --> 00:01:14,980
So why do we have to implement this class.

25
00:01:15,090 --> 00:01:24,390
Because if we want to actually create our database our school database we must put our codes the database

26
00:01:24,390 --> 00:01:28,020
creation cost actually inside this uncreate method.

27
00:01:28,050 --> 00:01:31,350
So let's go inside this Meffert and we can now we can say.

28
00:01:31,530 --> 00:01:36,960
So inside this uncreate Meffert let's create a variable of types 3 in the name of this variable is going

29
00:01:36,960 --> 00:01:41,400
to be create database s u l assignment operator.

30
00:01:41,400 --> 00:01:48,120
Here we need to put two quotes here and we need to put the L command in order to create an SD like database

31
00:01:48,270 --> 00:01:49,290
for our application.

32
00:01:49,290 --> 00:01:50,620
So it is very important.

33
00:01:50,820 --> 00:01:56,940
Just type in here create a space table space.

34
00:01:56,940 --> 00:02:02,730
This is really important that you put our space here right and then put on a concatenation operator

35
00:02:02,730 --> 00:02:06,760
plus operator here and here we need to put the table name.

36
00:02:06,810 --> 00:02:11,380
So we created a constant here for this table in a martial arts table.

37
00:02:11,400 --> 00:02:14,620
So just step in here martial arts table right.

38
00:02:14,640 --> 00:02:22,800
Plus So here we must specify the rows of our table so just put two coats here and then poods actually

39
00:02:22,820 --> 00:02:28,300
open in prentices here space and just put up a concatenation operator here.

40
00:02:28,320 --> 00:02:29,890
After these coats.

41
00:02:29,910 --> 00:02:35,260
So the first actually the first row is going to be for the key.

42
00:02:35,280 --> 00:02:45,210
So just type in here Id key with capital key right now that we have this ID key Let's put actually another

43
00:02:45,210 --> 00:02:50,460
concatenation operator Plus space two quotes space.

44
00:02:50,700 --> 00:02:52,970
So Id keep plus actually.

45
00:02:52,980 --> 00:02:58,550
And then here we have these two coats here and then put space inside these coats.

46
00:02:58,700 --> 00:03:02,850
And now we need to specify the type of this are the key.

47
00:03:03,050 --> 00:03:03,670
OK.

48
00:03:03,690 --> 00:03:05,160
It is going to be of the interior right.

49
00:03:05,160 --> 00:03:12,960
The idea is going to be off that I so I can say integer primary key primary key auto increment auto

50
00:03:13,500 --> 00:03:14,250
increment.

51
00:03:14,250 --> 00:03:21,570
So when I say integer primary key auto increment it means that the value of the ID of each marshal is

52
00:03:21,570 --> 00:03:27,900
going to be of that integer primary key auto increment means that it is going to be actually incremented

53
00:03:27,930 --> 00:03:33,390
automatically the ID is going to be specified for each marginal object automatically.

54
00:03:33,390 --> 00:03:36,430
We do not have to worry about this idea anymore.

55
00:03:36,480 --> 00:03:39,810
When I say integer primary key auto increment.

56
00:03:40,030 --> 00:03:44,380
OK so for not just here this is the type of this ID.

57
00:03:44,430 --> 00:03:44,850
Right.

58
00:03:44,850 --> 00:03:50,800
This is the type of this ID you need to specify this search and actually row.

59
00:03:50,820 --> 00:03:53,610
So let me create a new line here.

60
00:03:53,670 --> 00:03:57,920
So let me just create a new line here so that you can see these values better.

61
00:03:58,140 --> 00:04:02,680
So first you say create table space marshal or table plus.

62
00:04:02,700 --> 00:04:04,100
And then we need to specify the rows.

63
00:04:04,100 --> 00:04:05,430
So this is the first throw.

64
00:04:05,700 --> 00:04:11,870
I put up a and in practice this year space the key plus and I put two coats here.

65
00:04:11,910 --> 00:04:13,320
I put up space here.

66
00:04:13,320 --> 00:04:15,580
Integer primary key auto increment.

67
00:04:15,600 --> 00:04:20,040
So now after this is called I put another concatenation operator.

68
00:04:20,130 --> 00:04:26,990
Let's create a new line here and I put two coats here and here I need to specify the second row.

69
00:04:27,090 --> 00:04:28,590
So I just put a comma here.

70
00:04:28,590 --> 00:04:35,760
This is really important comma space and after these codes I put a plus operator here and then I'm going

71
00:04:35,760 --> 00:04:40,360
to refer to the second row name which is going to be this one Name Key.

72
00:04:40,470 --> 00:04:43,770
So I can see Name Key plus.

73
00:04:43,980 --> 00:04:50,100
And here I must specify that data type of this name which is of type strange but in S2 let me say it

74
00:04:50,100 --> 00:04:51,720
is of type text.

75
00:04:51,780 --> 00:04:56,110
So I just put two quotes here space and here I want to say text.

76
00:04:56,130 --> 00:04:58,030
Right this means that this is of type.

77
00:04:58,080 --> 00:04:58,970
Strange.

78
00:04:59,040 --> 00:05:07,210
So after this code I put a plus OPERATOR Two quotes comma space and then after this goes again I put

79
00:05:07,210 --> 00:05:08,580
another plus operator.

80
00:05:08,830 --> 00:05:13,220
So now we need to specify the other key which is the price key.

81
00:05:13,330 --> 00:05:16,570
So I can't say price key right.

82
00:05:16,870 --> 00:05:19,950
And then he had a full A-plus OPERATOR Two coats.

83
00:05:19,960 --> 00:05:25,360
And here I put our space and now I need to specify that data type of this.

84
00:05:25,370 --> 00:05:27,780
Press TV is going to be of type float.

85
00:05:27,970 --> 00:05:31,130
So data in a school like we say that it is a big deal.

86
00:05:31,150 --> 00:05:34,600
So I can't say really all right.

87
00:05:35,090 --> 00:05:37,730
And then here I put another plus.

88
00:05:37,730 --> 00:05:38,880
Operator.

89
00:05:39,170 --> 00:05:40,640
Let me create a new line.

90
00:05:40,820 --> 00:05:42,760
So now we need to specify the final row.

91
00:05:42,830 --> 00:05:47,830
So again just put two coats here comma space plus.

92
00:05:47,900 --> 00:05:54,800
So the final row is going to be the color key so color key plus two code so it is going to be of type

93
00:05:54,800 --> 00:05:55,250
string.

94
00:05:55,250 --> 00:06:05,180
So just type in here text and now after this code is put another plus operator to coats space and just

95
00:06:05,210 --> 00:06:10,230
close this plant this is the end in Prentice's here and finally put a semicolon here.

96
00:06:10,280 --> 00:06:14,460
So this is our Eski will come on right create table.

97
00:06:14,660 --> 00:06:21,350
And this is the name of it of the table martial arts table plus I put actually two coats here and I

98
00:06:21,350 --> 00:06:24,290
put this open in parenthesis here plus ID key.

99
00:06:24,290 --> 00:06:26,220
So this is the first row plus.

100
00:06:26,240 --> 00:06:31,400
And here inside the coats I put a space first and then we specify the data type of this ID which is

101
00:06:31,400 --> 00:06:33,990
integer primary key also increment plus.

102
00:06:34,040 --> 00:06:38,780
And then I put two coats come on space plus add and this is the second row which is going to be the

103
00:06:38,780 --> 00:06:41,020
name key plus space.

104
00:06:41,060 --> 00:06:45,460
And here you can see in say the course space text plus coats.

105
00:06:45,500 --> 00:06:51,310
And here we have a comma space plus Kreisky plus two coats.

106
00:06:51,350 --> 00:06:57,580
Space real plus two coats come on space plus color key plus.

107
00:06:57,680 --> 00:06:59,920
And here this is that data type of this color.

108
00:06:59,930 --> 00:07:01,450
So I just put two codes.

109
00:07:01,490 --> 00:07:02,560
Space takes.

110
00:07:02,660 --> 00:07:09,080
And finally I put another concatenation operator and I put two coats and I put space here and I close

111
00:07:09,140 --> 00:07:11,300
this plant is this semi-colon.

112
00:07:11,330 --> 00:07:16,200
So this is our rescue l.com and this is very important that it must be like this here.

113
00:07:16,460 --> 00:07:21,920
Otherwise our leader when we want to actually just referred to our database or application is going

114
00:07:21,920 --> 00:07:22,420
to crash.

115
00:07:22,430 --> 00:07:28,250
If you just type it in a runway for example if you forget to put a comma here your application is going

116
00:07:28,250 --> 00:07:29,210
to crash.

117
00:07:29,210 --> 00:07:29,660
Right.

118
00:07:29,660 --> 00:07:34,400
It is very important so just make sure that your command is the same as mine here.

119
00:07:34,410 --> 00:07:40,470
This is how you create a table if you want to use as you are as you like in order to save your data

120
00:07:40,470 --> 00:07:42,430
or to your database.

121
00:07:42,500 --> 00:07:43,210
So that's it.

122
00:07:43,220 --> 00:07:48,800
So here you can see that we have this argument of type as you are Escuela database that we actually

123
00:07:48,800 --> 00:07:50,340
get from this uncreate method.

124
00:07:50,600 --> 00:07:53,790
So we have a reference to the actual database right.

125
00:07:53,810 --> 00:08:01,110
So I can say D-B that execute as well just call this in effect and B and here we just need to pass there

126
00:08:01,240 --> 00:08:03,130
as you l.com and which is of type string.

127
00:08:03,200 --> 00:08:07,700
So if we have this come on here create a database Escurial that's it.

128
00:08:07,700 --> 00:08:12,780
So it's going to create that database for us by using this as tool here.

129
00:08:12,880 --> 00:08:13,780
This will come in.

130
00:08:13,820 --> 00:08:19,050
So now after this uncreate Smurfette I am going to actually create another method.

131
00:08:19,160 --> 00:08:23,680
So here we must override and another actually method here.

132
00:08:23,720 --> 00:08:27,260
And this is called an upgrade on upgrade.

133
00:08:27,290 --> 00:08:28,450
So through this method.

134
00:08:28,700 --> 00:08:36,600
So this method is going to be actually called when our current database religion is updated.

135
00:08:36,710 --> 00:08:39,530
This is because this is actually the first version of our database.

136
00:08:39,530 --> 00:08:44,360
This is the Smurfette is not going to be called but later on for example when you want to update your

137
00:08:44,360 --> 00:08:45,530
database.

138
00:08:45,530 --> 00:08:48,580
And when you want to upgrade your database this method is going to be called.

139
00:08:48,590 --> 00:08:50,580
So let's put some logic here.

140
00:08:50,600 --> 00:08:54,960
So here I can see D.V. that execute as well.

141
00:08:55,100 --> 00:08:59,520
And inside Apprentice's just put two double quotes at inside the code.

142
00:08:59,540 --> 00:09:00,320
Just type in here.

143
00:09:00,320 --> 00:09:06,190
Drop table if exists I then put my space here.

144
00:09:06,390 --> 00:09:11,640
So now after these courts just put A-plus plus operator and then referred to the martial arts table.

145
00:09:11,910 --> 00:09:12,540
Right.

146
00:09:12,780 --> 00:09:18,510
If you want to for example upgrade our database version it's going to drop the current version of the

147
00:09:18,510 --> 00:09:22,340
database and then we are going to call the uncreate method again.

148
00:09:22,590 --> 00:09:26,210
So uncreate So we actually overlay these uncreate here right.

149
00:09:26,220 --> 00:09:30,020
So we need to pass a value of that as soon as you light it up.

150
00:09:30,030 --> 00:09:32,040
So we get that from this method.

151
00:09:32,080 --> 00:09:33,950
DB Right.

152
00:09:34,050 --> 00:09:34,730
So that's it.

153
00:09:34,740 --> 00:09:40,950
These are the methods that are necessary in order to if you want to actually work with the light help

154
00:09:41,250 --> 00:09:42,770
open helper class.

155
00:09:42,960 --> 00:09:45,010
We must override these two methods.

156
00:09:45,020 --> 00:09:50,040
So now you can see that we have no errors inside this class in the next story or we're going to go ahead

157
00:09:50,070 --> 00:09:57,960
and we're going to actually create some Misfit's in order to add a modular object to the database in

158
00:09:57,960 --> 00:10:00,200
order to delete almost an object from the database.

159
00:10:00,210 --> 00:10:05,030
And another method in order to update the current marshal or object.

160
00:10:05,060 --> 00:10:06,510
So thank you very much for watching.

161
00:10:06,510 --> 00:10:07,830
And I see in the next tutorial.

