Clover Coverage Report - KS Admin 1.1.1-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
30   145   16   2
2   101   0.53   15
15     1.07  
1    
 
  KsVersionBusinessObjectBase       Line # 13 30 0% 16 47 0% 0.0
 
No Tests
 
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   
 
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   
 
38  0 toggle @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    * This will take properties and create a Version object to return, the value is not persisted.
51    * This is to support the KS embedded style Version object for future compatibility. OJB/KNS
52    * do not seem to support embedded entities (called Nested in OJB terms).
53    */
 
54  0 toggle @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    * This will set the internal properties from the incoming Version object.
70    * This is to support the KS embedded style Version object for future compatibility. OJB/KNS
71    * do not seem to support embedded entities (called Nested in OJB terms).
72    *
73    * Uses setter methods to allow behavior from subclass.
74    */
 
75  0 toggle @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   
 
85  0 toggle @Override
86    public String getVersionIndId() {
87  0 return versionIndId;
88    }
89   
 
90  0 toggle @Override
91    public void setVersionIndId(String versionIndId) {
92  0 this.versionIndId = versionIndId;
93    }
94   
 
95  0 toggle @Override
96    public Long getSequenceNumber() {
97  0 return sequenceNumber;
98    }
99   
 
100  0 toggle @Override
101    public void setSequenceNumber(Long sequenceNumber) {
102  0 this.sequenceNumber = sequenceNumber;
103    }
104   
 
105  0 toggle @Override
106    public Date getCurrentVersionStart() {
107  0 return currentVersionStart;
108    }
109   
 
110  0 toggle @Override
111    public void setCurrentVersionStart(Date currentVersionStart) {
112  0 this.currentVersionStart = currentVersionStart;
113    }
114   
 
115  0 toggle @Override
116    public Date getCurrentVersionEnd() {
117  0 return currentVersionEnd;
118    }
119   
 
120  0 toggle @Override
121    public void setCurrentVersionEnd(Date currentVersionEnd) {
122  0 this.currentVersionEnd = currentVersionEnd;
123    }
124   
 
125  0 toggle @Override
126    public String getVersionedFromId() {
127  0 return versionedFromId;
128    }
129   
 
130  0 toggle @Override
131    public void setVersionedFromId(String versionedFromId) {
132  0 this.versionedFromId = versionedFromId;
133    }
134   
 
135  0 toggle @Override
136    public String getVersionComment() {
137  0 return versionComment;
138    }
139   
 
140  0 toggle @Override
141    public void setVersionComment(String versionComment) {
142  0 this.versionComment = versionComment;
143    }
144   
145    }