Hello, in this video I will show you how After you create the entity object, you need to make some changes database level and how we will update the entity object. I will give you an example here for student student students are a student here I need to add a create date or there is a start date or the data is as a date which is a student is registered to the system it is not existing here. So, I will need to add a new columns database and all you will show you how you can add this this this new column will not exist in the script which is attach it you have to do it manually. I will keep it like this that you can do it. So here first change will be in the database level. So I will edit the student table here and I can create a new Column core student student created date and it will be of type date okay.
So, this is a new column I created here as a student a breeze okay. So I need this column to be appear here in the entity object so you have two option from here you can add attribute from table okay you will find here student Curie D, you can shorten it or you can right click here and and choose synchronize with a database. It will give you the what is the difference it will select this and you can brace bris synchronous So, both are okay, you can make it legs And you press ok you will find the new column here, student created date is coming in the entity, this is how you can sync between your entity and the table in case you make some change in the table level and you want to make some sync between both of them again. So, in this student date, this should be as a default value as a current date.
So, once the principal create a new student disagrees, it should be coming by default, so here I am back again here to Java. And I should right here Sit student created date. Here I need to get the current date I will go to the zone model util again and I will create here method which will return the current date as a date for date as timestamp format this is the function which will return the current date in the timestamp format I will use Java SQL to timestamp okay so now here in the suit me I just will call get a current date I just can't get a utility date and from a till date you can just write you a timestamps of the timestamp and return the time. So here I just will call module util. dot get acquainted. So, this is the default values and this is how you can sync the entity with the database level.
So, I guess after this changes There is no more configuration is entity level. I will just quickly have a brief description within the labels for all entity attributes. We see the date format for the date attributes, we set the default values. As you can see here, we set the alternate key is or is in the alternate key. I'll show you how you can sync between the entity and in the database table. From the kista video I will jump into their view object and see what is the configuration we can do in the view object.
So see you negativity