日期:2014-05-17 浏览次数:20722 次
for (DelStorageInventory delStorageInventory : delStorageInventorys) {
System.out.println(delStorageInventory.getId()); //这个id有值
DelStorageInventoryOut delStorageInventoryOut = new DelStorageInventoryOut();
System.out.println(delStorageInventoryOut.getId()); //这个id为null
delStorageInventoryOut.setSn(this.snDao.generate(Sn.Type.delStorageInventoryOut));
delStorageInventoryOut.setQuantity(delStorageInventory.getQuantity());
delStorageInventoryOut.setMember(this.memberService.getCurrent());
delStorageInventoryOut.setOperator(this.adminService.getCurrent());
delStorageInventoryOut.setDelStorageInventory(delStorageInventory);
this.delStorageInventoryOutService.save(delStorageInventoryOut);
}
org.hibernate.PersistentObjectException: detached entity passed to persist: com.delawaresaving.entity.DelStorageInventory