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