Play everybody.
So now it's time to override the uncreate method that we inherit from this is to light up and help her
class.
So if I hold on to comment on my keyboard and then click on a school like an helper here you can see
that it is actually an abstract class.
So what is an abstract class an abstract class is a class that contains one or more accurately abstract
methods.
So what is and what is an abstract method and abstract and if it is an effort that does not have and
then an implementation.
So let me search for the uncreate method here.
Let me actually show you the uncreate method here.
So here it is the uncreate method.
Right.
You can see that it is actually an abstract method.
This if it does if it accepts an argument of type as you like database and it does not have any implementations.
So let's go to the data handler class after the constructor.
I can just type in and create.
So now I can pro-white an implementation for this.
Uncreate method.
So remember this uncreate method is an abstract method.
Inside this school I often helper class.
Right.
So let's go inside the curly braces of this uncreate Mefford and let's actually put our own logic here.
So why do we have to implement this class.
Because if we want to actually create our database our school database we must put our codes the database
creation cost actually inside this uncreate method.
So let's go inside this Meffert and we can now we can say.
So inside this uncreate Meffert let's create a variable of types 3 in the name of this variable is going
to be create database s u l assignment operator.
Here we need to put two quotes here and we need to put the L command in order to create an SD like database
for our application.
So it is very important.
Just type in here create a space table space.
This is really important that you put our space here right and then put on a concatenation operator
plus operator here and here we need to put the table name.
So we created a constant here for this table in a martial arts table.
So just step in here martial arts table right.
Plus So here we must specify the rows of our table so just put two coats here and then poods actually
open in prentices here space and just put up a concatenation operator here.
After these coats.
So the first actually the first row is going to be for the key.
So just type in here Id key with capital key right now that we have this ID key Let's put actually another
concatenation operator Plus space two quotes space.
So Id keep plus actually.
And then here we have these two coats here and then put space inside these coats.
And now we need to specify the type of this are the key.
OK.
It is going to be of the interior right.
The idea is going to be off that I so I can say integer primary key primary key auto increment auto
increment.
So when I say integer primary key auto increment it means that the value of the ID of each marshal is
going to be of that integer primary key auto increment means that it is going to be actually incremented
automatically the ID is going to be specified for each marginal object automatically.
We do not have to worry about this idea anymore.
When I say integer primary key auto increment.
OK so for not just here this is the type of this ID.
Right.
This is the type of this ID you need to specify this search and actually row.
So let me create a new line here.
So let me just create a new line here so that you can see these values better.
So first you say create table space marshal or table plus.
And then we need to specify the rows.
So this is the first throw.
I put up a and in practice this year space the key plus and I put two coats here.
I put up space here.
Integer primary key auto increment.
So now after this is called I put another concatenation operator.
Let's create a new line here and I put two coats here and here I need to specify the second row.
So I just put a comma here.
This is really important comma space and after these codes I put a plus operator here and then I'm going
to refer to the second row name which is going to be this one Name Key.
So I can see Name Key plus.
And here I must specify that data type of this name which is of type strange but in S2 let me say it
is of type text.
So I just put two quotes here space and here I want to say text.
Right this means that this is of type.
Strange.
So after this code I put a plus OPERATOR Two quotes comma space and then after this goes again I put
another plus operator.
So now we need to specify the other key which is the price key.
So I can't say price key right.
And then he had a full A-plus OPERATOR Two coats.
And here I put our space and now I need to specify that data type of this.
Press TV is going to be of type float.
So data in a school like we say that it is a big deal.
So I can't say really all right.
And then here I put another plus.
Operator.
Let me create a new line.
So now we need to specify the final row.
So again just put two coats here comma space plus.
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
string.
So just type in here text and now after this code is put another plus operator to coats space and just
close this plant this is the end in Prentice's here and finally put a semicolon here.
So this is our Eski will come on right create table.
And this is the name of it of the table martial arts table plus I put actually two coats here and I
put this open in parenthesis here plus ID key.
So this is the first row plus.
And here inside the coats I put a space first and then we specify the data type of this ID which is
integer primary key also increment plus.
And then I put two coats come on space plus add and this is the second row which is going to be the
name key plus space.
And here you can see in say the course space text plus coats.
And here we have a comma space plus Kreisky plus two coats.
Space real plus two coats come on space plus color key plus.
And here this is that data type of this color.
So I just put two codes.
Space takes.
And finally I put another concatenation operator and I put two coats and I put space here and I close
this plant is this semi-colon.
So this is our rescue l.com and this is very important that it must be like this here.
Otherwise our leader when we want to actually just referred to our database or application is going
to crash.
If you just type it in a runway for example if you forget to put a comma here your application is going
to crash.
Right.
It is very important so just make sure that your command is the same as mine here.
This is how you create a table if you want to use as you are as you like in order to save your data
or to your database.
So that's it.
So here you can see that we have this argument of type as you are Escuela database that we actually
get from this uncreate method.
So we have a reference to the actual database right.
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
as you l.com and which is of type string.
So if we have this come on here create a database Escurial that's it.
So it's going to create that database for us by using this as tool here.
This will come in.
So now after this uncreate Smurfette I am going to actually create another method.
So here we must override and another actually method here.
And this is called an upgrade on upgrade.
So through this method.
So this method is going to be actually called when our current database religion is updated.
This is because this is actually the first version of our database.
This is the Smurfette is not going to be called but later on for example when you want to update your
database.
And when you want to upgrade your database this method is going to be called.
So let's put some logic here.
So here I can see D.V. that execute as well.
And inside Apprentice's just put two double quotes at inside the code.
Just type in here.
Drop table if exists I then put my space here.
So now after these courts just put A-plus plus operator and then referred to the martial arts table.
Right.
If you want to for example upgrade our database version it's going to drop the current version of the
database and then we are going to call the uncreate method again.
So uncreate So we actually overlay these uncreate here right.
So we need to pass a value of that as soon as you light it up.
So we get that from this method.
DB Right.
So that's it.
These are the methods that are necessary in order to if you want to actually work with the light help
open helper class.
We must override these two methods.
So now you can see that we have no errors inside this class in the next story or we're going to go ahead
and we're going to actually create some Misfit's in order to add a modular object to the database in
order to delete almost an object from the database.
And another method in order to update the current marshal or object.
So thank you very much for watching.
And I see in the next tutorial.