Monday, October 31, 2011

Understanding Hibernate - Part I


A simple pojo class representing a customer

packageorg.training.hibernate;

importjava.io.Serializable;
importjava.util.List;
importjava.util.Set;

publicclassCustomerimplementsSerializable {
privateintcustomerID;
privateString customerName;
privateList<String> customerPhoneNumbers;
privateSet<String> customerAddress;
publicCustomer() {
// TODOAuto-generated constructor stub
}
publicCustomer(intcustomerID, String customerName,
List<String> customerPhoneNumbers, Set<String> customerAddress) {
super();
this.customerID= customerID;
this.customerName= customerName;
this.customerPhoneNumbers= customerPhoneNumbers;
this.customerAddress= customerAddress;
}

publicintgetCustomerID() {
returncustomerID;
}

publicvoidsetCustomerID(intcustomerID) {
this.customerID= customerID;
}

publicString getCustomerName() {
returncustomerName;
}

publicvoidsetCustomerName(String customerName) {
this.customerName= customerName;
}

publicList<String> getCustomerPhoneNumbers() {
returncustomerPhoneNumbers;
}

publicvoidsetCustomerPhoneNumbers(List<String> customerPhoneNumbers) {
this.customerPhoneNumbers= customerPhoneNumbers;
}

publicSet<String> getCustomerAddress() {
returncustomerAddress;
}

publicvoidsetCustomerAddress(Set<String> customerAddress) {
this.customerAddress= customerAddress;
}
}

No comments:

Post a Comment