KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > annotations > manytomany > Supplier


1 //$Id: Supplier.java,v 1.2 2005/06/23 14:10:56 epbernard Exp $
2
package org.hibernate.test.annotations.manytomany;
3
4 import java.util.Set JavaDoc;
5 import javax.persistence.Entity;
6 import javax.persistence.GeneratorType;
7 import javax.persistence.Id;
8 import javax.persistence.ManyToMany;
9
10 /**
11  * @author Emmanuel Bernard
12  */

13 @Entity
14 public class Supplier {
15     private Integer JavaDoc id;
16     private String JavaDoc name;
17
18     public String JavaDoc getName() {
19         return name;
20     }
21
22     public void setName(String JavaDoc name) {
23         this.name = name;
24     }
25
26     private Set JavaDoc<Store> suppStores;
27
28     @Id(generate=GeneratorType.AUTO)
29     public Integer JavaDoc getId() {
30         return id;
31     }
32
33     public void setId(Integer JavaDoc id) {
34         this.id = id;
35     }
36
37     @ManyToMany(mappedBy="suppliers")
38     public Set JavaDoc<Store> getSuppStores() {
39         return suppStores;
40     }
41
42     public void setSuppStores(Set JavaDoc<Store> suppStores) {
43         this.suppStores = suppStores;
44     }
45 }
46
Popular Tags