@Override protected GenericModel<EndpointGroupDto> newInstance(Long id) { return new EndpointGroup(id); }
protected EndpointGroup generateEndpointGroup(Application app, Set<Topic> topics) { EndpointGroup group = new EndpointGroup(); if (app == null) { app = generateApplication(null); } group.setApplication(app); group.setName("GROUP_ALL_" + RANDOM.nextInt()); group.setWeight(RANDOM.nextInt()); group.setTopics(topics); return endpointGroupDao.save(group); }
} else { endpointGroupDto.setCreatedTime(System.currentTimeMillis()); savedGroup = getDto(endpointGroupDao.save(new EndpointGroup(endpointGroupDto))); + "application id"); } else { savedGroup = getDto(endpointGroupDao.save(new EndpointGroup(endpointGroupDto)));
/** * Create new instace of <code>AbstractStructure</code>. * @param dto data transfer object contain data that * assign on fields of new instance */ public AbstractStructure(AbstractStructureDto dto) { if (dto != null) { this.id = getLongId(dto); this.sequenceNumber = dto.getSequenceNumber(); this.description = dto.getDescription(); this.createdTime = dto.getCreatedTime(); this.lastModifyTime = dto.getLastModifyTime(); this.activatedTime = dto.getActivatedTime(); this.deactivatedTime = dto.getDeactivatedTime(); this.createdUsername = dto.getCreatedUsername(); this.modifiedUsername = dto.getModifiedUsername(); this.activatedUsername = dto.getActivatedUsername(); this.deactivatedUsername = dto.getDeactivatedUsername(); this.status = dto.getStatus(); this.endpointCount = dto.getEndpointCount(); Long appId = getLongId(dto.getApplicationId()); this.application = appId != null ? new Application(appId) : null; Long groupId = getLongId(dto.getEndpointGroupId()); this.endpointGroup = groupId != null ? new EndpointGroup(groupId) : null; this.version = dto.getVersion(); } }