Wednesday, October 31, 2012

Oracle ADF : Best Book out in the market

I did not wait for even few minutes before ordering this fantastic book on Oracle ADF which covers all the important aspect of ADF framework and which will definitely take experienced as well as beginner developer to new level.

I would strongly recommend this book for adapting best enterprise Implementation practice with ADF.

I already went through few hundreds pages of this book and I would say, It is amazing book.

Book Details :
Paperback : 590 pages [ 235mm x 191mm ]
Release Date : October 2012
ISBN : 1849684820
ISBN 13 : 9781849684828
Author(s) : Jobinesh Purushothaman
Topics and Technologies : All Books, Enterprise, Oracle

Also , Please visit Link

image

Sunday, October 21, 2012

ADF BC : Validation Rule

Sometime we need to create rule that will be used in most of the entity objects like employee id pattern , salary range pattern and more.

I created simple rule to explain you how to create rule that can be applied to all the entities.

I have used employee table of HR schema and My rule is taking care that first name and last name is not entered same.

I create ADF BC object type Validation Rule and It has generated following java file that implements JboValidatorInterface interface.

I added code to validateValue , validate and validateEntityLevel.

image

validateEntityLevel make sure that validation is called during Entity Level Validation stage.

Now we need to associate this validation as Entity Validator.

In EO , I associated FirstName and LastName String variable I created with accessor in java files with Entity Object attribute value.

image

When I create Entity Row and give First Name and Last Name as same value it will throw exception not allowing me to save row.

Saturday, October 20, 2012

Debugging ADF Application

We can see queries that are run during runtime , bind variable value and more if we debug ADF application.

Right click View Controller and set following flag and run the application.

-Djbo.debugconsole=console

image

There are other value that can be associated with debugconsole that are file , ADF Logger , silent.

ADF Logger

-Djbo.debugconsole=adflogger –Djbo.adflogger.level=FINEST

ADF BC : findByPrimaryKey Method Usage

Even though ADF provide lot of declarative way of achieving our goal , There are some instance where you need to write your own code.

Example If I need to write code that is generic to all VO then I will put that code in Application Module Implementation file.

Let us say we need to search employee based on employee id.

I wrote following code in ApplicationModuleImpl and exposed it to be called from user interface. I have given static value for employee but you can make it more generic according to requirement.

image

ADF BC : Post Changes

Sometime we need to override EOImpl method to do some extra validation or other custom code.

One of most used overridden method is PostChanges() to intercept the logic before actually commit happens. This can be used to call PL/SQL method to push the Middle-Tier data without committing the changes.

As per Oracle documentation postChange Documentation , This method calls doDML with DML_INSERT , DML_UPDATE , DML_DELETE flags.

PostChanges() is called when all validation and custom validation is completed and you have data in entity cache which is validated , but about to be committed.

Most of the bloggers have suggested to use this method to call PL/SQL while migrating legacy application. Further research is advisable.

image