Hello, last video we are we talk about the entity object, I quickly went through the entity objects what is a feature for an object, but to have some type of imagination on how this changes in into object will affect in the intubation level. So let's now quickly create it page and we should make some change in entity object and sees the effect of this change in sub agents itself. So I will just quickly now create a new page. I will call it depart. myths. Okay.
Here and I just will track departments here as table If table okay sorting filtering single row I will talk about this detail in detail once we go to the View Controller just need to create a simple and quick beach and we will make some changes the entity object level and we will see how it will works to have a look in this structure to see windows and we can open this structure is right okay so here we have a form with a single one call to this try to add create bottom here okay and delete if you want to make some operations as you can see it is more simple and easy and we can create a compliment or tone and for Well, that's fine. I just sorry I went was done in a group. Here we don't need to make any code. There is no code at all.
As you can see, okay. Here's this is a quick pitch. Okay, I carry it for a department with some operation is carried insert created, delete, commit and rollback. Okay, so let's run the page here. It will have an error on the embedded WebLogic. So it runs a bit of logic and it will deploy his application and runs a bitch.
Okay, so now let's back again to the entity object and we need to make some modification and add some validation and we should check it and if it is, which helps this will, will work. So first, as you can see here, department ID I said it is updatable only while new, so we will see it right now. I add here, alternate key for department name. And I add the business rule for for this so we can check how how's error message a bit. If I enter the department name already exists. We add some label here so we can see this label enzyme in the page says Okay, so let's see all this validation and labeling, which we added up appeared in the page.
So it is still running with logic. So all this validation rule is the entity object before the row is inserted or go to the database it has to go first through the entity object. So once the user create a new row and try to commit the changes, it will not reach to this database unless it go first to through the entity object and it checks all validation. Here the WebLogic is already sorted and deploy it now and this is pitch Okay, so as you can see now, the department ID is read only, we can't update the value while the rest of fields are open. Why the department is a read only because we see here department. While new a bit about only why new What does it mean?
It means one if I create a new euro, the department ID will be on this thread. If you press Create for this is a auto operation it is a table with create you will find the department ID here is open because this is a new row. Okay, so let's try it for example. 500 Okay, let's try to make something okay, let's take one away one. So department ID open because we should only why new. We can see this is a test And we can commit save, once it is saved, you will find it become read only the user will not be able to make a change.
Because this change what we talked about which we are talking about, if we make it always save and run it again the document ID should be all open if it's new or not. So let's see it now. You will find that worked with all of it. So this is the first a validation or first change you can do in the entity object and it will affect in the page itself. So let us make it while new. And let's try the second one which is alternate key for the department name.
We sit here in business rule if the what we do is is an alternate key so if the user tries to enter a department name which is already exist he should see this message. So let's see how it works here. Let me change copy this and I will watch it here as the forum marketing okay is this is committed rollback I think has to be amended rollback you could support a variety of years and remove says disable okay so save okay so here in marketing I will call it here let me see what see see the department name is already exist because We defined alternate key for the department name that it should not be Repeat as well not only primary key, this is like alternate key. So, this is a second thing we add as you can see as well here department ID name manager location is that they will which we entered it here.
So, if you change it like the name yes Save and run again you will find here okay. So, this is you have to stop on deploy and is in progress for removing the vacation wants it done you can run sometimes it happened. If there are some changes in the model, you have to stop our on deploys application and run it again. So here we'll find the name. So, the labeling of the column or if it is informed, it will read from this label attribute. Now it is a comeback department ID as a read only because we return it back as a while new.
As you can see, the birth with a D is a mandatory the birth name in name is a mandatory manager and allegation is not so if you create and try to commit he will give you a mandatory because this is required and this is required. All these kind of features we did Rebecca to consider was this point of feature we created without even writing any code. This is about four of the ADF frameworks. This is how the entity object is affecting the wages is a bitch near validation. As you can see, it is more simple and it is more easy. Next video, let us move to the second component which is the view object.
See you next video.