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