Java Reference
In-Depth Information
PendingOrderTestData.PAYMENT_INFORMATION;
po.updatePaymentInformation(paymentInfo, null);
}
});
}
J Updates
payment info
private void deletePendingOrder() {
doWithTransaction(new TxnCallback() {
public void execute() throws Exception {
PendingOrder po = (PendingOrder)load(PendingOrder.class,
pendingOrderId);
delete(po);
}
});
}
Deletes
PendingOrder
1)
}
HibernatePendingOrderPersistenceTests extends HibernatePersistenceTests .
Let's look at the details:
The setup() method creates a HibernateRestaurantRepositoryImpl .
The setup() method deletes existing data and inserts a restaurant.
The testSimple() method calls a sequence of helper methods.
The createPendingOrder() method creates a PendingOrder and calls save() , which
is a method defined by HibernatePersistenceTests that calls Hibernate.save() .
The updateDeliveryInfo() method updates the PendingOrder with delivery infor-
mation. It first calls load() , which is a method defined by HibernatePersisten-
ceTests that calls Hibernate.load() , and then calls updateDeliveryInfo() .
The updateRestaurant() method loads the pending order and calls Pending-
Order.updateRestaurant() .
The updateQuantities() method loads the pending order and updates the line
item quantities.
The updateQuantities() method loads the pending order and deletes one of the
line items.
The updatePaymentInformation() method loads the pending order and updates
the payment information.
The deletePendingOrder() method loads the pending order and deletes it.
B
C
D
E
F
G
H
I
J
1)
Search WWH ::




Custom Search