public static void main(String[] args) {
TestRunner.run(TestXMLCustomerOrder.class);
}
private void persistEntities(EntityManager em) {
Customer c2 = new Customer();
c2.setCid( new Customer.CustomerKey("USA", 2) );
c2.setName("A&J Auto");
c2.setRating( CreditRating.GOOD );
c2.setAddress(new EAddress("2480 Campbell Ave", "Campbell", "CA"
, "95123"));
em.persist(c2);
Customer c1 = new Customer();
c1.setCid( new Customer.CustomerKey("USA", 1) );
c1.setName("Harry's Auto");
c1.setRating( CreditRating.GOOD );
c1.setAddress( new EAddress("12500 Monterey", "San Jose", "CA",
"95141"));
em.persist(c1);
Order o1 = new Order(ORDER_1_OID, ORDER_1_AMOUNT, ORDER_1_DELIVERED,
c1);
o1.setShipAddress(createUSAAddress(c1.getName()));
em.persist(o1);
Order o2 = new Order(ORDER_2_OID, ORDER_2_AMOUNT, ORDER_2_DELIVERED,
c1);
o2.setShipAddress(createCANAddress(c2.getName()));