package com.bookbase.bookbase.model.entity;

import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;

import java.util.Date;

@Entity
public class Book {

    @PrimaryKey(autoGenerate = true)
    private int uid;

    @ColumnInfo(name="is_read")
    private boolean isRead; //dont set
    private Date published; //can set
    private int rating; // dont set
    private int author; // dont set
    private String description; //can set
    private String edition; //can set
    private String isbn; //can set
    private String title; // set

    private Book(){
        // Privatise default constructor to force initialisation of required fields.
    }

    public Book(String title, int author){
        this.title = title;
        this.author = author;

        this.isRead = false;
        this.published = null;
        this.rating = 0;
        this.author = -1;
        this.description = "";
        this.edition = "";
        this.isbn = "";
    }

    public Book(String title,
                int author,
                Date published,
                String description,
                String edition,
                String isbn){
        this.title = title;
        this.author = author;
        this.published = published;
        this.description = description;
        this.edition = edition;
        this.isbn = isbn;

        this.isRead = false;
        this.rating = 0;
        this.author = -1;
    }



    public boolean getisRead(){ return isRead; }
    public Date getPublished(){ return published; }
    public int getRating(){ return rating; }
    public int getAuthor(){ return author; }
    public String getDescription(){ return description; }
    public String getEdition(){ return edition; }
    public String getIsbn(){ return isbn; }
    public String title(){ return title; }

    public void setIsRead(boolean isRead){
        this.isRead = isRead;
    }

    public void setPublished(Date published){
        this.published = published;
    }

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

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

    public void setDescription(String description){
        this.description = description;
    }

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

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

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

}

@@ -173,42 +173,63 @@
 oom.
-PrimaryKey;%0A%0Aimport java.util.Date
+Ignore;%0Aimport android.arch.persistence.room.PrimaryKey
 ;%0A%0A@
@@ -378,19 +378,8 @@
 ead;
- //dont set
 %0A   
@@ -387,20 +387,19 @@
 private 
-Date
+int
  publish
@@ -401,26 +401,16 @@
 blished;
- //can set
 %0A    pri
@@ -425,28 +425,16 @@
  rating;
- // dont set
 %0A    pri
@@ -453,20 +453,8 @@
 hor;
- // dont set
 %0A   
@@ -477,34 +477,24 @@
 description;
- //can set
 %0A    private
@@ -509,26 +509,16 @@
 edition;
- //can set
 %0A    pri
@@ -538,18 +538,8 @@
 sbn;
- //can set
 %0A   
@@ -564,16 +564,21 @@
 tle;
- // set%0A
+%0A%0A    @Ignore
 %0A   
@@ -678,32 +678,44 @@
  fields.%0A    %7D%0A%0A
+    @Ignore%0A
     public Book(
@@ -858,12 +858,9 @@
 d = 
-null
+0
 ;%0A  
@@ -1071,20 +1071,19 @@
         
-Date
+int
  publish
@@ -1466,16 +1466,55 @@
    %7D%0A%0A%0A%0A
+    public int getUid()%7B return uid; %7D%0A
     publ
@@ -1527,17 +1527,17 @@
 lean get
-i
+I
 sRead()%7B
@@ -1565,20 +1565,19 @@
  public 
-Date
+int
  getPubl
@@ -1887,24 +1887,88 @@
 n title; %7D%0A%0A
+    public void setUid(int uid)%7B%0A        this.uid = uid;%0A    %7D%0A%0A
     public v
@@ -2068,12 +2068,11 @@
 hed(
-Date
+int
  pub

Fix compile errors