package eu.dnetlib.data.openaire.dsm.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name = "dsm_apiparams")
@IdClass(ApiParamPK.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ApiParam implements Serializable {

	private static final long serialVersionUID = -8548855970690750005L;

	@Id
	@ManyToOne
	@JoinColumn(name = "api")
	private final Api api = null;

	@Id
	private String param;

	@Column(name = "value")
	private String value;

	public String getParam() {
		return param;
	}

	public void setParam(final String param) {
		this.param = param;
	}

	public String getValue() {
		return value;
	}

	public void setValue(final String value) {
		this.value = value;
	}

	@JsonIgnore
	public Api getApi() {
		return api;
	}

}
