List<ActorsView> actorsViews = new ArrayList<ActorsView>();
int nn = 1;
for (DBObject actor : actors)
{
ActorsView actorsView = new ActorsView();
actorsView.setOid(actor.get("_id").toString());
logger.debug("Actor _id: {}", actorsView.getOid());
actorsView.setNn(nn);
actorsView.setName(actor.get("name").toString());
logger.debug("Actor name: {}", actorsView.getName());
actorsView.setLname(actor.get("lname").toString());
logger.debug("Actor last name: {}", actorsView.getLname());
actorsView.setSname("");
if (actor.get("sname") != null)
{
actorsView.setSname(actor.get("sname").toString());
logger.debug("Actor last name: {}", actorsView.getSname());
}
actorsView.setBdate("");
if (actor.get("bdate") != null)
{
actorsView.setBdate(actor.get("bdate").toString());
logger.debug("Actor birth date: {}", actorsView.getBdate());
}
actorsView.setDdate("");
if (actor.get("ddate") != null)
{
actorsView.setDdate(actor.get("ddate").toString());
logger.debug("Actor death date: {}", actorsView.getDdate());
}
actorsView.setBplace("");
if (actor.get("bplace") != null)
{
actorsView.setBplace(actor.get("bplace").toString());
logger.debug("Actor birth place: {}", actorsView.getBplace());
}
actorsView.setDplace("");
if (actor.get("dplace") != null)
{
actorsView.setDplace(actor.get("dplace").toString());
logger.debug("Actor death place: {}", actorsView.getDplace());
}
actorsView.setInfo("");
if (actor.get("info") != null)
{
actorsView.setInfo(actor.get("info").toString());
logger.debug("Info: {}", actorsView.getInfo());
}
actorsViews.add(actorsView);
nn++;
}