package eu.dnetlib.openaire.db.objects;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity(name = "authors")
@Table(name = "authors")
public class Author implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7874945969920281683L;

	@Id
	@Column(name = "authorID")
	private String authorID;
	
	@Column(name = "name")
	private String name;
	
	@Column(name = "surname")
	private String surname;
	
	@Column(name = "nationality")
	private String nationality;
	
	@OneToMany(mappedBy="author", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	private Collection<AuthorShip> authorShips;

	public String getAuthorID() {
		return authorID;
	}

	public void setAuthorID(String authorID) {
		this.authorID = authorID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getNationality() {
		return nationality;
	}

	public void setNationality(String nationality) {
		this.nationality = nationality;
	}

	public Collection<AuthorShip> getAuthorShips() {
		return authorShips;
	}

	public void setAuthorShips(Collection<AuthorShip> authorShips) {
		this.authorShips = authorShips;
	}

}
