1 |
|
package org.kuali.student.core.bo; |
2 |
|
|
3 |
|
import java.util.Date; |
4 |
|
|
5 |
|
import javax.persistence.Column; |
6 |
|
import javax.persistence.Temporal; |
7 |
|
import javax.persistence.TemporalType; |
8 |
|
|
9 |
|
import org.apache.ojb.broker.PersistenceBroker; |
10 |
|
import org.apache.ojb.broker.PersistenceBrokerException; |
11 |
|
import org.kuali.student.common.util.UUIDHelper; |
12 |
|
|
|
|
| 0% |
Uncovered Elements: 47 (47) |
Complexity: 16 |
Complexity Density: 0.53 |
|
13 |
|
public abstract class KsVersionBusinessObjectBase extends KsMetaBusinessObjectBase implements KsVersionBusinessObject { |
14 |
|
|
15 |
|
private static final long serialVersionUID = -1307889585226114528L; |
16 |
|
|
17 |
|
@Column(name = "VER_IND_ID") |
18 |
|
private String versionIndId; |
19 |
|
|
20 |
|
@Column(name = "SEQ_NUM") |
21 |
|
private Long sequenceNumber; |
22 |
|
|
23 |
|
@Temporal(TemporalType.TIMESTAMP) |
24 |
|
@Column(name = "CURR_VER_START") |
25 |
|
private Date currentVersionStart; |
26 |
|
|
27 |
|
@Temporal(TemporalType.TIMESTAMP) |
28 |
|
@Column(name = "CURR_VER_END") |
29 |
|
private Date currentVersionEnd; |
30 |
|
|
31 |
|
@Column(name = "VER_FROM_ID") |
32 |
|
private String versionedFromId; |
33 |
|
|
34 |
|
@Column(name = "VER_CMT") |
35 |
|
private String versionComment; |
36 |
|
|
37 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
38 |
0
|
@Override... |
39 |
|
public void beforeInsert(PersistenceBroker persistenceBroker) throws PersistenceBrokerException { |
40 |
0
|
super.beforeInsert(persistenceBroker); |
41 |
|
|
42 |
0
|
if(this.getSequenceNumber() == null){ |
43 |
0
|
this.setSequenceNumber(Long.valueOf(1)); |
44 |
|
} |
45 |
|
|
46 |
0
|
this.setVersionIndId(UUIDHelper.genStringUUID(this.getVersionIndId())); |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
54 |
0
|
@Override... |
55 |
|
public Version getVersion() { |
56 |
0
|
Version version = new Version(); |
57 |
|
|
58 |
0
|
version.setVersionIndId(versionIndId); |
59 |
0
|
version.setSequenceNumber(sequenceNumber); |
60 |
0
|
version.setVersionedFromId(versionedFromId); |
61 |
0
|
version.setVersionComment(versionComment); |
62 |
0
|
version.setCurrentVersionStart(currentVersionStart); |
63 |
0
|
version.setCurrentVersionEnd(currentVersionEnd); |
64 |
|
|
65 |
0
|
return version; |
66 |
|
} |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
75 |
0
|
@Override... |
76 |
|
public void setVersion(Version version) { |
77 |
0
|
this.setVersionIndId(version.getVersionIndId()); |
78 |
0
|
this.setSequenceNumber(version.getSequenceNumber()); |
79 |
0
|
this.setVersionedFromId(version.getVersionedFromId()); |
80 |
0
|
this.setVersionComment(version.getVersionComment()); |
81 |
0
|
this.setCurrentVersionStart(version.getCurrentVersionStart()); |
82 |
0
|
this.setCurrentVersionEnd(version.getCurrentVersionEnd()); |
83 |
|
} |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0
|
@Override... |
86 |
|
public String getVersionIndId() { |
87 |
0
|
return versionIndId; |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0
|
@Override... |
91 |
|
public void setVersionIndId(String versionIndId) { |
92 |
0
|
this.versionIndId = versionIndId; |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0
|
@Override... |
96 |
|
public Long getSequenceNumber() { |
97 |
0
|
return sequenceNumber; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0
|
@Override... |
101 |
|
public void setSequenceNumber(Long sequenceNumber) { |
102 |
0
|
this.sequenceNumber = sequenceNumber; |
103 |
|
} |
104 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
0
|
@Override... |
106 |
|
public Date getCurrentVersionStart() { |
107 |
0
|
return currentVersionStart; |
108 |
|
} |
109 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
0
|
@Override... |
111 |
|
public void setCurrentVersionStart(Date currentVersionStart) { |
112 |
0
|
this.currentVersionStart = currentVersionStart; |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
0
|
@Override... |
116 |
|
public Date getCurrentVersionEnd() { |
117 |
0
|
return currentVersionEnd; |
118 |
|
} |
119 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
120 |
0
|
@Override... |
121 |
|
public void setCurrentVersionEnd(Date currentVersionEnd) { |
122 |
0
|
this.currentVersionEnd = currentVersionEnd; |
123 |
|
} |
124 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
125 |
0
|
@Override... |
126 |
|
public String getVersionedFromId() { |
127 |
0
|
return versionedFromId; |
128 |
|
} |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0
|
@Override... |
131 |
|
public void setVersionedFromId(String versionedFromId) { |
132 |
0
|
this.versionedFromId = versionedFromId; |
133 |
|
} |
134 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
0
|
@Override... |
136 |
|
public String getVersionComment() { |
137 |
0
|
return versionComment; |
138 |
|
} |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
0
|
@Override... |
141 |
|
public void setVersionComment(String versionComment) { |
142 |
0
|
this.versionComment = versionComment; |
143 |
|
} |
144 |
|
|
145 |
|
} |