@Override protected GenericModel<ChangeDto> newInstance(Long id) { return new Change(id); }
protected Change generateChange() { LOG.debug("Generate change..."); Change change = new Change(); change.setConfigurationId(RANDOM.nextLong()); change.setConfigurationVersion(RANDOM.nextInt(3000)); change = historyDao.save(change, Change.class); LOG.debug("Generated change {}", change); return change; }
/** * Create new instance of <code>History</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public History(HistoryDto dto) { if (dto != null) { this.id = getLongId(dto); this.sequenceNumber = dto.getSequenceNumber(); this.change = new Change(dto.getChange()); this.lastModifyTime = dto.getLastModifyTime(); Long applicationId = getLongId(dto.getApplicationId()); if (applicationId != null) { this.application = new Application(applicationId); } } }