1 7 package org.jboss.tutorial.tableperinheritance.bean; 8 9 import javax.persistence.Entity; 10 import javax.persistence.GeneratorType; 11 import javax.persistence.Id; 12 import javax.persistence.Inheritance; 13 import javax.persistence.InheritanceType; 14 import javax.persistence.Id; 15 import javax.persistence.Inheritance; 16 import javax.persistence.InheritanceType; 17 import javax.persistence.Entity; 18 19 @Entity 20 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) 21 public class Pet implements java.io.Serializable 22 { 23 private int id; 24 private String name; 25 private double weight; 26 27 @Id(generate = GeneratorType.TABLE) 28 public int getId() 29 { 30 return id; 31 } 32 33 public void setId(int id) 34 { 35 this.id = id; 36 } 37 38 public String getName() 39 { 40 return name; 41 } 42 43 public void setName(String name) 44 { 45 this.name = name; 46 } 47 48 public double getWeight() 49 { 50 return weight; 51 } 52 53 public void setWeight(double weight) 54 { 55 this.weight = weight; 56 } 57 } 58 | Popular Tags |