Wednesday 20 March 2013

Converting String to oracle.jbo.domain.ClobDomain in adf

Hi,

I got an error - " Cannot convert Testing Clob<br/> of type class java.lang.String to class oracle.jbo.domain.ClobDomain " in the UI.

Such as below -



I found this issue occurs when we are having an attribute of type Clob in DB and and we use it in UI as an Input text or Rich text Editor which support String as a default.

The issue got resolved by adding a converter="oracle.genericDomain" attribute in the text field.

Sample code :

<af:richTextEditor value="#{bindings.test.inputValue}"
                  shortDesc="#{bindings.test.hints.tooltip}"
                  id="it1" converter="oracle.genericDomain">


  *Comments and feedback are most welcomed, Thanks.

2 comments:

  1. Be careful using oracle.genericDomain as the converter. It works, but even if you leave the field blank, it creates 0-length CLOB objects in the CLOB column. These are different than truly 'null' values. (They take up space, etc.)

    To only create a CLOB object for a CLOB column if there is actually data, write your own "ClobConverter" class. See https://forums.oracle.com/forums/thread.jspa?threadID=718353.

    ReplyDelete
    Replies
    1. Hi Karl,

      Thanks for your great info and reply... hope your solution will give more elaborate view on the usage of CLOB to the viewers.

      I would like to share an interesting link for the users to understand more about clob as null - http://nuijten.blogspot.in/2009/11/empty-clob-is-not-null-its-not-null.html

      Delete