KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > inheritance > mixed > Document


1 //$Id: Document.java,v 1.2 2005/07/20 00:18:06 epbernard Exp $
2
package org.hibernate.test.annotations.inheritance.mixed;
3
4 import javax.persistence.Column;
5 import javax.persistence.Entity;
6 import javax.persistence.Inheritance;
7 import javax.persistence.SecondaryTable;
8
9 /**
10  * @author Emmanuel Bernard
11  */

12 @Entity
13 @Inheritance(discriminatorValue="D")
14 @SecondaryTable(name="DocumentMixed")
15 public class Document extends File {
16     private int size;
17     
18     Document() {}
19     Document(String JavaDoc name, int size) {
20         super(name);
21         this.size = size;
22     }
23     
24     @Column(secondaryTable="DocumentMixed", nullable=false)
25     public int getSize() {
26         return size;
27     }
28
29     public void setSize(int size) {
30         this.size = size;
31     }
32 }
33
Popular Tags