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