1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.bo.ui;
17
18 import java.sql.Timestamp;
19
20 import javax.persistence.Column;
21 import javax.persistence.Convert;
22 import javax.persistence.Embeddable;
23 import javax.persistence.MappedSuperclass;
24
25 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
26
27
28
29
30
31
32
33 @MappedSuperclass
34 public class KimDocumentBoActivatableToFromEditableBase extends KimDocumentBoBase {
35
36 private static final long serialVersionUID = 9042706897191231673L;
37
38 @Column(name="ACTV_IND")
39 @Convert(converter=BooleanYNConverter.class)
40 protected boolean active = true;
41
42 @Column(name="EDIT_FLAG")
43 @Convert(converter=BooleanYNConverter.class)
44 protected boolean edit;
45
46
47 @Column(name="ACTV_FRM_DT")
48 protected Timestamp activeFromDate;
49 @Column(name="ACTV_TO_DT")
50 protected Timestamp activeToDate;
51
52 public boolean isActive() {
53 long now = System.currentTimeMillis();
54 return (activeFromDate == null || now > activeFromDate.getTime()) && (activeToDate == null || now < activeToDate.getTime());
55 }
56
57 public void setActive(boolean active) {
58 this.active = active;
59 }
60
61 public boolean isEdit() {
62 return this.edit;
63 }
64
65 public void setEdit(boolean edit) {
66 this.edit = edit;
67 }
68
69
70
71
72 public Timestamp getActiveFromDate() {
73 return this.activeFromDate;
74 }
75
76
77
78
79 public void setActiveFromDate(Timestamp activeFromDate) {
80 this.activeFromDate = activeFromDate;
81 }
82
83
84
85
86 public Timestamp getActiveToDate() {
87 return this.activeToDate;
88 }
89
90
91
92
93 public void setActiveToDate(Timestamp activeToDate) {
94 this.activeToDate = activeToDate;
95 }
96
97 }