use of org.springframework.jdbc.core.RowMapper in project ovirt-engine by oVirt.
the class TagDaoImpl method getTagVmByTagIdAndByVmId.
@Override
public TagsVmMap getTagVmByTagIdAndByVmId(Guid tagId, Guid vmId) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("vm_id", vmId);
RowMapper<TagsVmMap> mapper = (rs, rowNum) -> {
TagsVmMap entity = new TagsVmMap();
entity.setTagId(getGuidDefaultEmpty(rs, "tag_id"));
entity.setVmId(getGuidDefaultEmpty(rs, "vm_id"));
entity.setDefaultDisplayType((Integer) rs.getObject("DefaultDisplayType"));
return entity;
};
return getCallsHandler().executeRead("GetTagVmByTagIdAndByvmId", mapper, parameterSource);
}
use of org.springframework.jdbc.core.RowMapper in project ovirt-engine by oVirt.
the class TagDaoImpl method getTagVdsByTagIdAndByVdsId.
@Override
public TagsVdsMap getTagVdsByTagIdAndByVdsId(Guid tagId, Guid vdsId) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("vds_id", vdsId);
RowMapper<TagsVdsMap> mapper = (rs, rowNum) -> {
TagsVdsMap entity = new TagsVdsMap();
entity.setTagId(getGuidDefaultEmpty(rs, "tag_id"));
entity.setVdsId(getGuidDefaultEmpty(rs, "vds_id"));
return entity;
};
return getCallsHandler().executeRead("GetTagVdsBytagIdAndByVdsId", mapper, parameterSource);
}
use of org.springframework.jdbc.core.RowMapper in project ovirt-engine by oVirt.
the class TagDaoImpl method getTagUserByTagIdAndByuserId.
@Override
public TagsUserMap getTagUserByTagIdAndByuserId(Guid tagId, Guid userId) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("tag_id", tagId).addValue("user_id", userId);
RowMapper<TagsUserMap> mapper = (rs, rowNum) -> {
TagsUserMap entity = new TagsUserMap();
entity.setTagId(getGuidDefaultEmpty(rs, "tag_id"));
entity.setUserId(getGuidDefaultEmpty(rs, "user_id"));
return entity;
};
return getCallsHandler().executeRead("GetTagUserByTagIdAndByuserId", mapper, parameterSource);
}
use of org.springframework.jdbc.core.RowMapper in project ovirt-engine by oVirt.
the class TagDaoImpl method getTagVmMapByVmIdAndDefaultTag.
@Override
public List<TagsVmMap> getTagVmMapByVmIdAndDefaultTag(Guid vmid) {
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("vm_id", vmid);
RowMapper<TagsVmMap> mapper = (rs, rowNum) -> {
TagsVmMap entity = new TagsVmMap();
entity.setTagId(getGuidDefaultEmpty(rs, "tag_id"));
entity.setVmId(getGuidDefaultEmpty(rs, "vm_id"));
entity.setDefaultDisplayType((Integer) rs.getObject("DefaultDisplayType"));
return entity;
};
return getCallsHandler().executeReadList("GetnVmTagsByVmIdAndDefaultTag", mapper, parameterSource);
}
use of org.springframework.jdbc.core.RowMapper in project spring-data-jdbc by spring-projects.
the class JdbcQueryLookupStrategyUnitTests method prefersDeclaredQuery.
// GH-1061
@Test
void prefersDeclaredQuery() {
RowMapper<? extends NumberFormat> numberFormatMapper = mock(RowMapper.class);
QueryMappingConfiguration mappingConfiguration = new DefaultQueryMappingConfiguration().registerRowMapper(NumberFormat.class, numberFormatMapper);
RepositoryQuery repositoryQuery = getRepositoryQuery("annotatedQueryWithQueryAndQueryName", mappingConfiguration);
repositoryQuery.execute(new Object[] {});
verify(operations).queryForObject(eq("some SQL"), any(SqlParameterSource.class), any(RowMapper.class));
}
Aggregations