Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:17:12 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

May 2005
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Apr   Jun

Get Firefox!

Tuesday, May 24, 2005

I've added example # 36 to my Not Yet Documented samples page:

Composite Entity Using Stored Procedure API to Create/Modify/Remove Master and Children

Although still not comprehensively documented, the commented sample code illustrates a more complicated scenario of building a set of composed entity objects which accomplish their underlying DML operations by calling a PL/SQL API that accepts multi-level Oracle object types and internally handles the DML operations for both parent and child in one shot. The example tries to build on a common pattern where the view objects and entity select are accomplished against database views, while the entity object DML operations happen against the simple PL/SQL API:

package dept_service is
  procedure add_dept(p_dept in out dept_t);
  procedure remove_dept(p_deptno number);
  procedure update_dept(p_dept in out dept_t);
end;

The dept_t object type is defined to match the structure of a row in the DEPT table, along with having a nested emps attribute that is a table of emp_t types, matching the structure of the EMP table. Both the Dept.Deptno and the Emp.Empno attributes are populated from DB triggers from a sequence, so the example code illustrates also how to simulate the refresh-after-insert behavior that the framework would normally perform on your behalf.

You can test out using the Business Components tester.


11:26:02 PM    



I wrote a little article over on OTN that explains how to create and use a custom DBTransaction implementation. This is something you might need to do if you want to customize how transaction-level validation and/or transaction post/commit behavior in an ADF application using Business Components. There's a little downloadable sample, too.

You can find more information on the role the DBTransaction object plays over in my Most Commonly Used Methods in ADF Business Components paper, also on OTN.


3:47:03 PM    


© Copyright 2008 Steve Muench.