use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class StorageQosDaoImpl method getQosByDiskProfileIds.
@Override
public Map<Guid, StorageQos> getQosByDiskProfileIds(Collection<Guid> diskProfileIds) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("disk_profile_ids", createArrayOfUUIDs(diskProfileIds));
List<Pair<Guid, StorageQos>> pairs = getCallsHandler().executeReadList("GetQosByDiskProfiles", storageQosMultipleProfilesMapper, parameterSource);
return pairs.stream().collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class DnsResolverConfigurationDaoImpl method saveNameServersByDnsResolverConfigurationId.
private void saveNameServersByDnsResolverConfigurationId(Guid dnsResolverConfigurationId, List<NameServer> nameServers) {
for (int i = 0; i < nameServers.size(); i++) {
MapSqlParameterSource mapper = getCustomMapSqlParameterSource().addValue("dns_resolver_configuration_id", dnsResolverConfigurationId).addValue("address", nameServers.get(i).getAddress()).addValue("position", i);
getCallsHandler().executeModification("InsertNameServer", mapper);
}
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class HostNetworkQosDaoImpl method createFullParametersMapper.
@Override
protected MapSqlParameterSource createFullParametersMapper(HostNetworkQos obj) {
MapSqlParameterSource map = super.createFullParametersMapper(obj);
map.addValue(OUT_AVERAGE_LINKSHARE, obj.getOutAverageLinkshare());
map.addValue(OUT_AVERAGE_UPPERLIMIT, obj.getOutAverageUpperlimit());
map.addValue(OUT_AVERAGE_REALTIME, obj.getOutAverageRealtime());
return map;
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class InterfaceDaoImpl method saveInterfaceForVds.
@Override
public void saveInterfaceForVds(VdsNetworkInterface nic) {
hostNetworkQosDao.persistQosChanges(nic.getId(), nic.getQos());
MapSqlParameterSource parameterSource = createInterfaceParametersMapper(nic);
getCallsHandler().executeModification("Insertvds_interface", parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmJobDaoImpl method createFullParametersMapper.
@Override
protected MapSqlParameterSource createFullParametersMapper(VmJob entity) {
MapSqlParameterSource mapper = createIdParameterMapper(entity.getId());
mapper.addValue("vm_id", entity.getVmId());
mapper.addValue("job_state", entity.getJobState().getValue());
mapper.addValue("job_type", entity.getJobType().getValue());
if (entity.getJobType() == VmJobType.BLOCK) {
VmBlockJob blockJob = (VmBlockJob) entity;
mapper.addValue("block_job_type", blockJob.getBlockJobType().getValue());
mapper.addValue("bandwidth", blockJob.getBandwidth());
mapper.addValue("cursor_cur", blockJob.getCursorCur());
mapper.addValue("cursor_end", blockJob.getCursorEnd());
mapper.addValue("image_group_id", blockJob.getImageGroupId());
} else {
mapper.addValue("block_job_type", null);
mapper.addValue("bandwidth", null);
mapper.addValue("cursor_cur", null);
mapper.addValue("cursor_end", null);
mapper.addValue("image_group_id", null);
}
return mapper;
}
Aggregations