Search in sources :

Example 1 with SysSyncActionLog

use of eu.bcvsolutions.idm.acc.entity.SysSyncActionLog in project CzechIdMng by bcvsolutions.

the class DefaultSysSyncActionLogService method save.

@Override
public SysSyncActionLogDto save(SysSyncActionLogDto dto, BasePermission... permission) {
    Assert.notNull(dto);
    // 
    if (!ObjectUtils.isEmpty(permission)) {
        SysSyncActionLog persistEntity = null;
        if (dto.getId() != null) {
            persistEntity = this.getEntity(dto.getId());
            if (persistEntity != null) {
                // check access on previous entity - update is needed
                checkAccess(persistEntity, IdmBasePermission.UPDATE);
            }
        }
        // TODO: remove one checkAccess?
        checkAccess(toEntity(dto, persistEntity), permission);
    }
    // 
    // save
    SysSyncActionLogDto newDto = saveInternal(dto);
    // iterate over all log items
    for (SysSyncItemLogDto item : dto.getLogItems()) {
        item.setSyncActionLog(newDto.getId());
        item = syncItemLogService.save(item);
        newDto.addLogItems(item);
    }
    return newDto;
}
Also used : SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) SysSyncActionLog(eu.bcvsolutions.idm.acc.entity.SysSyncActionLog) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)

Aggregations

SysSyncActionLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto)1 SysSyncItemLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)1 SysSyncActionLog (eu.bcvsolutions.idm.acc.entity.SysSyncActionLog)1