0

プット :

    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 を返しています...何かアイデアはありますか?

4

1 に答える 1