Search in sources :

Example 96 with MapSqlParameterSource

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

the class TagDaoImpl method attachUserGroupToTag.

@Override
public void attachUserGroupToTag(TagsUserGroupMap tagUserGroupMap) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("group_id", tagUserGroupMap.getGroupId()).addValue("tag_id", tagUserGroupMap.getTagId());
    getCallsHandler().executeModification("Inserttags_user_group_map", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 97 with MapSqlParameterSource

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

the class TagDaoImpl method detachUserFromTag.

@Override
public void detachUserFromTag(Guid tagId, Guid userId) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("user_id", userId);
    getCallsHandler().executeModification("Deletetags_user_map", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 98 with MapSqlParameterSource

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

the class TagDaoImpl method detachVdsFromTag.

@Override
public void detachVdsFromTag(Guid tagId, Guid vdsId) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("vds_id", vdsId);
    getCallsHandler().executeModification("Deletetags_vds_map", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 99 with MapSqlParameterSource

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

the class TagDaoImpl method attachTemplateToTag.

@Override
public void attachTemplateToTag(TagsTemplateMap tagTemplateMap) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagTemplateMap.getTagId()).addValue("vm_id", tagTemplateMap.getTemplateId()).addValue("DefaultDisplayType", tagTemplateMap.getDefaultDisplayType());
    getCallsHandler().executeModification("Inserttags_vm_map", parameterSource);
}
Also used : MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource)

Example 100 with MapSqlParameterSource

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

the class TagDaoImpl method detachUserGroupFromTag.

@Override
public void detachUserGroupFromTag(Guid tagId, Guid groupId) {
    MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("group_id", groupId).addValue("tag_id", tagId);
    getCallsHandler().executeModification("Deletetags_user_group_map", 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