Markus writes in to ask, "How does the UniquePKValidationBean validation rule that's used on the Account entity in the ADF Toy Store work? There isn't anything in the online help about it."
Firstly, he's right: not in the docs. I filed bug 3745726 to get the documentation on this beefed up in a future release. I also checked the ./BC4J/src/bc4jaddinsrc.zip file that we ship with JDev/ADF and it's not included in there along with the source code for the other built-in validators that we do provide.
So, in the interim, here's the scoop. The UniquePKValidationBean is implemented by a standard BC4J validation rule named JboUniqueKeyValidator that is defined as an inner class in EntityDefImpl. I assume it was defined this way for a Java member-visibility reason, but I don't know the exact history off the top of my head. (Today's a public holiday in the US so I'll have to get back to you on that!) This validation bean gets added when the entity definition object is loaded and the <UniquePKValidationBean/> element is found among the entity object's XML metadata. The runtime implementation simply calls the addUniquePKValidation() method in EntityDefImpl that does the work of adding the validator.
In earlier versions of BC4J, you had to add this validation rule yourself programmatically by overriding the createDef() method of the EntityDefImpl class in a custom Entity Defintion, and manually call the addUniquePKValidation() method yourself. In 9.0.3 we added the design-time support to perform this step declaratively instead of having to write code to do it.
4:57:07 PM
|