KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tutorial > singleinheritance > 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.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 = "DOG")
16 public class Dog extends Pet
17 {
18    private String JavaDoc trick;
19
20    public String JavaDoc getTrick()
21    {
22       return trick;
23    }
24
25    public void setTrick(String JavaDoc trick)
26    {
27       this.trick = trick;
28    }
29
30 }
31
Popular Tags