itemWarehouseFrom = (ItemWarehouse) sess.createQuery("FROM "+ItemWarehouse.class.getName()+" as iw WHERE iw.item=:item and iw.warehouse=:ware")
.setParameter("item", items)
.setParameter("ware", warehouses.get(cbFrom.getSelectedIndex()))
.uniqueResult();
if(itemWarehouseFrom == null || itemWarehouseFrom.getId().equalsIgnoreCase("")){
itemWarehouseFrom = new ItemWarehouse();
LogInformation log = new LogInformation();
log.setCreateDate(new Timestamp(System.currentTimeMillis()));
log.setActiveFlag(1);
itemWarehouseFrom.setItem(items);
itemWarehouseFrom.setWarehouse(warehouses.get(cbFrom.getSelectedIndex()));
itemWarehouseFrom.setQuantity("0");
itemWarehouseFrom.setLogInformation(log);
sess.save(itemWarehouseFrom);
}
itemWarehouseTo = (ItemWarehouse) sess.createQuery("FROM "+ItemWarehouse.class.getName()+" as iw WHERE iw.item=:item and iw.warehouse=:ware")
.setParameter("item", items)
.setParameter("ware", warehouses.get(cbTo.getSelectedIndex()))
.uniqueResult();
if(itemWarehouseTo == null || itemWarehouseTo.getId().equalsIgnoreCase("")){
itemWarehouseTo = new ItemWarehouse();
LogInformation log = new LogInformation();
log.setCreateDate(new Timestamp(System.currentTimeMillis()));
log.setActiveFlag(1);
itemWarehouseTo.setItem(items);
itemWarehouseTo.setWarehouse(warehouses.get(cbTo.getSelectedIndex()));