1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.test.document;
17
18 import javax.persistence.Column;
19 import javax.persistence.Entity;
20 import javax.persistence.Table;
21
22 import org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange;
23 import org.kuali.rice.krad.document.TransactionalDocumentBase;
24
25
26
27
28
29
30 @Entity
31 @Table(name="TST_SEARCH_ATTR_INDX_TST_DOC_T")
32 public class SearchAttributeIndexTestDocument extends TransactionalDocumentBase {
33 static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(SearchAttributeIndexTestDocument.class);
34 private static final long serialVersionUID = -2290510385815271758L;
35 @Column(name="RTE_LVL_CNT")
36 private Long routeLevelCount = 0L;
37 @Column(name="CNSTNT_STR")
38 private String constantString;
39 @Column(name="RTD_STR")
40 private String routedString;
41 @Column(name="HLD_RTD_STR")
42 private String heldRoutedString;
43 @Column(name="RD_ACCS_CNT")
44 private Long readAccessCount = 0L;
45
46
47
48
49
50
51 public void initialize(String constantString, String routedString) {
52 this.constantString = constantString;
53 this.heldRoutedString = routedString;
54 }
55
56
57
58
59 public Long getRouteLevelCount() {
60 readAccessCount += 1L;
61 return routeLevelCount;
62 }
63
64
65
66
67 public String getConstantString() {
68 return constantString;
69 }
70
71
72
73
74 public String getRoutedString() {
75 return routedString;
76 }
77
78 public String getHeldRoutedString() {
79 return heldRoutedString;
80 }
81
82
83
84
85 public Long getReadAccessCount() {
86 return this.readAccessCount;
87 }
88
89
90
91
92
93
94 @Override
95 public void doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) {
96 super.doRouteLevelChange(levelChangeEvent);
97 routeLevelCount += 1L;
98 if (routedString == null) {
99 routedString = heldRoutedString;
100 }
101 LOG.info("Performing route level change on SearchAttributeIndexTestDocument; routeLevelCount is "+routeLevelCount);
102 }
103
104 }