-
Notifications
You must be signed in to change notification settings - Fork 2
/
Visit.java
42 lines (36 loc) · 1.21 KB
/
Visit.java
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
package com.springsource.petclinic.domain;
import javax.persistence.Entity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;
import javax.validation.constraints.Size;
import java.util.Date;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.springframework.format.annotation.DateTimeFormat;
import com.springsource.petclinic.domain.Pet;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import com.springsource.petclinic.domain.Vet;
@Entity
@RooJavaBean
@RooToString
@RooEntity(finders = { "findVisitsByDescriptionAndVisitDate", "findVisitsByVisitDateBetween", "findVisitsByDescriptionLike" })
public class Visit {
@Size(max = 255)
private String description;
@NotNull
@Past
@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "S-")
private Date visitDate;
@NotNull
@ManyToOne(targetEntity = Pet.class)
@JoinColumn
private Pet pet;
@ManyToOne(targetEntity = Vet.class)
@JoinColumn
private Vet vet;
}