package entity; import java.io.Serializable; import javax.persistence.*; /* * ONLINE CUSTOMER ENTITY CLASS-> This is an example of Joined table inheritance */ @Entity(name = "ONLINECUSTOMERJOINED") //Name of the entity @Table(name = "ONLINECUSTOMER") @DiscriminatorValue("ONLINE") @PrimaryKeyJoinColumn(name = "CUST_ID", referencedColumnName = "CUST_ID") public class OnlineCustomerJoined extends CustomerJoined implements Serializable { @Column(name = "WEBSITE", length = 100) private String website; public String getWebsite() { return website; } public void setWebsite( String website ) { this.website = website; } @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append(super.toString()); sb.append(" website: " + website); return sb.toString(); } }