public Warehouse createOrUpdateWarehouse(final RequestData requestData, Warehouse warehouse, final WarehouseForm warehouseForm) {
if (warehouse == null) {
warehouse = new Warehouse();
Set<WarehouseMarketAreaRel> warehouseMarketAreas = new HashSet<WarehouseMarketAreaRel>();
WarehouseMarketAreaRel warehouseMarketArea = new WarehouseMarketAreaRel();
warehouseMarketArea.setMarketArea(requestData.getMarketArea());
warehouseMarketAreas.add(warehouseMarketArea);
warehouse.setWarehouseMarketAreaRels(warehouseMarketAreas);
}
if (StringUtils.isNotEmpty(warehouseForm.getCode())) {
warehouse.setCode(warehouseForm.getCode());