Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

annotations_mapped_superclass

Otávio Santana edited this page Aug 6, 2013 · 1 revision

Father's class


  @MappedSuperclass
  public class Worker implements Serializable {

  @Column
  private String name;

  @Column
  private Double salary;

  //getter and setter

 }

child's class


  @Entity
  public class Engineer extends Worker {

  @Id
  private String nickName;

  @Column
  private String type;

  @Column
  private String especialization;

  //getter and setter

 }

Clone this wiki locally