Note that there are some explanatory texts on larger screens.

plurals
  1. PONullPointerException when using insertRow() ADF
    text
    copied!<p>I am trying to add a record into a table in the database and I am getting <code>Nullpointerexception</code></p> <p>when executing the insert statement using <code>insertRow()</code>.</p> <p>The Use-case:</p> <p>The database table that I am trying to insert records in to it called <code>someTable</code>.</p> <p>this table contain the following attributes: <code>A, B, C, D, E</code></p> <p>the primary key is a combination of three fields which are : <code>A, B, C</code></p> <p>I am executing the following code to insert new record in the table <code>someTable</code>:</p> <pre><code> AppModuleImpl appModule = (AppModuleImpl)(JSFUtils.getApplicationModule("AppModuleDataControl")); ViewObject someTableVO =appModule.findViewObject("someTableView1"); Row row= someTableVO.createRow(); row.setAttribute("A", varable1); row.setAttribute("B", varable2); row.setAttribute("C", varable3); row.setAttribute("D", varable4); someTableVO.insertRow(row); // This statement cause the NullPointerException appModule.getDBTransaction().commit(); someTableVO.executeQuery(); </code></pre> <p><strong>Note:</strong></p> <ol> <li><p>There is no <code>Not Null constrains</code> except for primary key of course, and I am adding data for all primary key fields which are ( <code>A</code>,<code>B</code> and <code>C</code> ).</p></li> <li><p>I am not inserting data for filed <code>E</code> as you can see form the sample code above. But, even when I tried to add some value in to it, still gives me the same error.</p></li> <li><p>I am sure that the variables ( <code>variable1</code> ...... <code>variable4</code>) are not <code>null</code>.</p></li> <li><p>I am getting the right View object <code>someTableView1</code></p></li> <li><p>I am using <code>ADF</code> Technology with <code>Jdevelopr 11.1.2.3</code></p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload