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