package com.ibtp.kontor.comics.entity;


import javax.persistence.*;

/**
 * Created by TPEETZ on 19.01.2015.
 */
@NamedQueries({
        @NamedQuery(name="Volume.findAll", query="SELECT v from VolumeEntity as v"),
        @NamedQuery(name="Volume.findByTitle", query="SELECT v from VolumeEntity as v WHERE v.title = :title")
})

@Entity
@Table(name = "VOLUME")
public class VolumeEntity {

    private Long id;

    private String title;

    private ComicEntity comic;

    @Id
    @GeneratedValue(strategy= GenerationType.AUTO)
    public Long getId() { return id; }

    @SuppressWarnings("unused")
    private void setId(Long id) { this.id = id; }

    @Column
    public String getTitle() { return title; }

    public void setTitle(String title) { this.title = title; }

    @ManyToOne
    public ComicEntity getComic() { return comic; }

    public void setComic(ComicEntity comic) { this.comic = comic; }
}
