Search in sources :

Example 66 with MapSqlParameterSource

use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.

the class NetworkClusterDaoImpl method setExclusiveFlagOnNetworkCluster.

private void setExclusiveFlagOnNetworkCluster(Guid clusterId, Guid networkId, String procedureName) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("cluster_id", clusterId).addValue("network_id", networkId);
    getCallsHandler().executeModification(procedureName, parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 67 with MapSqlParameterSource

use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.

the class NetworkClusterDaoImpl method save.

@Override
public void save(NetworkCluster cluster) {
    MapSqlParameterSource parameterSource = createAllFieldsParameterSource(cluster);
    getCallsHandler().executeModification("Insertnetwork_cluster", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 68 with MapSqlParameterSource

use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.

the class VdsDynamicDaoImpl method createFullParametersMapperForSave.

private MapSqlParameterSource createFullParametersMapperForSave(VdsDynamic vds) {
    MapSqlParameterSource parameterSource = createFullParametersMapper(vds);
    parameterSource.addValue("controlled_by_pm_policy", vds.isPowerManagementControlledByPolicy());
    return parameterSource;
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 69 with MapSqlParameterSource

use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.

the class VdsDynamicDaoImpl method updateExternalStatus.

public void updateExternalStatus(Guid id, ExternalStatus status) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vds_guid", id).addValue("external_status", status);
    getCallsHandler().executeModification("UpdateHostExternalStatus", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 70 with MapSqlParameterSource

use of org.springframework.jdbc.core.namedparam.MapSqlParameterSource in project ovirt-engine by oVirt.

the class VdsDynamicDaoImpl method remove.

@Override
public void remove(Guid id) {
    dnsResolverConfigurationDao.removeByVdsDynamicId(id);
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vds_id", id);
    getCallsHandler().executeModification("DeleteVdsDynamic", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Aggregations

MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)505 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)82 SqlParameterSource (org.springframework.jdbc.core.namedparam.SqlParameterSource)63 Test (org.junit.jupiter.api.Test)48 ArrayList (java.util.ArrayList)36 EmptyResultDataAccessException (org.springframework.dao.EmptyResultDataAccessException)34 ResultSet (java.sql.ResultSet)33 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)32 List (java.util.List)30 HashMap (java.util.HashMap)29 SQLException (java.sql.SQLException)25 Guid (org.ovirt.engine.core.compat.Guid)25 Collectors (java.util.stream.Collectors)16 CustomMapSqlParameterSource (org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource)16 Transactional (org.springframework.transaction.annotation.Transactional)16 java.util (java.util)13 Component (org.springframework.stereotype.Component)13 Map (java.util.Map)12 RowMapper (org.springframework.jdbc.core.RowMapper)11 Named (javax.inject.Named)10