Time for action – creating an alternate key for DeptEO
Currently, the DeptEO.xml
file
has Deptno
as the primary key. We would add business validation that states that there should not be a way to create a duplicate of the department name that is already available. The following steps show how to create an alternate key:
Go to the General section of the
DeptEO.xml
file and expand the Alternate Keys section. Alternate keys are keys that are not part of the primary key.Click on the little + icon to add a new alternate key.
Move the
Dname
attribute from the Available list to the Selected list and click on the OK button.
What just happened?
We have created an alternate key against the Dname
attribute to prepare for a unique check validation for the department name. When the alternate key is added to an entity object, we will
see the AltKey
attribute listed in the Alternate Key section of the General tab.
In the DeptEO.xml
file, you will find the following code that gets added for the alternate...