-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
CupHolder.java
57 lines (46 loc) · 1.06 KB
/
CupHolder.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.jpa.test.beanvalidation;
import java.math.BigDecimal;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.NotNull;
/**
* @author Emmanuel Bernard
*/
@Entity
public class CupHolder {
@Id
@GeneratedValue
private Integer id;
private BigDecimal radius;
private String title;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Max(value = 10, message = "Radius way out")
@NotNull
public BigDecimal getRadius() {
return radius;
}
public void setRadius(BigDecimal radius) {
this.radius = radius;
}
@NotNull
@ValidTitle
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}