public LoggerItemList loadLoggerItemList() throws DaoException { List<DomainObject> loggerItems = this.listAll(LoggerItem.class); LoggerItemList loggerItemList = new LoggerItemList(); if (loggerItems.size() != 2) { return null; } else { for (int i = 0; i < loggerItems.size(); i++) { LoggerItem loggerItem = (LoggerItem) loggerItems.get(i); if (loggerItem.getLogInstance().equals(LoggerItem.LogInstance.OPERATIONLOG)) { loggerItemList.addLoggerItem(LoggerItem.LogInstance.OPERATIONLOG, loggerItem); } if (loggerItem.getLogInstance().equals(LoggerItem.LogInstance.SYSTEMLOG)) { loggerItemList.addLoggerItem(LoggerItem.LogInstance.SYSTEMLOG, loggerItem); } } return loggerItemList; } }
public void saveLoggerItemList(LoggerItemList object) throws DaoException { List<LoggerItem> list = object.getAllLoggerItem(); for (int i = 0; i < list.size(); i++) { super.update(list.get(i)); } }