Long polltypeid = importLongType(unformatString(roompollObject
.element("polltypeid").getText()));
Long roomid = importLongType(unformatString(roompollObject
.element("roomid").getText()));
RoomPoll roomPoll = new RoomPoll();
roomPoll.setPollName(pollname);
roomPoll.setPollQuestion(pollquestion);
if (archived != null) {
roomPoll.setArchived(archived.booleanValue());
} else {
roomPoll.setArchived(true);
}
roomPoll.setCreated(created);
roomPoll.setCreatedBy(usersDao.getUser(getNewId(createdbyuserid, Maps.USERS)));
roomPoll.setPollType(pollManagement.getPollType(polltypeid));
roomPoll.setRoom(roommanagement.getRoomById(getNewId(roomid, Maps.ROOMS)));
roomPoll.setRoomPollAnswerList(new LinkedList<RoomPollAnswers>());
Element roompollanswers = roompollObject
.element("roompollanswers");
for (Iterator<Element> innerIterAnswers = roompollanswers
.elementIterator("roompollanswer"); innerIterAnswers
.hasNext();) {
Element innerIterAnswerObj = innerIterAnswers.next();
Integer pointlist = importIntegerType(unformatString(innerIterAnswerObj
.element("pointlist").getText()));
Boolean answer = importBooleanType(unformatString(innerIterAnswerObj
.element("answer").getText()));
Date votedate = CalendarPatterns
.parseImportDate(unformatString(innerIterAnswerObj
.element("votedate").getText()));
Long voteduserid = importLongType(unformatString(innerIterAnswerObj
.element("voteduserid").getText()));
RoomPollAnswers roomPollAnswers = new RoomPollAnswers();
roomPollAnswers.setPointList(pointlist);
roomPollAnswers.setAnswer(answer);
roomPollAnswers.setVoteDate(votedate);
roomPollAnswers.setVotedUser(usersDao.getUser(getNewId(voteduserid, Maps.USERS)));
roomPoll.getRoomPollAnswerList().add(roomPollAnswers);
}
roomPollList.add(roomPoll);
}