View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.engine.node;
17  
18  import javax.persistence.*;
19  
20  /**
21   * A piece of state on a {@link Branch} stored as a key-value pair of Strings.
22   *
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  @Entity
26  @Table(name="KREW_RTE_BRCH_ST_T")
27  @AttributeOverride(name="stateId", column=@Column(name="RTE_BRCH_ST_ID"))
28  public class BranchState extends State {
29      /**
30       * Prefix under which "variables" are stored in the branch state table, to distinguish
31       * them from non-variable key/value pairs.
32       */
33      public static final String VARIABLE_PREFIX = "var::";
34  
35      private static final long serialVersionUID = -7642477013444817952L;
36  
37      @ManyToOne(fetch=FetchType.EAGER)
38  	@JoinColumn(name="RTE_BRCH_ID")
39  	private Branch branch;
40      @Version
41  	@Column(name="VER_NBR")
42  	private Integer lockVerNbr;
43      
44      public BranchState() {}
45      
46      public BranchState(String key, String value) {
47      	super(key, value);
48      }
49      
50      public Branch getBranch() {
51          return branch;
52      }
53  
54      public void setBranch(Branch branch) {
55          this.branch = branch;
56      }
57  
58      public String getBranchStateId() {
59          return getStateId();
60      }
61  
62      public void setBranchStateId(String branchStateId) {
63          setStateId(branchStateId);
64      }
65  
66      public Integer getLockVerNbr() {
67          return lockVerNbr;
68      }
69  
70      public void setLockVerNbr(Integer lockVerNbr) {
71          this.lockVerNbr = lockVerNbr;
72      }
73  }
74