KickJava   Java API By Example, From Geeks To Geeks.

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


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
13 @Entity
14 @Inheritance(strategy = InheritanceType.JOINED)
15 public class Cat extends Pet
16 {
17    int lives;
18
19    public int getLives()
20    {
21       return lives;
22    }
23
24    public void setLives(int lives)
25    {
26       this.lives = lives;
27    }
28 }
29
Popular Tags