use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class CpuProfileDaoImpl method createFullParametersMapper.
@Override
protected MapSqlParameterSource createFullParametersMapper(CpuProfile obj) {
MapSqlParameterSource map = super.createFullParametersMapper(obj);
map.addValue("cluster_id", obj.getClusterId());
return map;
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class StorageServerConnectionLunMapDaoImpl method save.
@Override
public void save(LUNStorageServerConnectionMap map) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("lun_id", map.getLunId()).addValue("storage_server_connection", map.getStorageServerConnection());
getCallsHandler().executeModification("InsertLUN_storage_server_connection_map", parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class SystemStatisticsDaoImpl method getSystemStatisticsValue.
@Override
public Integer getSystemStatisticsValue(String entity, String status) {
MapSqlParameterSource parameterSource = new CustomMapSqlParameterSource(dbEngineDialect).addValue("entity", entity).addValue("status", status);
RowMapper<Integer> mapper = (rs, rowNum) -> rs.getInt("val");
Map<String, Object> dbResults = dbEngineDialect.createJdbcCallForQuery(jdbcTemplate).withProcedureName("Getsystem_statistics").returningResultSet("RETURN_VALUE", mapper).execute(parameterSource);
return (Integer) DbFacadeUtils.asSingleResult((List<?>) dbResults.get("RETURN_VALUE"));
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class TagDaoImpl method getTagTemplateByTagIdAndByTemplateId.
/**
* In the database both Template and Vm Tags share the same tables and functions
*/
@Override
public TagsTemplateMap getTagTemplateByTagIdAndByTemplateId(Guid tagId, Guid vmId) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("vm_id", vmId);
RowMapper<TagsTemplateMap> mapper = (rs, rowNum) -> {
TagsTemplateMap entity = new TagsTemplateMap();
entity.setTagId(getGuidDefaultEmpty(rs, "tag_id"));
entity.setTemplateId(getGuidDefaultEmpty(rs, "vm_id"));
entity.setDefaultDisplayType((Integer) rs.getObject("DefaultDisplayType"));
return entity;
};
return getCallsHandler().executeRead("GetTagVmByTagIdAndByvmId", mapper, parameterSource);
}
use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.
the class TagDaoImpl method remove.
@Override
public void remove(Guid id) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", id);
getCallsHandler().executeModification("Deletetags", parameterSource);
}
Aggregations