summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKjetil Orbekk <Kjetil Ørbekk orbekk@pvv.ntnu.no>2010-09-03 12:47:52 -0400
committerKjetil Orbekk <Kjetil Ørbekk orbekk@pvv.ntnu.no>2010-09-03 12:47:56 -0400
commitef389445a475d3f96993e58dfd1a3fa82eb09ffb (patch)
tree922b2c127847e180a8f9d310e30ce7ee3549863d /src
parent813aa8ce9fc85838905f785250eadb34f974dba9 (diff)
Use Long id instead of Key as Quote's primary key
The datastore refuses to generate id's for other fields than the primary key. This is an easy fix.
Diffstat (limited to 'src')
-rw-r--r--src/lq/Quote.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lq/Quote.java b/src/lq/Quote.java
index 7a65294..b800a4f 100644
--- a/src/lq/Quote.java
+++ b/src/lq/Quote.java
@@ -12,13 +12,10 @@ import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
-@PersistenceCapable
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Quote {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
- private Key key;
-
- @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent
@@ -60,7 +57,6 @@ public class Quote {
return score;
}
- public Key getKey() { return key; }
public Long getId() { return id; }
public Date getTimestamp() { return timestamp; }
public Boolean getApproved() { return approved; }
@@ -70,7 +66,6 @@ public class Quote {
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; }