package northwind.jpamodel; import java.util.Set; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Version; @Entity public class Supplier { private int supplierID; private String companyName; private String contactName; private String contactTitle; private String phone; private String fax; private String homePage; private int rowVersion; private Location location; private Set<Product> products; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) public int getSupplierID() { return supplierID; } public void setSupplierID(int supplierID) { this.supplierID = supplierID; } @Column(length=40, nullable=false) public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } @Column(length=30) public String getContactName() { return contactName; } public void setContactName(String contactName) { this.contactName = contactName; } @Column(length=30) public String getContactTitle() { return contactTitle; } public void setContactTitle(String contactTitle) { this.contactTitle = contactTitle; } @Column(length=24) public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } @Column(length=24) public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public String getHomePage() { return homePage; } public void setHomePage(String homePage) { this.homePage = homePage; } @Version public int getRowVersion() { return rowVersion; } public void setRowVersion(int rowVersion) { this.rowVersion = rowVersion; } @Embedded public Location getLocation() { return location; } public void setLocation(Location location) { this.location = location; } @OneToMany(mappedBy="supplier") public Set<Product> getProducts() { return products; } public void setProducts(Set<Product> products) { this.products = products; } }