1 package org.hibernate.test.annotations.tableperclass; 3 4 import javax.persistence.Entity; 5 import javax.persistence.GeneratorType; 6 import javax.persistence.Id; 7 import javax.persistence.Inheritance; 8 import javax.persistence.InheritanceType; 9 10 13 @Entity 14 @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) 15 public class Machine { 16 private Integer id; 17 private Double weight; 18 19 @Id(generate=GeneratorType.TABLE) 20 public Integer getId() { 21 return id; 22 } 23 24 public void setId(Integer id) { 25 this.id = id; 26 } 27 28 public Double getWeight() { 29 return weight; 30 } 31 32 public void setWeight(Double weight) { 33 this.weight = weight; 34 } 35 } 36 | Popular Tags |