Hello, in ADF business component zamata layer, we talk about the entity object view object and we talk about application modules. So, we almost cover the model layer components. The only missing two boys is Association and view links. This is two simple components. I will talk about it this video. So let's go back to the developer and see what is Association and what is view link.
Okay, so now we cover entity object view object application modules. In this video I will talk about Association what is Association association is the relation between two entities So, if you have two entity and you want to make some link between both of them you would create an association This is the association what it is symbol. So, if you have a department's entity list create now a new entity called employee entity map to the employee table and try to create some connection between both of these. So, how you will create an entity object right click new entity object as I said before, entity object is a table is mapped to a table. So here he will ask you what is the schema object what is the table you will you are mapped to I will map this to the entity Okay. Next, this is all attributes of the entity Yes.
So all the information was an attribute okay. Ok. So, next here if you ask you if you want to create a view object based on this entity or not, and if you want to add this view object is application module or not. So, this is just to simplify instead of you create the view object. So, I will not create it and I will do it manually. So, that you will be able to see it but in generally I would just get it straight away here and write the package name, but let me create it manually So, that you would be able to see how to create this Next and Finish Okay, so, as you can see, the whole association is automatically created, but anyway I will create it again, because there are already in the database level, draw a link between the ultimate and the will is this Why he wants to create the entity and buoy it automatically creates a substitution because it reads it from the database.
But let me delete all of this assistant and I would create it manually so that you would be able to see how to create Association. Let's lead this okay and this leads us I prefer that the base can have no links, no constraint, nothing just to blame tables, and you can add the own validation and links in a business component delivery. So now we have a department and we have employee as you can see here, St. Louis has a department ID. So there are a connection between department and employee department like a monster and in bill we it like a detail So, if you want to create a link between both of these two entities this link called Association so let's just create association between both of these two entity. So I will create a new or view link okay there is Association easier Association okay.
So I can say depart meant as am we okay this is a session. So you will find here is it is one to many relation you will find here is entity object in the right and into the objects listed in the left. So, I will say the department ID here will map to the department ID Enza Enki This is the link or you will add a link say one to many From the department ID it has a list of employees and this is attribute as employees which is a foreign key for the departments. So, this is the association. Next, Next Next thing is finished now we are creating the association between department and employee. So, what this the reason why you we are creating this association between two entities, actually we use it in tourism, we need an association between entity not that much important.
The link in between is much important why we'll talk about it later. So, for association is a link between two entity object. We use it in two reasons. First one is in a programmatic way if you if you are in the monster and you want to get List of the employees you can get it from Association straightaway or if you are in the employee and need to get the parent of this employee from Association, you will be able to it this is when in the programmatic way you will able to use Association. The second reason association is you can create a view link based on Association as we will see now, but for now, you should be able to know that association is the links between the link between two entity objects. We will go now for the view object level and I need to make some relation between two view object this relation or link called view link.
This is the fifth component of ADF business components. So, the first component we took with entity object second component is a view object 30 components is application module for the component Is Association fifth component and the last component is view links. So, view links is a relation between view objects and this is a one of the most important things you will use to create like a master detail if you have master detail in the page as we will see it now you will use a view neck. So, let's now create a view object we have now with the button interview object but we don't have a inventory view object you have to you you you have two options to create department or sorry in between view based on employee entity, you can right click in on the entity and you can create a new default view object.
In that case, it will create a view object based on this entity or you can carry it You view object and you can select as an entity here. So you have two ways you can create view object based on entities whatever suits you. So are you just right click on the entity object and the new default view object and I will add it is the vo package, okay and this is name. So it will create a view object based on entity. If you open the entity you will find this base entity, that's fine. So let's now create a view link between departments and inventory.
Because this view link will make you able to create master detail in the page. So I will right click new view link. So I can say the link Okay because of your creating view link, you will find retrieval will automatically get a list of the view Object Mode into the object list of the view object IDs all right and lifts the relation between one to many. So I will say department ID in the we department right you can make something like this so you can say I need a relation between departments and in Bluey. To be from the department ID I need to get two filters MPV from department ID foreign key, this is one option. But I didn't recommend it this if you have Association, so, you can carry it to you link like this as a solution.
It will work fine, no problem. Or you can use Association as a view link, so you create an assistant And you already mapped the department ID to the department IDs employee. So if when you create a unique you can select the association in the state of Surrey selecting the attribute itself to exist you can select as usual what is the benefit of this as I said in one entity object you can create multiple view objects. So if you make any change in association link, it will map automatically to all other view object view links. So now I have a link between two view objects but I select the association okay nickers nickers nickers nickers to finish. So now we are creating a view link between the birth meant and the inventory.
If you don't know the relation, you can open the department view link and you can go there relationship you will find it is metros Association. Once you will Association closer relationship you will know it is departments department ID map to embroidery department ID set you will be able to know what is this view link point to. Now, after you create a view link we need to use a master detail using this view link. So, as I said the the way which you control the view object is application module. So, we will back to the application module here and we need to add a master detail. So, we have a department we expected we can have an MPV beside a under it, so, you will find here when we why it is appear here like this because we carry it via link without view link you will not see this hierarchy this three so what you can do you can select the employee which is under the department and syndicated the worth of it as a table and Shorter it like this.
So we have a device which is like a monster and we like it. So here is the control you will find the department when you extract your funds the employees who have a master detail now, you you can see this because of we are creating view link if you remove the view link you will not see this, you can able to create this master detail. So in the page, you can easily drag let's create another tab. Okay with the burgers his master detail. All you need to do is just drag the detail or if you want to direct one by one just fine or you can drag the details here. Select the master detail I need muscle to be for and details to be table okay.
So, you can run. So, how we can create this is a way how you can create master detail is a relation between view objects and called view link relation between equal Association. You can see here the MBE for the department. Next, you will find the middle ear for the thickest you can navigate and see master detail like this. This is how to implement master detail using a view object link. Now, we are covering All it is business component, I will summarize it modal layer, model layer as I said before, it has five components.
First one is an entity object and the entity object is mapped to the table in the database. Second one is a view object as there are four types of view object view object can be based on the entity object. In this case, the user who uses view object in the page can insert update delete, or it can be just a list of value or just the query read only view object or static view object has static value or programmatic. This is a second component in the ADF business component. third component is application module and we see the application module like a gate will control the view object instance and he can decide whichever object will be used in the future few layer. He can control a master detail he can control the old innocence He can cite witchiness and use whichever view criteria Plus he can configure the data connection data source and in connection related to the bullying and data connection.
Third, you can see can test it, this is a view object before you use it in the beach. This is the third component, fourth component we talk about is Association association is just a link between two entity object. last component the fifth component is a view link view link is Association also is the link between two view objects. Link can be business tuition or can be a standalone not depending on the association. So this is the five components we cover in the ADF model that Score next video, I will move to the view controller and we will start talking about sub pages and say you all so see you next video