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

Search blog with Google:
 

Search BC4J JavaDoc:
 

January 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          
Dec   Feb

Get Firefox!

Thursday, January 13, 2005

A comprehensive new whitepaper Getting Started with Unit Testing [pdf] was published over the holidays on OTN. Worth a look...


5:54:32 PM    



We'll be adding this caveat to the JDeveloper 10.1.2 Release Notes Addendum soon, but here's a preview of another issue that early adopters of JDeveloper 10.1.2 on OTN have reported and I've worked with development to diagnose...

ClassCastException Accessing One-To-Many Entity View Link Accessor   (Bug 4113607)

Prior to 10.1.2, ADF BC runtime was incorrectly hard-coding an assumption that the return type of a view link accessor exposed at entity level was a RowIterator. This caused problems when the viewlink exposed thusly was a 1-to-1 link. Our engineers fixed that bug (#3839762) in 10.1.2, but it uncovered a new issue discovered after 10.1.2 build 1811 shipped. The issue is a design time bug that incorrectly reverses the source and the destination types of the view link when it writes the view link accessor type in your entity's XML descriptor. Prior to 10.1.2, when we were hard-coding the expectation of a RowIterator, the fact that the wrong type was in the XML didn't matter since we didn't consult the type at runtime. Now that we are using the XML-based <ViewLinkAccessor> row type info in 10.1.2, the fact that it's incorrect surfaced this new ClassCastException.

If you expose a WorksInDeptLink view link between DeptView and EmpView on the Dept EO level with an accessor name of Employees, you will currently end up with the incorrect XML snippet in your Dept.xml file like this:

<!-- In Dept.xml entity XML file -->
   :
  <ViewLinkAccessor
      Name="Employees"
      ViewLink="test.mypackage.WorksInDeptLink"
      ViewLinkEnd="test.mypackage.WorksInDeptLink.EmpView"
      ViewLinkOtherEnd="test.mypackage.WorksInDeptLink.DeptView1"
      Type="oracle.jbo.Row"
      IsUpdateable="false" >
   </ViewLinkAccessor>

If your DeptView VO is exposing a custom Row class, it will reflect that instead and look like:

<!-- In Dept.xml entity XML file -->
   :
   <ViewLinkAccessor
      Name="Employees"
      ViewLink="test.mypackage.WorksInDeptLink"
      ViewLinkEnd="test.mypackage.WorksInDeptLink.EmpView"
      ViewLinkOtherEnd="test.mypackage.WorksInDeptLink.DeptView1"
      Type="test.mypackage.DeptViewRowImpl"
      IsUpdateable="false" >
   </ViewLinkAccessor>

Trouble is, neither the generic oracle.jbo.Row nor the more specific test.mypackage.DeptViewRowImpl is correct for the return type of this accessor. The workaround until we fix this issue in a maintenance release is to update the Dept.xml file outside of JDeveloper to reflect the correct type of the view link accessor. In the example above, you would change the type to be oracle.jbo.RowIterator like this:

<ViewLinkAccessor
      Name="Employees"
      ViewLink="test.mypackage.WorksInDeptLink"
      ViewLinkEnd="test.mypackage.WorksInDeptLink.EmpView"
      ViewLinkOtherEnd="test.mypackage.WorksInDeptLink.DeptView1"
      Type="oracle.jbo.RowIterator"
      IsUpdateable="false" >
   </ViewLinkAccessor>

And this fixes the problem.

NOTE: If you "touch" the view link in the view link editor again, you may have to reapply this workaround after the wizard re-writes the wrong type value again.


12:54:22 PM    


Today after struggling to get Microsoft Frontpage to do what I wanted while editing some HTML, all the while wishing that I could use the same HTML Editor that I use in Thunderbird, I turned to my good friend Google to find the Nvu HTML editor. It's still a 0.7 Beta, but it's based on the Firefox 1.0 codebase and it's exactly what I was looking for. Now I can use all the same keyboard shortcuts and features that I'm familiar with while composing HTML email in Thunderbird to work on any HTML. Excellent!
12:37:48 PM    


© Copyright 2008 Steve Muench.