summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <orbekk@pvv.ntnu.no>2010-09-03 02:20:01 -0400
committerKjetil Ørbekk <orbekk@pvv.ntnu.no>2010-09-03 02:20:01 -0400
commitc14913afcb0de726801241e6b66533b52bce78a6 (patch)
tree271cb972b559a2180784e278f9e8a44fe840a4e5
parent1fb83a8c3edefbc2a43d26cc6db835e592d65934 (diff)
Minor improvements to the data objects
-rw-r--r--src/lq/ImportQuotes.java2
-rw-r--r--src/lq/Quote.java3
-rw-r--r--src/lq/Vote.java9
3 files changed, 5 insertions, 9 deletions
diff --git a/src/lq/ImportQuotes.java b/src/lq/ImportQuotes.java
index bda4a8f..30ad811 100644
--- a/src/lq/ImportQuotes.java
+++ b/src/lq/ImportQuotes.java
@@ -53,7 +53,7 @@ public class ImportQuotes extends HttpServlet {
try {
String importIdString = req.getParameter("importId");
if (importIdString == null) {
- uploadInChunks(pm, votes, 100);
+ // uploadInChunks(pm, votes, 100);
uploadInChunks(pm, quotes, 100);
resp.getWriter().println("Import finished.");
}
diff --git a/src/lq/Quote.java b/src/lq/Quote.java
index 8edefaa..7a65294 100644
--- a/src/lq/Quote.java
+++ b/src/lq/Quote.java
@@ -5,13 +5,14 @@ import com.google.appengine.api.datastore.Text;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
-@PersistenceCapable(identityType = IdentityType.APPLICATION)
+@PersistenceCapable
public class Quote {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
diff --git a/src/lq/Vote.java b/src/lq/Vote.java
index 65bdf6c..e566ac5 100644
--- a/src/lq/Vote.java
+++ b/src/lq/Vote.java
@@ -2,22 +2,20 @@ package lq;
import com.google.appengine.api.datastore.Key;
import java.util.Date;
+import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
-@PersistenceCapable(identityType = IdentityType.APPLICATION)
+@PersistenceCapable
public class Vote {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
- private Quote quote;
-
- @Persistent
private Long rating;
@Persistent
@@ -27,20 +25,17 @@ public class Vote {
private String ip;
public Vote(Long rating, String ip) {
- this.quote = quote;
this.ip = ip;
this.rating = rating;
timestamp = new Date();
}
public Key getKey() { return key; }
- public Quote getQuote() { return quote; }
public Date getTimestamp() { return timestamp; }
public String getIp() { return ip; }
public Long getRating() { return rating; }
public void setKey(Key key) { this.key = key; }
- public void setQuote(Quote quote) { this.quote = quote; }
public void setTimestamp(Date timestamp) { this.timestamp = timestamp; }
public void setIp(String ip) { this.ip = ip; }
public void setRating(Long rating) { this.rating = rating; }