1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.bo;
17
18 import org.joda.time.DateTime;
19 import org.kuali.rice.core.api.mo.common.active.InactivatableFromToUtils;
20
21 import javax.persistence.Column;
22 import javax.persistence.MappedSuperclass;
23 import javax.persistence.Transient;
24 import java.sql.Timestamp;
25
26
27
28
29 @MappedSuperclass
30 public abstract class InactivatableFromToImpl extends PersistableBusinessObjectBase implements InactivatableFromTo {
31
32 private static final long serialVersionUID = 1L;
33
34 @Column(name = "ACTV_FRM_DT")
35 protected Timestamp activeFromDate;
36 @Column(name = "ACTV_TO_DT")
37 protected Timestamp activeToDate;
38 @Transient
39 protected Timestamp activeAsOfDate;
40 @Transient
41 protected boolean current;
42
43
44
45
46
47 public boolean isActive() {
48 return InactivatableFromToUtils.isActive(new DateTime(activeFromDate), new DateTime(activeToDate), new DateTime(activeAsOfDate));
49 }
50
51 public void setActive(boolean active) {
52
53 }
54
55 public void setActiveFromDate(Timestamp from) {
56 this.activeFromDate = from;
57 }
58
59 public void setActiveToDate(Timestamp to) {
60 this.activeToDate = to;
61 }
62
63 public Timestamp getActiveFromDate() {
64 return this.activeFromDate;
65 }
66
67 public Timestamp getActiveToDate() {
68 return this.activeToDate;
69 }
70
71 public Timestamp getActiveAsOfDate() {
72 return this.activeAsOfDate;
73 }
74
75 public void setActiveAsOfDate(Timestamp activeAsOfDate) {
76 this.activeAsOfDate = activeAsOfDate;
77 }
78
79 public boolean isCurrent() {
80 return this.current;
81 }
82
83 public void setCurrent(boolean current) {
84 this.current = current;
85 }
86 }