private Customer createCustomer(int id) throws Exception
{
System.out.println("CREATE CUSTOMER " + id);
try
{
Customer customer = new Customer();
customer.setName((id % 2 == 0) ? "JBoss" : "Red Hat");
Set<Contact> contacts = new HashSet<Contact>();
Contact kabir = new Contact();
kabir.setCustomer(customer);
kabir.setName("Kabir");
kabir.setTlf("1111");
contacts.add(kabir);
Contact bill = new Contact();
bill.setCustomer(customer);
bill.setName("Bill");
bill.setTlf("2222");
contacts.add(bill);
customer.setContacts(contacts);
getSessions().getCurrentSession().persist(customer);
return customer;
}
finally