From ef389445a475d3f96993e58dfd1a3fa82eb09ffb Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 3 Sep 2010 12:47:52 -0400 Subject: 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. --- src/lq/Quote.java | 7 +------ 1 file changed, 1 insertion(+), 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,12 +12,9 @@ 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; @@ -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 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; } -- cgit v1.2.3