Time for action – learning to override a method

The following steps will show how to override a method from the class and then write our own logic in the method. We will have EmpDirectoryModuleImpl as our example here:

  1. Right-click on the EmpDirectoryModuleImpl class and select the Source option.
  2. Click on the Override Methods… option to override the operations from the base class.
  3. Type in the method name, for example befo, in the search box that will fetch methods starting with that literal.
  4. Check the beforeCommit() operation and click on OK.
  5. Add the following code:
    ViewObject vo = findViewObject("EmpVO3");
    vo.clearCache();
    vo.executeQuery();
    Time for action – learning to override a method
  6. This code ...

Get Oracle ADF 11gR2 Development Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.