Insert row in ViewObject and Commit to DB
727941Jan 12 2010 — edited Jan 12 2010Hi,
I am trying to insert new row inside VO and populate it with data. Here is the code:
Row rowForInsert = ts.createRow();
rowForInsert.setNewRowState(Row.STATUS_NEW);
rowForInsert.setAttribute("Act", rowData.getAttribute("ActId"));
rowForInsert.setAttribute("Date", dateForDB);
rowForInsert.setAttribute("Employee", "4583");
rowForInsert.setAttribute("Status", "1");
ts.insertRow(rowForInsert);
am.getTransaction().commit();
TS is ViewObjectImpl and AM i ApplicationModule.
Row is correctly inserted in VO but on commit I get the following error:
...
Caused by: oracle.jbo.InvalidOperException: JBO-26018: Entity TsTest cannot be posted to the database because it has no attributes set.
...
I've also tried to set row state to STATE_NEW, use ViewObject instead of ViewObjectImpl but still no luck
I'm using JDev 11.1.1.2.0
Thanks a lot,
Goran Milinovic