summaryrefslogtreecommitdiff
path: root/src/lq/Quote.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lq/Quote.java')
-rw-r--r--src/lq/Quote.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/lq/Quote.java b/src/lq/Quote.java
index 7475ba0..b0595b7 100644
--- a/src/lq/Quote.java
+++ b/src/lq/Quote.java
@@ -1,6 +1,10 @@
package lq;
+import com.google.appengine.api.datastore.Key;
+import com.google.appengine.api.datastore.Text;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
@@ -11,6 +15,9 @@ import javax.jdo.annotations.PrimaryKey;
public class Quote {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+ private Key key;
+
+ @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
@@ -26,33 +33,40 @@ public class Quote {
private String author;
@Persistent
- private String content;
+ private Text content;
@Persistent
private String ip;
+ @Persistent
+ private List<Vote> votes;
+
public Quote(Date quoteDate, String author, String content, String ip) {
this.quoteDate = quoteDate;
this.author = author;
- this.content = content;
+ this.content = new Text(content);
this.ip = ip;
+ this.votes = new ArrayList<Vote>();
this.timestamp = new Date();
}
+ public Key getKey() { return key; }
public Long getId() { return id; }
public Date getTimestamp() { return timestamp; }
public Boolean getApproved() { return approved; }
public Date getQuoteDate() { return quoteDate; }
public String getAuthor() { return author; }
- public String getContent() { return content; }
+ public String getContent() { return content.getValue(); }
public String getIp() { return ip; }
+ public List<Vote> getVotes() { return votes; }
+ public void setKey(Key key) { this.key = key; }
public void setId(Long id) { this.id = id; }
public void setTimestamp(Date timestamp) { this.timestamp = timestamp; }
public void setApproved(Boolean approved) { this.approved = approved; }
public void setQuoteDate(Date quoteDate) { this.quoteDate = quoteDate; }
public void setAuthor(String author) { this.author = author; }
- public void setContent(String content) { this.content = content; }
+ public void setContent(String content) { this.content = new Text(content); }
public void setIp(String ip) { this.ip = ip; }
}