forked from rmuri/TravelCompanionScala
/
Stage.scala
47 lines (37 loc) · 798 Bytes
/
Stage.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
47
package TravelCompanionScala {
package model {
import javax.persistence._
import java.util._
import org.hibernate.validator.constraints._
import javax.validation.constraints._
/**
* Created by IntelliJ IDEA.
* User: dhobi
* Date: 13.04.2010
* Time: 09:19:50
* To change this template use File | Settings | File Templates.
*/
@Entity
@Table(name = "stages")
class Stage {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = _
@Column(name = "description")
var description: String = ""
@Column(name = "name")
@NotEmpty
var name: String = ""
@Temporal(TemporalType.DATE)
@Column(name = "startdate")
@NotNull
var startdate: Date = null
@OneToOne
@NotNull
var destination: Location = null
@ManyToOne
@NotNull
var tour: Tour = null
}
}
}