ADF Model Entity Object (EO)

Complete Oracle ADF 12c Course for Beginners ADF Business Components (Model Layer)
18 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.24
List Price:  €93.21
You save:  €27.96
£55.79
List Price:  £79.71
You save:  £23.91
CA$95.78
List Price:  CA$136.84
You save:  CA$41.05
A$107.15
List Price:  A$153.08
You save:  A$45.92
S$95.25
List Price:  S$136.08
You save:  S$40.82
HK$547.16
List Price:  HK$781.69
You save:  HK$234.53
CHF 63.78
List Price:  CHF 91.12
You save:  CHF 27.33
NOK kr771.03
List Price:  NOK kr1,101.52
You save:  NOK kr330.49
DKK kr486.66
List Price:  DKK kr695.26
You save:  DKK kr208.59
NZ$117.65
List Price:  NZ$168.07
You save:  NZ$50.42
د.إ257.05
List Price:  د.إ367.24
You save:  د.إ110.18
৳7,682.75
List Price:  ৳10,975.83
You save:  ৳3,293.07
₹5,839.27
List Price:  ₹8,342.17
You save:  ₹2,502.90
RM334.02
List Price:  RM477.20
You save:  RM143.17
₦92,745.84
List Price:  ₦132,499.74
You save:  ₦39,753.90
₨19,488.62
List Price:  ₨27,842.08
You save:  ₨8,353.45
฿2,593.98
List Price:  ฿3,705.84
You save:  ฿1,111.86
₺2,266.58
List Price:  ₺3,238.11
You save:  ₺971.53
B$358.23
List Price:  B$511.78
You save:  B$153.55
R1,308.04
List Price:  R1,868.72
You save:  R560.67
Лв127.69
List Price:  Лв182.42
You save:  Лв54.73
₩96,593.58
List Price:  ₩137,996.75
You save:  ₩41,403.16
₪262.11
List Price:  ₪374.46
You save:  ₪112.34
₱4,037.82
List Price:  ₱5,768.57
You save:  ₱1,730.74
¥10,982.62
List Price:  ¥15,690.13
You save:  ¥4,707.51
MX$1,188.90
List Price:  MX$1,698.50
You save:  MX$509.60
QR255.36
List Price:  QR364.82
You save:  QR109.45
P960.21
List Price:  P1,371.80
You save:  P411.58
KSh9,275.87
List Price:  KSh13,251.81
You save:  KSh3,975.94
E£3,354.25
List Price:  E£4,792
You save:  E£1,437.74
ብር4,018.25
List Price:  ብር5,740.61
You save:  ብር1,722.35
Kz58,443.04
List Price:  Kz83,493.64
You save:  Kz25,050.60
CLP$66,028.30
List Price:  CLP$94,330.18
You save:  CLP$28,301.88
CN¥506.69
List Price:  CN¥723.88
You save:  CN¥217.18
RD$4,095.54
List Price:  RD$5,851.02
You save:  RD$1,755.48
DA9,393.81
List Price:  DA13,420.31
You save:  DA4,026.49
FJ$158.42
List Price:  FJ$226.32
You save:  FJ$67.90
Q544.03
List Price:  Q777.22
You save:  Q233.19
GY$14,645.70
List Price:  GY$20,923.32
You save:  GY$6,277.62
ISK kr9,806.99
List Price:  ISK kr14,010.59
You save:  ISK kr4,203.60
DH708.51
List Price:  DH1,012.20
You save:  DH303.69
L1,235.26
List Price:  L1,764.74
You save:  L529.47
ден4,024.43
List Price:  ден5,749.43
You save:  ден1,725
MOP$564.37
List Price:  MOP$806.28
You save:  MOP$241.91
N$1,312.44
List Price:  N$1,875
You save:  N$562.55
C$2,589.99
List Price:  C$3,700.15
You save:  C$1,110.15
रु9,350.18
List Price:  रु13,357.97
You save:  रु4,007.79
S/262
List Price:  S/374.30
You save:  S/112.30
K266.57
List Price:  K380.83
You save:  K114.26
SAR262.49
List Price:  SAR375.01
You save:  SAR112.51
ZK1,865.62
List Price:  ZK2,665.29
You save:  ZK799.66
L324.62
List Price:  L463.77
You save:  L139.14
Kč1,642.25
List Price:  Kč2,346.17
You save:  Kč703.92
Ft25,489.50
List Price:  Ft36,415.13
You save:  Ft10,925.63
SEK kr767.15
List Price:  SEK kr1,095.98
You save:  SEK kr328.82
ARS$61,365.44
List Price:  ARS$87,668.68
You save:  ARS$26,303.23
Bs484.79
List Price:  Bs692.59
You save:  Bs207.79
COP$272,495.59
List Price:  COP$389,296.10
You save:  COP$116,800.51
₡35,128.88
List Price:  ₡50,186.26
You save:  ₡15,057.38
L1,728.92
List Price:  L2,470
You save:  L741.07
₲521,305.22
List Price:  ₲744,753.66
You save:  ₲223,448.44
$U2,682.06
List Price:  $U3,831.68
You save:  $U1,149.62
zł282.11
List Price:  zł403.03
You save:  zł120.92
Already have an account? Log In

