KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > array > Contest


1 //$Id: Contest.java,v 1.1 2005/05/12 13:33:26 epbernard Exp $
2
package org.hibernate.test.annotations.array;
3
4
5 import org.hibernate.annotations.IndexColumn;
6
7 import javax.persistence.CascadeType;
8 import javax.persistence.Entity;
9 import javax.persistence.GeneratorType;
10 import javax.persistence.Id;
11 import javax.persistence.OneToMany;
12
13 /**
14  * @author Emmanuel Bernard
15  */

16 @Entity
17 public class Contest {
18     private int id;
19     private Competitor[] results;
20
21     @Id(generate = GeneratorType.AUTO)
22     public int getId() {
23         return id;
24     }
25
26     public void setId(int id) {
27         this.id = id;
28     }
29     @OneToMany(cascade=CascadeType.ALL)
30     @IndexColumn(name="pos")
31     public Competitor[] getResults() {
32         return results;
33     }
34
35     public void setResults(Competitor[] results) {
36         this.results = results;
37     }
38 }
39
Popular Tags