コード例 #1
0
 public void addSymbol(String symbol) {
   Stock stock = Stock.find("bySymbol", symbol).one();
   if (stock == null) {
     stock = new Stock(symbol);
     stock.save();
   }
 }
コード例 #2
0
 public void removeSymbol(String symbol) {
   Stock stock = Stock.find("bySymbol", symbol).one();
   if (stock != null) {
     stock.delete();
   }
 }