KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > singleinheritance > 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.singleinheritance.bean;
8
9 import javax.persistence.DiscriminatorType;
10 import javax.persistence.Entity;
11 import javax.persistence.Inheritance;
12 import javax.persistence.InheritanceType;
13
14 @Entity
15 @Inheritance(strategy = InheritanceType.SINGLE_TABLE, discriminatorType = DiscriminatorType.STRING, discriminatorValue = "CAT")
16 public class Cat extends Pet
17 {
18    public String JavaDoc getHairball()
19    {
20       return hairball;
21    }
22
23    public void setHairball(String JavaDoc hairball)
24    {
25       this.hairball = hairball;
26    }
27
28    String JavaDoc hairball;
29
30 }
31
Popular Tags