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