Revision 49976
Added by Claudio Atzori over 6 years ago
ApiParam.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.enabling.datasources.common; |
2 | 2 |
|
3 |
import javax.persistence.EmbeddedId; |
|
4 |
import javax.persistence.MappedSuperclass; |
|
3 |
public interface ApiParam { |
|
5 | 4 |
|
6 |
@MappedSuperclass |
|
7 |
public class ApiParam<APK extends ApiParamKey> { |
|
5 |
String getValue(); |
|
8 | 6 |
|
9 |
@EmbeddedId |
|
10 |
protected APK id; |
|
7 |
void setValue(String value); |
|
11 | 8 |
|
12 |
protected String value;
|
|
9 |
String getParam();
|
|
13 | 10 |
|
14 |
public ApiParam() {}
|
|
11 |
void setParam(String param);
|
|
15 | 12 |
|
16 |
public APK getId() { |
|
17 |
return id; |
|
18 |
} |
|
19 |
|
|
20 |
public ApiParam setId(final APK id) { |
|
21 |
this.id = id; |
|
22 |
return this; |
|
23 |
} |
|
24 |
|
|
25 |
public String getValue() { |
|
26 |
return value; |
|
27 |
} |
|
28 |
|
|
29 |
public void setValue(final String value) { |
|
30 |
this.value = value; |
|
31 |
} |
|
32 |
|
|
33 |
public String getParam() { |
|
34 |
return id.getParam(); |
|
35 |
} |
|
36 |
|
|
37 |
public void setParam(final String param) { |
|
38 |
getId().setParam(param); |
|
39 |
} |
|
40 |
|
|
41 | 13 |
} |
Also available in: Unified diff
introduced ApiParam interface to decouple Spring data from plain JDBC implementations