1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.mock.utilities;
17
18
19 import java.util.Date;
20
21 import org.kuali.student.r2.common.dto.MetaInfo;
22 import org.kuali.student.r2.common.infc.*;
23
24
25
26
27
28
29 public class MockHelper {
30
31
32
33
34
35
36
37 public MetaInfo createMeta(Context context) {
38 MetaInfo mInfo = MetaInfo.newInstance();
39 Date now = new Date();
40 mInfo.setCreateId(context.getPrincipalId());
41 mInfo.setCreateTime(now);
42 mInfo.setUpdateId(context.getPrincipalId());
43 mInfo.setUpdateTime(now);
44 mInfo.setVersionInd("1");
45 return mInfo;
46 }
47
48
49
50
51
52
53
54
55 public MetaInfo updateMeta(Meta orig, Context context) {
56 Date now = new Date();
57 int oldVersionInd = Integer.parseInt(orig.getVersionInd());
58 MetaInfo mInfo = MetaInfo.getInstance(orig);
59 mInfo.setUpdateId(context.getPrincipalId());
60 mInfo.setUpdateTime(now);
61 mInfo.setVersionInd("" + (oldVersionInd + 1));
62 return mInfo;
63 }
64
65
66
67 }
68