Transcript

Hello, last video, we have connected developer with database and now the developer and database are ready to start creating ADF application from this video I will start working on it a business component some other layer I think you remember this short I wish I took before about it. Now are you focused for a couple of upcoming videos on model layer? So I will talk about entity object in detail. Then I will talk about view object in detail and application modules. There are two more components like cold Association and view link. I will talk about it as well in detail.

So, first thing now I will talk about it this way You is entity object. So Let's now move to developer and start working on ADF application. Let us now create a new application ADF application. Okay. It's your PDF application, I will call this application called HR ADF application. As I said before, Jennifer Barone automatically create to project first the project for the model.

This model which I will talk about it, we should talk about it business components, like entity object view object application modules Association and a few links. And the second project is view control controller, which is talking about the user interface GCF pages and interfaces components as a page editor. fiscal flows and so on. Next finish After you create the PDF application, the first step you have to do is to create some other. So, in EDF application once you created the application, you should create an EDF model but before you created a model you have various database should be ready. So, now let us now create a model pointed to the HR schema and start working on it.

So, here I will right click in the model and select business components from tables. I will look up to the HRT connection which we already created. I will copy the connection so, this is a connection which is a model we'll deal with okay. As I say before the first component of the if business component is a model is an entity objects. So I will put this in the package called eo two was the entity object on it. I press query to get all the tables in this connection, it's your connection.

This now create one entity called departments. Okay, next Nicolas, this is a view object we can create this view object as well for now. So I will create it is a package called model to and I will select the department's view Nick is this is another type of view object. I will talk about it later. Now. This is application modules.

Nick is Nick is Nick is Finish okay. So, let's discuss this view controller now we are working on their model layer okay as I said in the model layer, model layer has five components, first component is entity objects, second one is view object third one is application module and there are two more components I will talk about it later is associations and view link. Once you aware about these five components, you will be aware about the old if business component model. In this video, I will talk in detail about entity object. As I said before the entity object is you can consider it as a table So, each table database should map to the entity object. So this entity object is mapped to which table how we will know in the general what you find here in schema object, it does departments so it points to the department's table.

For each table, you will have this open the department's table here. You will have some column, we can go see the data if you want. department ID, department name manager ID Manager, location ID is the entity object in the attribute you will find the column here for column it will create attribute for each column. We call this attributes in the entity object and it will take the same data type of the column so if the department is numeric department department ID is a numeric what we name is our core measure number Location is a number you will find here gt will automatically create attribute with the same datatype which found here in the database. So, entity object is a table and attribute is a column of that table. Okay.

So what can we do in this entity object? What is the feature or what is the thing is in as an ADF application can do in this entity object. Let's talk about one by one first one. Here, you will find here something called alternative or alternate keys. Alternate keys it is if you want to mark a column one column is a database to be a key, but actually it is not a primary key. As you can see here is a database the department Or the column called department ID is a primary key okay of that table this is a primary key, but at the same time you want the department name should not be repeated you don't want this department name to be repeated as a key.

So, you can define here it as alternate key. So, you just press Add and I need to say this department name should not be repeated as well. In it a business component, you can define all business rule on all constraints and own all validation is that for the table, even this validation is not exist in the database level. So maybe the department table has no constraint at all. It is just like a table. There is no validation nothing at all, but you can put all validation you want is that entity level.

So, here I tells a framework that if the user try to insert a new row or update a current existing row with a department name already exist, you just give me a validation error. So this is the fairest Thank you can do is the entity object so the first thing is you can create alternate keys I will just go with a mean mean things okay for for tunings, we don't do anything and just Unix on the rest of the thing is just here. Just in general, you will know what's the table and you can find alternate key. But defined alternate key alone is not enough you have to define business rule for this alternate key. So I will talk about the business rules. business rules is the most important thing is the entity object.

