1
|
package eu.dnetlib.msro.openaireplus.workflows.nodes.claims;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
import org.springframework.jdbc.core.JdbcTemplate;
|
7
|
import org.springframework.stereotype.Component;
|
8
|
|
9
|
/**
|
10
|
* Created by Alessia Bardi on 23/06/2017.
|
11
|
*
|
12
|
* @author Alessia Bardi
|
13
|
*/
|
14
|
@Component
|
15
|
public class ClaimDatabaseUtils {
|
16
|
|
17
|
@Autowired
|
18
|
JdbcTemplate claimsJdbcTemplate;
|
19
|
|
20
|
public List<ClaimRel> query(String sqlQuery){
|
21
|
return this.claimsJdbcTemplate.query(sqlQuery,
|
22
|
(rs, rowNum) -> new ClaimRel().setSemantics(rs.getString("semantics"))
|
23
|
.setSource(rs.getString("source_id")).setSourceType(rs.getString("source_type"))
|
24
|
.setTarget(rs.getString("target_id")).setTargetType(rs.getString("target_type")));
|
25
|
}
|
26
|
|
27
|
|
28
|
}
|