1 package pl.matsuo.core.model.numeration;
2
3 import pl.matsuo.core.model.AbstractEntity;
4 import pl.matsuo.core.model.api.TemporalEntity;
5
6 import javax.persistence.Entity;
7 import javax.persistence.Table;
8 import javax.persistence.Temporal;
9 import javax.persistence.UniqueConstraint;
10 import javax.validation.constraints.NotNull;
11 import java.util.Date;
12
13 import static javax.persistence.TemporalType.*;
14
15
16
17
18
19 @Entity
20 @Table(uniqueConstraints={
21 @UniqueConstraint(columnNames={ "idBucket", "code", "startDate" })
22 })
23 public class Numeration extends AbstractEntity implements TemporalEntity {
24
25
26 @NotNull
27 protected Integer value;
28
29
30
31 protected Integer idEntity;
32 @NotNull
33 protected Integer minValue;
34 protected Integer maxValue;
35 @NotNull
36 protected String code;
37 @NotNull
38 protected String pattern;
39 @Temporal(DATE)
40 private Date startDate;
41 @Temporal(DATE)
42 private Date endDate;
43
44
45 public Integer getValue() {
46 return value;
47 }
48 public void setValue(Integer value) {
49 this.value = value;
50 }
51 public String getPattern() {
52 return pattern;
53 }
54 public void setPattern(String pattern) {
55 this.pattern = pattern;
56 }
57 public String getCode() {
58 return code;
59 }
60 public void setCode(String code) {
61 this.code = code;
62 }
63 public Integer getMaxValue() {
64 return maxValue;
65 }
66 public void setMaxValue(Integer maxValue) {
67 this.maxValue = maxValue;
68 }
69 public Integer getMinValue() {
70 return minValue;
71 }
72 public void setMinValue(Integer minValue) {
73 this.minValue = minValue;
74 }
75 public Date getStartDate() {
76 return startDate;
77 }
78 public void setStartDate(Date startDate) {
79 this.startDate = startDate;
80 }
81 public Date getEndDate() {
82 return endDate;
83 }
84 public void setEndDate(Date endDate) {
85 this.endDate = endDate;
86 }
87 public Integer getIdEntity() {
88 return idEntity;
89 }
90 public void setIdEntity(Integer idEntity) {
91 this.idEntity = idEntity;
92 }
93 }
94