forked from rmuri/TravelCompanionScala
/
Tour.scala
46 lines (35 loc) · 991 Bytes
/
Tour.scala
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
package TravelCompanionScala {
package model {
import javax.persistence._
import java.util._
import org.hibernate.validator.constraints._
import javax.validation.constraints._
import java.util
/**
* Created by IntelliJ IDEA.
* User: dhobi
* Date: 08.04.2010
* Time: 15:57:00
* To change this template use File | Settings | File Templates.
*/
@Entity
@Table(name = "tours")
class Tour {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = _
@Column(name = "name")
@NotEmpty
var name: String = ""
@Column(name = "description")
var description: String = ""
@ManyToOne
@NotNull
var owner: Member = null
@OneToMany(mappedBy = "tour", cascade = Array(CascadeType.ALL), targetEntity = classOf[Stage])
var stages: util.List[Stage] = new util.ArrayList[Stage]()
@OneToMany(mappedBy = "tour", cascade = Array(CascadeType.ALL), targetEntity = classOf[BlogEntry])
var blogEntries: util.List[BlogEntry] = new util.ArrayList[BlogEntry]()
}
}
}