简体   繁体   中英

Setting a property to com.google.appengine.api.datastore.Entity

I have an entity which has property Person person(user defined object) so I wanted to setProperty("person", new Person()) however got an IllegalArgumentException "....Person is not a supported property type". It is a simple class with field String name and String country which implements Serializable.

class People{ Person person; }

I am trying to:

entityOfTypePeople.setProperty("person", new Person());

this is where I get "IllegalArgumentException ....Person is not a supported property type".

Properties are always String objects (see http://download.oracle.com/javase/1.5.0/docs/api/java/util/Properties.html and http://leepoint.net/notes-java/io/30properties_and_preferences/10properties.html ) as far as I know. I think you want to use java preferences not java properties (though to be fair, I don't know if GAE supports that or not).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM