Hello, last video I talk about entity object and I show you how with entity option two you can add some validation and how it will affect the ns ATF page. So this is the first component of some model. We talk about it so now to anticipate you I will move to the next component which is a view object. So Let's now move to the WebLogic to the GTFO lover and talk about sis view. This is the view object. Let's talk about the view object The first type of the view object which is created here is a view object based on the entity.
As I told you, as I said before, the view object is the most important component which the user will use in the business You live in. Here if he's a data control you will find here this is actually the view that the view object here will appear into the object will not appear in the object is something related to the model database metadata database table. So in the view object is the component which is a user will drag it into page shows this is the most important component in the ADF business component is the view object. There are four types of the view object. And this is the first type of the view object which is the view object based on the entity how you will know this is based on the entity. If you select the entity object, you will find it is based on the department's entity.
What does it mean? It means that once the user uses view object, so all validation in the entity will apply to this view object as I show you last video, Any validation you add here in the department like while new or tonic key once the user tried to violate this business rules he will get the error message because user work in the view object is is based on the entity object. So, the first type of the view is a view based on the entity object. So it will take the same attribute which it is in the entity object and with the same validation so in the entity object here we say the department is when you you will find here in the view project department is so while new as well is enabling you will find all the evil which we entered in the entity object appear here is the view object.
Same here for the business rule would be only as a department entity object, but for the view Objects The most important thing is a query you cannot check this to see the query. So, here you will find select department ID name manager location from department. So, this is the main query which will return the data from the database. You can add here the weird condition, you can add order by as you want. entity object can has multiple view object based on it. So, let us now try to create an entity object with another entity object based on the department ID entity.
From here, you can just write new view object. You can give here the view object name, we can see. We can say maybe the BART mints view or my department's view. As I said there are four types of them. View object entity based view object or just a select statement it is not entity based or subsequent programmatic or static list for this video now I will talk about the entity based view object it means this view object will be based on the entity. So we can create a necklace and it will ask to whichever entity you would like we have only one entity so I would select the department entity next which attribute from the entity I need all attributes from the entity.
Next Next oak is the query and select Finish Okay. So now we have two view objects both of them are based on this entity. As I said how you will know you can just open the view object entity objects you will find this based on entity department here too is based on entity department. Once you create a view object based on entity or validation labeling we'll get a copy here and you can override it like for example in this mine department I will department will be never updatable for example, while in departments here it will be all sorted department ID will be while new like ns NT. So, you can make some change in the few living in that case, once you use it here, it will take the changes which is overriding the view object level. Okay, so now let's talk about the department view object in bit detail.
Here from shenron, you can know the name of the view object here and the baggage which you where it is. If you want to make some tuning, like you need to with all rules or you can get only up to some number of rows you want only this view object return only always 10 rows so you can get up to 10 rows, whatever you want. In a way we didn't use much in this tuning attributes here, it will get the same attributes, if the view object is based on entity, so we'll get all attributes in this entity. And you can do the same what we did in the entity object, there is no change on it, here's the most important to think is a query. So we are using this department view. So let's run the page and see select all from departments.
So it will get all the BART mins. If for example here say where for example, maybe manager example Less than 200 Okay. So, Save and Run run it. So, it should get only the manager with is less than 100 only get this manager. So, the query or the view object will be splitting the data as you want you can add a condition you can add order boy is there are some binding variables, all this feature in binding variables all you need to create some view criteria. All this we'll talk about it in detail while we are creating a full ADF application at the end of this course.
For for this just, I just want to know what exactly is the feature and the thing is which you can do in each component. But we will go in more and more detail once we create an ETF application. So, now we entity object is entity It is based on if you will know attributes it's the same attributes coming from the entity and you can make override some values if you want. Here the query is the most important thing which you can set what is the query was the where condition you want in this condition you can find some binding variable like wear luxury Tarzan Marham manager for example, we can see us like this. So, you have to defined for example, bar manager is a miss movie number or Lucas it is integral should be same like here is a value, we can see the default value is 150 Okay, so, this is like Using a parameter and of course, you can set this parameter programmatically or from the binding as we will see later.
So, this is a little change it will get less than 150 Okay. It is almost the same. So it's so, this is like if you want to create some binding variable and the synthesis bind variable at runtime, you create a V criteria is one of the most important thing in the view object and the most of things you will work is a view correct. So, what does this view criteria used for now, let us back again to the complete data from the Okay, so now it will get all departments. This is like select the star from departments. So it should get all the departments.
For example, in your ADF application. You want to get Some departments depending on parameters, so you don't need to create a lot of view object. For each condition, you can create a view criteria. For example, in one application, I just don't to get the old departments which has manager equal 100. And in other pages your application I want to get all all departments which location in equal 100. So you don't need to create view of GDP for each of this you have only one view object, which returns all departments and you can create multiple view criteria.
Like for example, I will create view criteria. Okay. I will call the bottom end view criteria manager equal 100 This is view Korea and I will add here manager equal to 100 or equal to binding variable and you can sign set this binding variable at runtime okay and I need another view criteria icon criteria manager equal to hundred So, I will add manager ID equal to 200 So, we create multiple view criteria each of you arteria will get some information from the main view object okay. So, how how we will use this view quality area I will let you know this is can be controlled in in the application module which we are we will talk about it later. But let's select the View object and application module and select your find your list of the viewport area and I see it is equal to 200.
So, once you Select this view criteria here, which will affect here the control Let us now run it should get only department which is equal to manager equal to 200. And you can call this recursively or programmatically you can which will I will show you this later in the programmatic section. So, it will get only one row for which you measure equal to 100 you can select any of you which criteria you want to get or without any viewport area it will get all your object information. So, here it you can define multiple view criteria for one view objects and you can use any view criteria of this. There is one more usage of the view criteria it can be used for that searching and these two values for the lookups. So values and I will talk about it in the next video.
So see you next video