use of eu.ggnet.dwoss.stock.ee.entity.StockLocation in project dwoss by gg-net.
the class StockGeneratorOperation method makeStocksAndLocations.
public List<Stock> makeStocksAndLocations(int amount) {
List<Stock> result = new ArrayList<>();
for (int i = 0; i < amount; i++) {
Stock s = new Stock(i);
s.setName("Lager#" + i);
em.persist(s);
for (String name : STOCK_LOCATION_NAMES) {
StockLocation sl = new StockLocation(name);
s.addStockLocation(sl);
em.persist(sl);
}
result.add(s);
}
return result;
}
Aggregations