Insert Rows in ADF View Object Programatically

Suppose that I have EmpVO view object which have below attributes
EmpId, FirstName, LastName

We can do inserting rows by two ways in data model layer (Application Model or View Object classes)
I will write my code in ApplicationModuleImpl class

try
{
    ViewObject vo=this.getEmpVO();
    Row r=vo.createRow();
    r.setAttribute("EmpId","id#1");
    r.setAttribute("FirstName","fn#1");
    r.setAttribute("LastName","ln#1");
    vo.insertRow(r);
    this.getDBTransaction().commit();
}catch(Exception e){
    e.printStackTrace();
}