package eu.dnetlib.goldoa.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.google.gwt.user.client.rpc.IsSerializable;

import javax.persistence.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;


/**
 * The persistent class for the publication_identifier database table.
 * 
 */
@Entity
@Table(name="identifier")
public class Identifier implements IsSerializable {
	private static final long serialVersionUID = 1L;

	@Id
	private BigInteger id;
	@Column(columnDefinition = "text")
	private String value;
	@Column(columnDefinition = "text")
	private String type;

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "identifiers")
	@JsonBackReference
	private List<Publication> publications = new ArrayList<>();

	public Identifier() {
	}

	public Identifier(String type, String value) {
		this.type = type;
		this.value = value;
	}

	public String getValue() {
		return this.value;
	}

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

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}
}