Exemplo n.º 1
0
  public CommentaryLog commentaryLog(Key gameKey, String commentary) {

    CommentaryLog cl = new CommentaryLog();
    cl.setKey(Datastore.allocateId(CommentaryLog.class));
    cl.setGameKey(gameKey);
    cl.setCommentary(commentary);
    cl.setDate(new Date());

    GlobalTransaction tx = Datastore.beginGlobalTransaction();
    tx.put(cl);
    tx.commit();

    return null;
  }
  @Override
  public Navigation run() throws Exception {

    Integer id = asInteger("id");
    if (id != null) {
      Key key = Datastore.createKey(PrizeRule.class, id);

      GlobalTransaction tx = Datastore.beginGlobalTransaction();
      Datastore.delete(key);
      tx.commit();

    } else {
      return redirect("prizeRules");
    }
    return redirect("prizeRules");
  }
Exemplo n.º 3
0
 public void save(GameData c) {
   GlobalTransaction tx = Datastore.beginGlobalTransaction();
   tx.put(c);
   tx.commit();
 }