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 | 0 | 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 | 0 | return InactivatableFromToUtils.isActive(new DateTime(activeFromDate), new DateTime(activeToDate), new DateTime(activeAsOfDate)); |
49 | |
} |
50 | |
|
51 | |
public void setActive(boolean active) { |
52 | |
|
53 | 0 | } |
54 | |
|
55 | |
public void setActiveFromDate(Timestamp from) { |
56 | 0 | this.activeFromDate = from; |
57 | 0 | } |
58 | |
|
59 | |
public void setActiveToDate(Timestamp to) { |
60 | 0 | this.activeToDate = to; |
61 | 0 | } |
62 | |
|
63 | |
public Timestamp getActiveFromDate() { |
64 | 0 | return this.activeFromDate; |
65 | |
} |
66 | |
|
67 | |
public Timestamp getActiveToDate() { |
68 | 0 | return this.activeToDate; |
69 | |
} |
70 | |
|
71 | |
public Timestamp getActiveAsOfDate() { |
72 | 0 | return this.activeAsOfDate; |
73 | |
} |
74 | |
|
75 | |
public void setActiveAsOfDate(Timestamp activeAsOfDate) { |
76 | 0 | this.activeAsOfDate = activeAsOfDate; |
77 | 0 | } |
78 | |
|
79 | |
public boolean isCurrent() { |
80 | 0 | return this.current; |
81 | |
} |
82 | |
|
83 | |
public void setCurrent(boolean current) { |
84 | 0 | this.current = current; |
85 | 0 | } |
86 | |
} |