1 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 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 |