// Path: app/src/main/java/com/example/offline/model/Comment.java
// @Entity
// public class Comment implements Serializable {
// 
//     @PrimaryKey(autoGenerate = true)
//     private long id;
// 
//     @ColumnInfo(name = "photo_id")
//     private long photoId;
// 
//     @SerializedName("body")
//     @ColumnInfo(name = "comment_text")
//     private String commentText;
// 
//     @ColumnInfo(name = "timestamp")
//     private long timestamp;
// 
//     @ColumnInfo(name = "sync_pending")
//     private boolean syncPending;
// 
//     public long getId() {
//         return id;
//     }
// 
//     public long getPhotoId() {
//         return photoId;
//     }
// 
//     public String getCommentText() {
//         return commentText;
//     }
// 
//     public long getTimestamp() {
//         return timestamp;
//     }
// 
//     public boolean isSyncPending() {
//         return syncPending;
//     }
// 
//     @Ignore
//     public Comment(long photoId, String commentText) {
//         this.photoId = photoId;
//         this.commentText = commentText;
//         this.timestamp = System.currentTimeMillis();
//         this.syncPending = true;
//     }
// 
//     public Comment(long id, long photoId, String commentText, long timestamp, boolean syncPending) {
//         this.id = id;
//         this.photoId = photoId;
//         this.commentText = commentText;
//         this.timestamp = timestamp;
//         this.syncPending = syncPending;
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("Comment id: %s, text: %s, syncPending: %s", id, commentText, syncPending);
//     }
// }
// 
// Path: app/src/main/java/com/example/offline/model/ModelConstants.java
// public class ModelConstants {
//     public static final String DB_NAME = "offlinedb";
//     public static final long DUMMY_PHOTO_ID = 1L;
// }


import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;
import android.arch.persistence.room.RoomDatabase;
import android.content.Context;
import com.example.offline.model.Comment;
import com.example.offline.model.ModelConstants;
package com.example.offline.data;



@Database(entities = {Comment.class}, version = 1, exportSchema = false)
public abstract class CommentDatabase extends RoomDatabase {
    private static CommentDatabase instance;

    public static synchronized CommentDatabase getInstance(Context context) {
        if (instance == null) {
            instance = Room
// Path: app/src/main/java/com/example/offline/model/Comment.java
// @Entity
// public class Comment implements Serializable {
// 
//     @PrimaryKey(autoGenerate = true)
//     private long id;
// 
//     @ColumnInfo(name = "photo_id")
//     private long photoId;
// 
//     @SerializedName("body")
//     @ColumnInfo(name = "comment_text")
//     private String commentText;
// 
//     @ColumnInfo(name = "timestamp")
//     private long timestamp;
// 
//     @ColumnInfo(name = "sync_pending")
//     private boolean syncPending;
// 
//     public long getId() {
//         return id;
//     }
// 
//     public long getPhotoId() {
//         return photoId;
//     }
// 
//     public String getCommentText() {
//         return commentText;
//     }
// 
//     public long getTimestamp() {
//         return timestamp;
//     }
// 
//     public boolean isSyncPending() {
//         return syncPending;
//     }
// 
//     @Ignore
//     public Comment(long photoId, String commentText) {
//         this.photoId = photoId;
//         this.commentText = commentText;
//         this.timestamp = System.currentTimeMillis();
//         this.syncPending = true;
//     }
// 
//     public Comment(long id, long photoId, String commentText, long timestamp, boolean syncPending) {
//         this.id = id;
//         this.photoId = photoId;
//         this.commentText = commentText;
//         this.timestamp = timestamp;
//         this.syncPending = syncPending;
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("Comment id: %s, text: %s, syncPending: %s", id, commentText, syncPending);
//     }
// }
// 
// Path: app/src/main/java/com/example/offline/model/ModelConstants.java
// public class ModelConstants {
//     public static final String DB_NAME = "offlinedb";
//     public static final long DUMMY_PHOTO_ID = 1L;
// }


// Path: app/src/main/java/com/example/offline/data/CommentDatabase.java
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;
import android.arch.persistence.room.RoomDatabase;
import android.content.Context;
import com.example.offline.model.Comment;
import com.example.offline.model.ModelConstants;

package com.example.offline.data;



@Database(entities = {Comment.class}, version = 1, exportSchema = false)
public abstract class CommentDatabase extends RoomDatabase {
    private static CommentDatabase instance;

    public static synchronized CommentDatabase getInstance(Context context) {
        if (instance == null) {
            instance = Room
                    .databaseBuilder(context.getApplicationContext(), CommentDatabase.class, ModelConstants.DB_NAME)