Java Reference
In-Depth Information
transaction.rollback();
I
Closes
the EntityManager
if (em != null)
em.close();
}
}
public void test() throws Throwable {
bbb
doWithTransaction(new TxnCallback() {
bbb
public void execute() throws Exception {
J
Creates and persists
PendingOrder
bbb
PendingOrder po = new PendingOrder();
bbb
em.persist(po);
bbb
poId = po.getId();
bbb
}
bbb
});
doWithTransaction(new TxnCallback() {
public void execute() throws Exception {
RestaurantRepository rr = new EJB3RestaurantRepository(em);
Class<PendingOrder> type = PendingOrder.class;
PendingOrder po = em.find(type, poId);
assertEquals(
PlaceOrderStatusCodes.OK,
po.updateDeliveryInfo(
rr,
RestaurantTestData
.getADDRESS1(),
RestaurantTestData
bbbbbbbbbbbbbbbbbb
bb
.makeGoodDeliveryTime(),
bbbbbbbbbb
false));
1)
Updates PendingOrder's
delivery info
....
}
..
})
..
}
}
Search WWH ::
Custom Search