Can someone explain me how I get the code mentioned below running?
The problem is that it concerns a list and I don't know correct how I get it
to work, the code that I developed gives me each time a nullpointerexception
when I run it.
Can someone give me some information about what I do wrong?
public RowBeheer[] readBeheerList1(String ondnr) {
RowBeheer[] rowBeheer = null;
try {
dao.BeheerDAO beheerDao = (dao.BeheerDAO)
DaoManagerRequester.getDaoManager().getDao(dao.BeheerDAO.class);
model.BeheerExample beheerExample = new model.BeheerExample();
beheerExample.createCriteria().andReferentienummerLike(likesleutel);
List resultList = beheerDao.selectByExample(beheerExample);
if (resultList.size() > 0) {
for(int i = 0; i < resultList.size(); i++) {
rowBeheer[i] = new RowBeheer();
model.Beheer beheer = (model.Beheer) resultList.get(i);
rowBeheer[i].setReferentienummer(beheer.getReferentienummer());
rowBeheer[i].setVolgnr(beheer.getVolgnr());
rowBeheer[i].setRowdatumbegin(String.valueOf(beheer.getRowdatumbegin()));
rowBeheer[i].setRowdatumeinde(String.valueOf(beheer.getRowdatumeinde()));
rowBeheer[i].setKantoorcode(beheer.getKantoorcode());
rowBeheer[i].setDossierstatus(beheer.getDossierstatus());
return rowBeheer;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}