package com.ibtp.kontor.library.entity;

import javax.persistence.*;

/**
 * Created by TPEETZ on 23.01.2015.
 */
@Entity
@Table(name = "BOOK")
public class BookEntity {

    private Long id;

    private String title;

    private AuthorEntity author;

    private String publisher;

    private String isbn;

    private Long page;

    private String edition;

    public BookEntity() {}

    public BookEntity(String title) {
        setTitle(title);
    }

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

    /* unused */
    public void setId(Long id) {
        this.id = id;
    }

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

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

    @ManyToOne
    public AuthorEntity getAuthor() {
        return author;
    }

    public void setAuthor(AuthorEntity author) {
        this.author = author;
    }

    @Column
    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    @Column
    public Long getPage() {
        return page;
    }

    public void setPage(Long page) {
        this.page = page;
    }

    @Column
    public String getEdition() {
        return edition;
    }

    public void setEdition(String edition) {
        this.edition = edition;
    }

    @Column
    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }
}
