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.Embeddable;
22 import javax.persistence.MappedSuperclass;
23 import javax.persistence.Transient;
24
25
26
27
28
29
30
31 @MappedSuperclass
32 public class KimDocumentBoActiveToFromBase extends KimDocumentBoBase {
33
34 private static final long serialVersionUID = 9042706897191231671L;
35
36 @Column(name="ACTV_FRM_DT")
37 protected Timestamp activeFromDate;
38 @Column(name="ACTV_TO_DT")
39 protected Timestamp activeToDate;
40 @Transient
41 protected boolean edit;
42
43
44
45
46
47 public boolean isEdit() {
48 return this.edit;
49 }
50
51
52
53
54 public void setEdit(boolean edit) {
55 this.edit = edit;
56 }
57
58
59
60
61 public Timestamp getActiveFromDate() {
62 return this.activeFromDate;
63 }
64
65
66
67
68 public void setActiveFromDate(Timestamp activeFromDate) {
69 this.activeFromDate = activeFromDate;
70 }
71
72
73
74
75 public Timestamp getActiveToDate() {
76 return this.activeToDate;
77 }
78
79
80
81
82 public void setActiveToDate(Timestamp activeToDate) {
83 this.activeToDate = activeToDate;
84 }
85
86 public boolean isActive() {
87 long now = System.currentTimeMillis();
88 return (activeFromDate == null || now > activeFromDate.getTime()) && (activeToDate == null || now < activeToDate.getTime());
89 }
90
91 }