Hmm, I was afraid someone would suggest something like this.
Well I could also do something like
| public int getItemsCount()
| {
| this.getOrderitems().size();
| }
| public float getItemTotal()
| {
| float retVal = 0;
|
| for (Orderitem currentOrder : this.getOrderitems())
| {
| retVal += currentOrder.getQuantity() . currentOrder.getItem().getPrice();
| }
|
| return retVal;
| }
|
but I would consider this as sub-optimal, because doing this kind of computation could
also be done using the database, and I would say that it would be a little bit faster ...
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024555#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...