package it.ramecera.screwdriver.waxds.copper;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/** The persistent class for the actors database table. */
@Entity
@Table(name = "actors", schema = "copper")
@NamedQuery(name = "Actor.findAll", query = "SELECT a FROM Actor a")
public class Actor implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer star;

	private Timestamp creationdate;

	private Timestamp firstlogin;

	private String firstname;

	private Timestamp lastlogin;

	private String lastname;

	private Timestamp lastupdatepassword;

	private String password;

	private Integer penalities;

	private Integer rating;

	private Timestamp updatedate;

	private String userid;

	// bi-directional many-to-one association to Author
	@OneToMany(mappedBy = "actor")
	private List<Author> authors;

	// bi-directional many-to-one association to Novel
	@OneToMany(mappedBy = "actor")
	private List<Novel> novels;

	public Actor() {
	}

	public Integer getStar() {
		return this.star;
	}

	public void setStar(Integer star) {
		this.star = star;
	}

	public Timestamp getCreationdate() {
		return this.creationdate;
	}

	public void setCreationdate(Timestamp creationdate) {
		this.creationdate = creationdate;
	}

	public Timestamp getFirstlogin() {
		return this.firstlogin;
	}

	public void setFirstlogin(Timestamp firstlogin) {
		this.firstlogin = firstlogin;
	}

	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public Timestamp getLastlogin() {
		return this.lastlogin;
	}

	public void setLastlogin(Timestamp lastlogin) {
		this.lastlogin = lastlogin;
	}

	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public Timestamp getLastupdatepassword() {
		return this.lastupdatepassword;
	}

	public void setLastupdatepassword(Timestamp lastupdatepassword) {
		this.lastupdatepassword = lastupdatepassword;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getPenalities() {
		return this.penalities;
	}

	public void setPenalities(Integer penalities) {
		this.penalities = penalities;
	}

	public Integer getRating() {
		return this.rating;
	}

	public void setRating(Integer rating) {
		this.rating = rating;
	}

	public Timestamp getUpdatedate() {
		return this.updatedate;
	}

	public void setUpdatedate(Timestamp updatedate) {
		this.updatedate = updatedate;
	}

	public String getUserid() {
		return this.userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public List<Author> getAuthors() {
		return this.authors;
	}

	public void setAuthors(List<Author> authors) {
		this.authors = authors;
	}

	public Author addAuthor(Author author) {
		getAuthors().add(author);
		author.setActor(this);

		return author;
	}

	public Author removeAuthor(Author author) {
		getAuthors().remove(author);
		author.setActor(null);

		return author;
	}

	public List<Novel> getNovels() {
		return this.novels;
	}

	public void setNovels(List<Novel> novels) {
		this.novels = novels;
	}

	public Novel addNovel(Novel novel) {
		getNovels().add(novel);
		novel.setActor(this);

		return novel;
	}

	public Novel removeNovel(Novel novel) {
		getNovels().remove(novel);
		novel.setActor(null);

		return novel;
	}

}