Assignment failure BUG, should not have made the mistake


Steps:


1. In a for loop so written:

supGoodsPrice.add (subOrderGood.getPrice ());

2. Then after the loop assignment:
order.setSupGoodsPrice (supGoodsPrice); 

3. order last saved to the database:
orderMapper.addOneOrder (order); 


Results:

Save the value sup_goods_price library is empty. . . . . .

Taibuyinggai low-level errors committed, step 1
supGoodsPrice.add (subOrderGood.getPrice ()); 

no assignment is successful, should be changed to supGoodsPrice = supGoodsPrice.add (subOrderGood.getPrice ()) ;


Note:

later still have to carefully point, to write good code, do not bug manufacturing By. Or how to achieve "China Dream."


Guess you like

Origin www.cnblogs.com/fanqie15/p/11022076.html