forked from chrishulbert/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.java
More file actions
executable file
·27 lines (23 loc) · 672 Bytes
/
Event.java
File metadata and controls
executable file
·27 lines (23 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package data;
import java.util.Set;
import javax.persistence.*;
@Entity
@Table(name="events")
public class Event {
@Id @GeneratedValue
Long id;
public Long getId() {return id;}
public void setId(Long id) {this.id = id;}
String name;
public String getName() {return name;}
public void setName(String value) {name = value;}
@ManyToMany
@JoinTable(
name="event_person",
joinColumns=@JoinColumn(name="event_id"),
inverseJoinColumns=@JoinColumn(name="person_id")
)
Set<Person> people;
public void setPeople(Set<Person> people) {this.people = people;}
public Set<Person> getPeople() {return people;}
}