1 package ejava.examples.orm.rel.annotated;
2
3 import java.util.ArrayList;
4 import java.util.Collection;
5
6 import javax.persistence.*;
7
8
9
10
11
12
13
14 @Entity @Table(name="ORMREL_WANTED")
15 public class WantList {
16 @Id @GeneratedValue
17 private long id;
18 @ManyToMany
19 @JoinTable(name="ORMREL_WANTED_MEDIA")
20 private Collection<Media> media = new ArrayList<Media>();
21
22 public long getId() { return id; }
23
24 public Collection<Media> getMedia() { return media; }
25 public void setMedia(Collection<Media> media) {
26 this.media = media;
27 }
28 }