package policycompass.fcmmanager.models;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity (name="fcmmanager_models")
public class FCMModel {

	@Id
	@Column(name = "id", unique = true, nullable = false)
	private int id;
	@Column(name = "Title", nullable = false)
	private String Title;
	@Column(name = "Description", nullable = false)
	private String Description;
	@Column(name = "Keywords", nullable = false)
	private String Keywords;
	@Column(name = "UserID", nullable = false)
	private int UserID;
	@Column(name = "DateAddedtoPC", nullable = false)
	private Date DateAddedtoPC;
	@Column(name = "DateModified", nullable = false)
	private Date DateModified;
	@Column(name = "ViewsCount", nullable = false)
	private int ViewsCount;
	@Column(name = "UserPath", nullable = true)
	private String UserPath;
	@Column(name = "IsDraft", nullable = true)
	private Boolean IsDraft;
	@Column(name = "DerivedFromId", nullable = true)
	private Integer DerivedFromId;

	public FCMModel() {
		this.id = 0;
		this.Title = "";
		this.Description = "";
		this.Keywords = "";
		this.UserID = 0;
		this.ViewsCount = 0;
		this.UserPath = "";
		this.IsDraft = false;
		this.DerivedFromId = 0;
	}

	public FCMModel(int fcmid, String title, String description, String keywords, int userid, int viewscount, String UserPath, Boolean IsDraft, int DerivedFromId) {
		this.id = fcmid;
		this.Title = title;
		this.Description = description;
		this.Keywords = keywords;
		this.UserID = userid;
		this.ViewsCount = viewscount;
		this.UserPath = UserPath;
		this.IsDraft = IsDraft;
		this.DerivedFromId = DerivedFromId;
	}

	public int getId() { return id; }
	public void setId(int fcmid) { this.id = fcmid; }

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

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

	public String getKeywords() { return Keywords; }
	public void setKeywords(String keywords) { this.Keywords = keywords; }

	public int getUserID() { return UserID; }
	public void setUserID(int userid) { this.UserID = userid; }

	public Date getDateAddedtoPC() { return DateAddedtoPC; }
	public void setDateAddedtoPC(Date dateaddedtopc) { this.DateAddedtoPC = dateaddedtopc; }

	public Date getDateModified() { return DateModified; }
	public void setDateModified(Date datemodified) { this.DateModified = datemodified; }

	public int getViewsCount() { return ViewsCount; }
	public void setViewsCount(int viewscount) { this.ViewsCount = viewscount; }

	public String getUserPath() { return UserPath; }
	public void setUserPath(String userpath) { this.UserPath = userpath; }

	public Boolean getIsDraft() { return IsDraft; }
	public void setIsDraft(Boolean isDraft) { this.IsDraft = isDraft; }

	public int getDerivedFromId() { return DerivedFromId == null ? 0 : DerivedFromId; }
	public void setDerivedFromId(int derivedFromId) { this.DerivedFromId = derivedFromId; }

	public String toString() { return getId() + ", " + getTitle() + ", " + getDescription(); }
}
@@ -892,19 +892,20 @@
 name = %22
-IsD
+is_d
 raft%22, n
@@ -933,27 +933,28 @@
 ate Boolean 
-IsD
+is_d
 raft;%0A%09@Colu
@@ -1199,27 +1199,28 @@
  %22%22;%0A%09%09this.
-IsD
+is_d
 raft = false
@@ -1383,19 +1383,20 @@
 Boolean 
-IsD
+is_d
 raft, in
@@ -1612,21 +1612,23 @@
 his.
-IsD
+is_d
 raft = 
-IsD
+is_d
 raft
@@ -2795,19 +2795,20 @@
 lean get
-IsD
+is_d
 raft() %7B
@@ -2815,19 +2815,20 @@
  return 
-IsD
+is_d
 raft; %7D%0A
@@ -2843,19 +2843,20 @@
 void set
-IsD
+is_d
 raft(Boo
@@ -2862,17 +2862,18 @@
 olean is
-D
+_d
 raft) %7B 
@@ -2881,11 +2881,12 @@
 his.
-IsD
+is_d
 raft
@@ -2890,17 +2890,18 @@
 aft = is
-D
+_d
 raft; %7D%0A

changing IsDraft to is_draft policycompass/policycompass#659