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; 8:13:00 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

July 2003
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    
Jun   Aug

Get Firefox!

Thursday, July 10, 2003

Can you give us an example of inserting a new master and details with composition in play?

I frequently get asked about how to insert a new master row and new detail rows when the association between the master and detail have been marked as a composition. If you don't follow the tips that I highlight in this "Why does I get Invalid Owner Exception?" article, you might end up getting that error in your code.

Here's a working sample to download and study:  InsertNewComposedMasterAndDetail.zip

The mini-manual to running the example is:

  1. Run the CreateEmpDeptTables.sql script (if you don't already have EMP and DEPT or want to reset the data to be as expected by the example).
  2. Run TestClient.java

The result is that:

  • A new department 99 should be created with four new employees
  • Existing department 10 should have two new employees
  • An error about non-existent department 88 will be printed.

2:49:33 PM    



© Copyright 2008 Steve Muench.