KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > inheritance > singletable > Music


1 //$Id: Music.java,v 1.1 2005/06/16 19:07:14 epbernard Exp $
2
package org.hibernate.test.annotations.inheritance.singletable;
3
4 import javax.persistence.Entity;
5 import javax.persistence.Id;
6 import javax.persistence.GeneratorType;
7 import javax.persistence.Column;
8
9 import org.hibernate.annotations.DiscriminatorFormula;
10
11 /**
12  * @author Emmanuel Bernard
13  */

14 @Entity
15 @DiscriminatorFormula("case when zik_type is null then 0 else zik_type end")
16 public abstract class Music {
17     private Integer JavaDoc id;
18     private int avgBeat;
19     private Integer JavaDoc type;
20
21     @Column(name="zik_type")
22     public Integer JavaDoc getType() {
23         return type;
24     }
25
26     public void setType(Integer JavaDoc type) {
27         this.type = type;
28     }
29
30     @Id(generate=GeneratorType.AUTO)
31     public Integer JavaDoc getId() {
32         return id;
33     }
34
35     public void setId(Integer JavaDoc id) {
36         this.id = id;
37     }
38
39     public int getAvgBeat() {
40         return avgBeat;
41     }
42
43     public void setAvgBeat(int avgBeat) {
44         this.avgBeat = avgBeat;
45     }
46 }
47
Popular Tags