use of org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource 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.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource in project ovirt-engine by oVirt.
the class BatchProcedureCallTest method getParamsSource.
protected CustomMapSqlParameterSource getParamsSource(Tags tag) {
CustomMapSqlParameterSource paramsSource = new CustomMapSqlParameterSource(dbEngineDialect);
paramsSource.addValue("description", tag.getDescription()).addValue("tag_id", tag.getTagId()).addValue("tag_name", tag.getTagName()).addValue("parent_id", tag.getParentId()).addValue("readonly", tag.getIsReadonly()).addValue("type", tag.getType());
return paramsSource;
}
use of org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource in project ovirt-engine by oVirt.
the class InterfaceDaoImpl method massClearNetworkFromNics.
@Override
public void massClearNetworkFromNics(List<Guid> nicIds) {
getCallsHandler().executeStoredProcAsBatch("Clear_network_from_nics", nicIds, id -> {
CustomMapSqlParameterSource paramSource = getCustomMapSqlParameterSource();
paramSource.addValue("id", id);
return paramSource;
});
}
Aggregations