KickJava   Java API By Example, From Geeks To Geeks.

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


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.Inheritance;
11 import javax.persistence.InheritanceType;
12 import javax.persistence.Inheritance;
13 import javax.persistence.InheritanceType;
14 import javax.persistence.Entity;
15
16 @Entity
17 @Inheritance(strategy = InheritanceType.JOINED)
18 public class Dog extends Pet
19 {
20    private int numBones;
21
22    public int getNumBones()
23    {
24       return numBones;
25    }
26
27    public void setNumBones(int numBones)
28    {
29       this.numBones = numBones;
30    }
31 }
32
Popular Tags