例から
@Model
public class Account {
@Attribute(primaryKey = true)
private Key key;
private Integer balance;
...
}
例からhttp://sites.google.com/site/slim3appengine/ これは1つのエンティティ(同じエンティティ)にすぎないため、送金を行うのに2つの異なるトランザクションが必要な理由がわかりません
Acount src = gtx.get(Acount.class, srcKey); //arent src and des same entity? why do 2 trans?
Acount dest = gtx.get(Acount.class, destKey);
if (src.getBalance() >= amount) {
src.setBalance(src.getBalance() - amount);
dest.setBalance(dest.getBalance() + amount);
}