public void customer() {
CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
List customers = customerDao.getAll();
for (Iterator i = customers.iterator(); i.hasNext();) {
Customer customer = (Customer)i.next();
System.out.println(customer);
}
customers = customerDao.getAllWithOnlyOnePermission();
for (Iterator i = customers.iterator(); i.hasNext();) {
Customer customer = (Customer)i.next();
System.out.println(customer);
}
Customer customer = new Customer();
customer.setFirstName("Jack");
customer.setLastName("Schitt");
customer.setPermissions(new HashSet());
customer.setAddresses(new HashSet());
CustomerAddress ca = new CustomerAddress();
ca.setLine1("1");
ca.setLine2("2");
ca.setCity("Manchester");
ca.setPostCode("M1 xx");
customer.getAddresses().add(ca);
Permission p = new Permission();
p.setPermissionId(1);
customer.getPermissions().add(p);
//customerDao.save(customer);
}