1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.impl.common.active;
17
18 import java.sql.Timestamp;
19
20 import javax.persistence.Column;
21 import javax.persistence.MappedSuperclass;
22
23 import org.joda.time.DateTime;
24 import org.kuali.rice.core.api.mo.common.active.InactivatableFromToUtils;
25 import org.kuali.rice.krad.bo.DataObjectBase;
26
27 @MappedSuperclass
28 public abstract class ActiveFromToBo extends DataObjectBase {
29 private static final long serialVersionUID = -7272085876524380076L;
30 @Column(name = "ACTV_FRM_DT")
31 private Timestamp activeFromDateValue;
32 @Column(name = "ACTV_TO_DT")
33 private Timestamp activeToDateValue;
34
35 public boolean isActive(Timestamp activeAsOfDate) {
36 return InactivatableFromToUtils.isActive(getActiveFromDate(), getActiveToDate(), new DateTime(activeAsOfDate.getTime()));
37 }
38
39 public boolean isActive(DateTime activeAsOfDate) {
40 return InactivatableFromToUtils.isActive(getActiveFromDate(), getActiveToDate(), activeAsOfDate);
41 }
42
43 public boolean isActive() {
44 return InactivatableFromToUtils.isActive(getActiveFromDate(), getActiveToDate(), null);
45 }
46
47 public DateTime getActiveFromDate() {
48 return this.activeFromDateValue == null ? null : new DateTime(this.activeFromDateValue.getTime());
49 }
50
51 public DateTime getActiveToDate() {
52 return this.activeToDateValue == null ? null : new DateTime(this.activeToDateValue.getTime());
53 }
54
55 public Timestamp getActiveFromDateValue() {
56 return activeFromDateValue;
57 }
58
59 public void setActiveFromDateValue(Timestamp activeFromDateValue) {
60 this.activeFromDateValue = activeFromDateValue;
61 }
62
63 public Timestamp getActiveToDateValue() {
64 return activeToDateValue;
65 }
66
67 public void setActiveToDateValue(Timestamp activeToDateValue) {
68 this.activeToDateValue = activeToDateValue;
69 }
70 }