EventStatus.java
1.47 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.insomnia.bortal.model;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
*
*/
@Entity
@Table(name = "event_status")
// , uniqueConstraints = { @UniqueConstraint(columnNames = { "status_name" }) })
@NamedQueries({
@NamedQuery(name = "EventStatus.findAll", query = "SELECT e FROM EventStatus e"),
@NamedQuery(name = "EventStatus.findByStatusName", query = "SELECT e FROM EventStatus e WHERE e.name = :name") })
public class EventStatus extends GenericEntity {
private static final long serialVersionUID = 1L;
@Column(name = "status_name", nullable = false, unique = true)
private String name;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "status")
private List<LanEvent> events;
public EventStatus() {
super();
};
public EventStatus(String name) {
super();
this.name = name;
}
public String getName() {
return name;
}
public void setName(String statusName) {
this.name = statusName;
}
public List<LanEvent> getEvents() {
return events;
}
public void setEvents(List<LanEvent> eventList) {
this.events = eventList;
}
}