Skip to content

Commit

Permalink
Get stock added.
Browse files Browse the repository at this point in the history
  • Loading branch information
huljas committed Mar 30, 2012
1 parent 789956e commit 0551211
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -32,4 +32,6 @@ public interface StockRepository {
TradeOrder getLastTrade(Stock stock);

TradeOrder getLastTradeSince(Stock stock, Date date);

Stock getStock(Long id);
}
Expand Up @@ -119,4 +119,8 @@ public TradeOrder getLastTradeSince(Stock stock, Date since) {
.setMaxResults(1).getResultList();
if (prices.isEmpty()) return null; else return prices.get(0);
}

public Stock getStock(Long id) {
return em.find(Stock.class, id);
}
}

0 comments on commit 0551211

Please sign in to comment.