Sorry. I am just facing this defeat. I just followed the instructions
startup page and modified it. I try to google this but cannot find the
answer. Any one can help me?

<pre>
package idv.petrie.prtm.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class GeneticMessage implements Message {

        @PersistenceCapable
        public enum Status {
                NEW, PREPROCESSED
        }

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;

        @Persistent
        private Date modifiedAt;

        @Persistent
        private String content;

        @Persistent(serialized = "true")
        private Status status;

        public GeneticMessage() {
                setModifiedAt();
                setStatus(Status.NEW);
        }

        public Key getKey() {
                return key;
        }

        public void setKey(Key key) {
                this.key = key;
        }

        public String getContent() {
                return content;
        }

        public void setContent(String content) {
                this.content = content;
        }

        public void setModifiedAt() {
                this.modifiedAt = new Date();
        }

        public Date getModifiedAt() {
                return modifiedAt;
        }

        public void setStatus(Status status) {
                this.status = status;
        }

        public Status getStatus() {
                return status;
        }
}
</pre>
<pre>
package idv.petrie.prtm.model;

import java.util.Date;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.Unique;

@PersistenceCapable
public class Tweet extends GeneticMessage implements Message {


        @Persistent
        @Unique
        private long id;

        @Persistent
        private Date createdAt;

        @Persistent
        private int fromUserId;

        public Tweet() {
                super();
        }

        public Tweet(String content) {
                this();
                setContent(content);
        }


        public Date getCreatedAt() {
                return createdAt;
        }

        public void setCreatedAt(Date createdAt) {
                this.createdAt = createdAt;
        }

        public int getFromUserId() {
                return fromUserId;
        }

        public void setFromUserId(int fromUserId) {
                this.fromUserId = fromUserId;
        }

        public void setId(long l) {
                this.id = l;
        }

        public long getId() {
                return id;
        }
}
</pre>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to