KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > joininheritance > bean > Pet


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

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