class DefaultSysSystemMappingService extends AbstractEventableDtoService<SysSystemMappingDto, SysSystemMapping, SysSystemMappingFilter> implements SysSystemMappingService {

	@Override
	public SysSystemMappingDto save(SysSystemMappingDto dto, BasePermission... permission) {
		SystemEntityType entityType = dto.getEntityType();
		if (SystemOperationType.PROVISIONING == dto.getOperationType() && !entityType.isSupportsProvisioning()) {
			throw new ResultCodeException(AccResultCode.PROVISIONING_NOT_SUPPORTS_ENTITY_TYPE, ImmutableMap.of("entityType", entityType));
		}

		// Validate all sub attributes
		getAttributeMappingService()
				.findBySystemMapping(dto).forEach(attribute -> {
					getAttributeMappingService().validate(attribute, dto);
				});
		return super.save(dto, permission);
	}

	@Autowired public  DefaultSysSystemMappingService(SysSystemMappingRepository repository, EntityEventManager entityEventManager,
			GroovyScriptService groovyScriptService, List<AbstractScriptEvaluator> evaluators,
			ApplicationContext applicationContext);

}