kantorn wrote:
Why is it madness, you think?
Sincerely,
The madness I was referring to to was that if you have say, 10 classes that all use address, my assumption is that you will have to duplicate the mapping code for address on each class that references address. I am more than likely wrong, but if I am right, than its madness (please someone hold up my hand and say I'm wrong).
Anyway, in essence all I'm trying to work out is a really simple mapping problem, how do I map this:
public class Customer {
private int id;
private Address address;
// getters and setters ommitted for brevity
}
public class Address {
private int id;
private String addressLine;
private String postCode;
}
to this database format
TABLE CUSTOMER with fields CUST_ID and foreign key ADDRESS_ID
TABLE ADDRESS with ADDRESS_ID ?
Help !