use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmNumaNodeDaoImpl method insertNumaNodeMap.
private void insertNumaNodeMap(List<VmNumaNode> numaNodes) {
List<MapSqlParameterSource> vNodeToPnodeExecutions = new ArrayList<>();
for (VmNumaNode node : numaNodes) {
node.getVdsNumaNodeList().stream().map(index -> createVnodeToPnodeParametersMapper(index, node.getId())).forEach(vNodeToPnodeExecutions::add);
}
getCallsHandler().executeStoredProcAsBatch("InsertNumaNodeMap", vNodeToPnodeExecutions);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmPoolDaoImpl method update.
@Override
public void update(VmPool pool) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vm_pool_description", pool.getVmPoolDescription()).addValue("vm_pool_comment", pool.getComment()).addValue("vm_pool_id", pool.getVmPoolId()).addValue("vm_pool_name", pool.getName()).addValue("vm_pool_type", pool.getVmPoolType()).addValue("stateful", pool.isStateful()).addValue("parameters", pool.getParameters()).addValue("prestarted_vms", pool.getPrestartedVms()).addValue("cluster_id", pool.getClusterId()).addValue("max_assigned_vms_per_user", pool.getMaxAssignedVmsPerUser()).addValue("spice_proxy", pool.getSpiceProxy()).addValue("is_being_destroyed", pool.isBeingDestroyed()).addValue("is_auto_storage_select", pool.isAutoStorageSelect());
getCallsHandler().executeModification("UpdateVm_pools", parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmPoolDaoImpl method setBeingDestroyed.
@Override
public void setBeingDestroyed(Guid vmPoolId, boolean beingDestroyed) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vm_pool_id", vmPoolId).addValue("is_being_destroyed", beingDestroyed);
getCallsHandler().executeModification("SetVmPoolBeingDestroyed", parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmPoolDaoImpl method boundVmPoolPrestartedVms.
@Override
public void boundVmPoolPrestartedVms(Guid vmPoolId) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vm_pool_id", vmPoolId);
getCallsHandler().executeModification("BoundVmPoolPrestartedVms", parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class VmPoolDaoImpl method save.
@Override
public void save(VmPool pool) {
Guid id = pool.getVmPoolId();
if (Guid.isNullOrEmpty(id)) {
id = Guid.newGuid();
pool.setVmPoolId(id);
}
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vm_pool_description", pool.getVmPoolDescription()).addValue("vm_pool_comment", pool.getComment()).addValue("vm_pool_id", pool.getVmPoolId()).addValue("vm_pool_name", pool.getName()).addValue("vm_pool_type", pool.getVmPoolType()).addValue("stateful", pool.isStateful()).addValue("parameters", pool.getParameters()).addValue("prestarted_vms", pool.getPrestartedVms()).addValue("cluster_id", pool.getClusterId()).addValue("max_assigned_vms_per_user", pool.getMaxAssignedVmsPerUser()).addValue("spice_proxy", pool.getSpiceProxy()).addValue("is_being_destroyed", pool.isBeingDestroyed()).addValue("is_auto_storage_select", pool.isAutoStorageSelect());
getCallsHandler().executeModification("InsertVm_pools", parameterSource);
}
Aggregations