Search in sources :

Example 6 with StockLocation

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;
}
Also used : StockLocation(eu.ggnet.dwoss.stock.ee.entity.StockLocation) ArrayList(java.util.ArrayList) Stock(eu.ggnet.dwoss.stock.ee.entity.Stock)

Aggregations

Stock (eu.ggnet.dwoss.stock.ee.entity.Stock)6 StockLocation (eu.ggnet.dwoss.stock.ee.entity.StockLocation)6 Test (org.junit.Test)5 StockUnit (eu.ggnet.dwoss.stock.ee.entity.StockUnit)4 LogicTransaction (eu.ggnet.dwoss.stock.ee.entity.LogicTransaction)2 StockTransaction (eu.ggnet.dwoss.stock.ee.entity.StockTransaction)2 StockTransactionPosition (eu.ggnet.dwoss.stock.ee.entity.StockTransactionPosition)2 StockTransactionStatus (eu.ggnet.dwoss.stock.ee.entity.StockTransactionStatus)2 Date (java.util.Date)2 StockLocationEao (eu.ggnet.dwoss.stock.ee.eao.StockLocationEao)1 ArrayList (java.util.ArrayList)1