Project

General

Profile

« Previous | Next » 

Revision 49976

introduced ApiParam interface to decouple Spring data from plain JDBC implementations

View differences:

modules/dnet-datasource-manager-common/trunk/src/main/java/eu/dnetlib/enabling/datasources/common/Api.java
18 18
 * Api
19 19
 */
20 20
@MappedSuperclass
21
public class Api<AP extends ApiParam<?>> implements Comparable<Api<AP>> {
21
public class Api<AP extends ApiParam> implements Comparable<Api<AP>> {
22 22

  
23 23
	@Id
24 24
	protected String id = null;
modules/dnet-datasource-manager-common/trunk/src/main/java/eu/dnetlib/enabling/datasources/common/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