From this tab, you can define A validation for this table there are two type of validation validation in the attribute level or a column level or validation in the old entity level. There are a breed defined business rule a it f has a predefined business rule and it will make easy to add a validation. So, now we create alternate key after you can use alternate key you have to go business rule and this is will be entity validation because this is not related to a specific column not related to a specific entity, this is general in the general entity. So, you just right click and you can add new validator and from the type you will find some alternative type I will talk about this later. So, what we have we have a unique key and you will find your alternate key. You just write a failure or error message If the user tried to add a department name, which is already exist, so you can say this deport mean name is already exists.

For example, this is Aramis. That's it. So, you add a validation in the entity whole entity level, this validation is a unique key validation boy into to you alternate key c user is a very simple there is no code at all. So, if in your ADF application want a specific table to be in one column was a specific table to be a unique you can come to the entity object which map to that table and you can create alternate key. Also they can be composite. You can see for example, the birth committee name and the location ID should be unique Both of them not only they're working with name so you can add any altona key as you want.

So, this is the first one second is attributes, its attributes there are a lot of things you can do in the attribute level or the column level in the case. For example, here let's talk about take select one of the attributes you will find here from some department he has this key sign it means this is a primary key and you will find here it is automatically mandatory. So no user has to SIDS the department ID before it insert. Here, what is the column which is this attribute is mapped to and the data type. As you can see here, updatable is always you can have here, never update, updatable at all or while new. Most of the times are primary should be while new while new it means once a user can create a new row for the departments, the department ID will be open as a field will be open to that the user can enter the department ID.

But once the user save and commit the changes to the database, he will not be able to update this value anymore. This is the thing is I will show you once we can eat a beach and I can show you all these kind of things. Here in UI you can give a label. So once a user use this view object or this entity object in the page, you will find the label behind or beside the field. For example, you can here say to bar meant ID you can see here Name Manager Location something like this you can give a label or a text on the for each attribute. This is for the attribute level.

You'll find here a validation rule for attributes even as I sit here as a business rule validations attribute you can do it from here or you can do it from here. So, for example, in the department name, you will find there are two rules already defined coming from the database, which is it is a mandatory and the value should be around 30. Characters what what else you can do here, you will find here some other validation rule. If you want to add a regular expression, it should match for example, if you have email Or something like this you can say it should emit has this says format to be validated or if you have a phone number you can use this better. So, you can define a regular expression for a specific column or a Pacific attribute you can be arranged if it is value it is integral value or double value you can say the minimum value should be 20 and the maximum should be for example 100 So, if the value out of this range you should write an error message okay.

So, you will define this range is defined the list it should be in this list only the user can add some lists only like for example, should be in between this list some signal exists and if the value is not in this list, you can add an error message here. There are a method if you need to make some customization we will call about programmatic and later, but this is if you want something programmatic It's another compare if you say the value should equal to exhibition or another attribute in some other view object or the query result you can write a select statement and if the value is not in say is selected statement result you will place error. So, as there are a lot of predefined validation in the attribute level you can you can defined and this is one of the most important feature and entity object.

So, in EDF application if if application if you want to add some validation in a specific field you should do it in the entity object. You just select it select the business rule and see sit your validation This is insane attribute third one is a business rule as I said there are two level of business rule one in the entity level and one in the attribute level is the entity level you can add something like unique as we say before or has the same attribute but this is will be in the whole entity living for example, if you have started date at the end date in the table and you want indeed it to be always greet or send start date. So, you should say here, select the attribute and compare results and other attribute and select a lot of it and so on here Here you will do all these kinds of things we will show it later, but I just want to know what is what you can do in entity object, what what exactly used for this object is used for.

So, in the entity object, so most of Important thing we will use is attribute level as a business rule. And Java will be used if you do want to do something programmatic. There are dedicated sections for all programmatics in RDF. And this is you need to add this view accessor and business event Forget it. So, this is the most three tabs you will use, and the entity object, attribute business rule and Java. For this video, I'll give you a quick explanation about entity object.

I will come back again to this entity object. Why did we create a beach so that you will be able to see the change and you manage to see the change so the next video, let us create a new page and we can make some change in that attribute and run and see how it will affect in the beach. So, see you next video

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.