看跌期权:
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
try{
Entity e = new Entity("Winners", "NFL" );
String winner_game = new String("winner_" + input_game );
e.setProperty(winner_game, input_win_value );
datastore.put(e);
……
获取:
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
try{
Entity e = datastore.get(KeyFactory.createKey("Winners", "NFL" ));
String winner_game = new String("winner_" + i );
if( e.getProperty(winner_game) != null )
{
Integer property = new Integer(e.getProperty( winner_game ).toString());
return property;
}
else{
return 0;
}
...
e.getProperty 正在返回 null ......有什么想法吗?