so I'm trying to create a google engine using servlets, filters, etc. I have a java file that looks something like this:
public class Idea implements Comparator<Idea> { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private User author; @Persistent private String content; @Persistent private Date date; @Persistent private Map<User, Boolean> positiveVotes ; @Persistent private Map<User, Boolean> negativeVotes; public Idea(User author, String content, Date date) { this.author = author; this.content = content; this.date = date; this.positiveVotes = new HashMap<User, Boolean>(); this.negativeVotes = new HashMap<User, Boolean>(); }
but when I try to run my program, I get an exception stack starting with:
Feb 13, 2010 5:01:23 PM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: /sign java.lang.IllegalArgumentException: positiveVotes: java.util.HashMap is not a supported property type. at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:145) at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:127) at com.google.appengine.api.datastore.Entity.setProperty(Entity.java:280)
So my question is why it complains that java.util.HashMap is not a supported property type, and also what can I do to get around it. Thank you hope someone answers soon.
java google-app-engine persistence
urfriend
source share