Clover Coverage Report - KS Admin 1.3.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
26   110   14   2.17
4   70   0.54   12
12     1.17  
1    
 
  KsMetaBusinessObjectBase       Line # 11 26 0% 14 42 0% 0.0
 
No Tests
 
1    package org.kuali.student.core.bo;
2   
3    import java.util.Date;
4   
5    import org.apache.commons.lang.StringUtils;
6    import org.apache.ojb.broker.PersistenceBroker;
7    import org.apache.ojb.broker.PersistenceBrokerException;
8    import org.kuali.rice.kns.service.KNSServiceLocator;
9    import org.kuali.rice.kns.util.GlobalVariables;
10   
 
11    public class KsMetaBusinessObjectBase extends KsBusinessObjectBase implements KsMetaBusinessObject {
12   
13    private static final long serialVersionUID = -6804800481530556124L;
14   
15   
16    private String createId;
17   
18    private Date createDate;
19   
20    private String updateId;
21   
22    private Date updateDate;
23   
24   
25    /**
26    * This will take properties and create a Meta object to return, the value is not persisted.
27    * This is to support the KS embedded style Meta object for future compatibility. OJB/KNS
28    * do not seem to support embedded entities (called Nested in OJB terms).
29    */
 
30  0 toggle @Override
31    public Meta getMeta() {
32  0 Meta meta = new Meta();
33   
34  0 meta.setCreateId(createId);
35  0 meta.setCreateTime(createDate);
36  0 meta.setUpdateId(updateId);
37  0 meta.setUpdateTime(updateDate);
38   
39  0 return meta;
40    }
41   
42    /**
43    * This will set the internal properties from the incoming Meta object.
44    * This is to support the KS embedded style Meta object for future compatibility. OJB/KNS
45    * do not seem to support embedded entities (called Nested in OJB terms).
46    *
47    * Uses setter methods to allow behavior from subclass.
48    */
 
49  0 toggle @Override
50    public void setMeta(Meta meta) {
51  0 this.setCreateId(meta.getCreateId());
52  0 this.setCreateDate(meta.getCreateTime());
53  0 this.setUpdateId(meta.getUpdateId());
54  0 this.setUpdateDate(meta.getCreateTime());
55    }
56   
 
57  0 toggle @Override
58    public void prePersist() throws PersistenceBrokerException {
59  0 super.prePersist();
60   
61  0 if (StringUtils.isBlank(this.getCreateId())) {
62  0 this.setCreateId(GlobalVariables.getUserSession().getPrincipalName());
63    }
64   
65  0 if (this.getCreateDate() == null) {
66  0 this.setCreateDate(KNSServiceLocator.getDateTimeService().getCurrentSqlDate());
67    }
68    }
69   
 
70  0 toggle @Override
71    public void preUpdate() {
72  0 super.preUpdate();
73   
74  0 this.setUpdateId(GlobalVariables.getUserSession().getPrincipalName());
75  0 this.setUpdateDate(KNSServiceLocator.getDateTimeService().getCurrentSqlDate());
76    }
77   
 
78  0 toggle public String getCreateId() {
79  0 return createId;
80    }
81   
 
82  0 toggle public void setCreateId(String createId) {
83  0 this.createId = createId;
84    }
85   
 
86  0 toggle public Date getCreateDate() {
87  0 return createDate;
88    }
89   
 
90  0 toggle public void setCreateDate(Date createDate) {
91  0 this.createDate = createDate;
92    }
93   
 
94  0 toggle public String getUpdateId() {
95  0 return updateId;
96    }
97   
 
98  0 toggle public void setUpdateId(String updateId) {
99  0 this.updateId = updateId;
100    }
101   
 
102  0 toggle public Date getUpdateDate() {
103  0 return updateDate;
104    }
105   
 
106  0 toggle public void setUpdateDate(Date updateDate) {
107  0 this.updateDate = updateDate;
108    }
109   
110    }