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.Embeddable;
23 import javax.persistence.MappedSuperclass;
24 import javax.persistence.Transient;
25 import java.sql.Timestamp;
26
27
28
29
30 @MappedSuperclass
31 public abstract class InactivatableFromToImpl extends PersistableBusinessObjectBase implements InactivatableFromTo {
32
33 private static final long serialVersionUID = 1L;
34
35
36
37
38
39 @Embeddable
40 private static final class WeaveMe extends InactivatableFromToImpl {}
41
42 @Column(name = "ACTV_FRM_DT")
43 protected Timestamp activeFromDate;
44 @Column(name = "ACTV_TO_DT")
45 protected Timestamp activeToDate;
46 @Transient
47 protected Timestamp activeAsOfDate;
48 @Transient
49 protected boolean current;
50
51
52
53
54
55 public boolean isActive() {
56 return InactivatableFromToUtils.isActive(activeFromDate == null ? null : new DateTime(activeFromDate),
57 activeToDate == null ? null : new DateTime(activeToDate),
58 new DateTime(activeAsOfDate));
59 }
60
61 public void setActive(boolean active) {
62
63 }
64
65 public void setActiveFromDate(Timestamp from) {
66 this.activeFromDate = from;
67 }
68
69 public void setActiveToDate(Timestamp to) {
70 this.activeToDate = to;
71 }
72
73 public Timestamp getActiveFromDate() {
74 return this.activeFromDate;
75 }
76
77 public Timestamp getActiveToDate() {
78 return this.activeToDate;
79 }
80
81 public Timestamp getActiveAsOfDate() {
82 return this.activeAsOfDate;
83 }
84
85 public void setActiveAsOfDate(Timestamp activeAsOfDate) {
86 this.activeAsOfDate = activeAsOfDate;
87 }
88
89 public boolean isCurrent() {
90 return this.current;
91 }
92
93 public void setCurrent(boolean current) {
94 this.current = current;
95 }
96 }