package com.peetz.comics.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@NamedQueries({
	@NamedQuery(name="Issue.findAll", query="SELECT i from IssueEntity as i"),
	@NamedQuery(name="Issue.findByNumber", query="SELECT i from IssueEntity as i WHERE i.number = :number")
})

@Entity
@Table(name = "ISSUE")
public class IssueEntity {

    private Long id;
	
    private String number;

    private Boolean completed;
	
    private ComicEntity comic;
	
    private ArtistEntity writer;
	
    private ArtistEntity inker;
	
    private ArtistEntity penciler;
    
    private StoryArcEntity storyArc;

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public Long getId() { return id; }
	
    @SuppressWarnings("unused")
    private void setId(Long id) { this.id = id; }

    @Column
    public String getNumber() { return number; }

    public void setNumber(String number) { this.number = number; }

    @Column
    public Boolean getCompleted() { return completed; }
    public Boolean isCompleted() { return completed; }
	
    public void setCompleted(Boolean completed) { this.completed = completed; }
	
    public void setComic(ComicEntity comic) { this.comic = comic; }

    @ManyToOne
    public ComicEntity getComic() { return comic; }
	
    public void setWriter(ArtistEntity writer) { this.writer = writer; }

    @ManyToOne
    public ArtistEntity getWriter() { return writer; }
	
    public void setInker(ArtistEntity inker) { this.inker = inker; }

    @ManyToOne
    public ArtistEntity getInker() { return inker; }
	
    public void setPenciler(ArtistEntity penciler) { this.penciler = penciler; }
	
    @ManyToOne
    public ArtistEntity getPenciler() { return penciler; }
    
    public void setStoryArc(StoryArcEntity storyArc) { this.storyArc = storyArc; }
    
    @ManyToOne
    public StoryArcEntity getStoryArc() { return storyArc; }
}
