@Test public void shouldPersistAnAddress() throws Exception { Address address = new Address("Ritherdon Rd", "London", "8QE", "UK"); tx.begin(); em.persist(address); tx.commit(); assertNotNull(address.getId()); }
public Long getId() { return id; }
Customer { public Long getId() { return id; } }
Customer { public Long getId() { return id; } Customer();  Customer(String firstName, String lastName, String email); }
Customer { public Long getId() { return id; } Customer();  Customer(String firstName, String lastName, String email); Long getId(); String getFirstName(); void setFirstName(String firstName); String getLastName(); void setLastName(String lastName); String getEmail(); void setEmail(String email); Address getAddress(); void setAddress(Address address); }
Customer { public Long getId() { return id; } Customer();  Customer(String firstName, String lastName, String email); Long getId(); String getFirstName(); void setFirstName(String firstName); String getLastName(); void setLastName(String lastName); String getEmail(); void setEmail(String email); Address getAddress(); void setAddress(Address address);  }