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   * The state of a {@link RouteNodeInstance} represented 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_NODE_INSTN_ST_T")
27  @AttributeOverride(name="stateId", column=@Column(name="RTE_NODE_INSTN_ST_ID"))
28  @NamedQueries({
29  	@NamedQuery(name="NodeState.FindNodeState", query="select n from NodeState as n where n.nodeInstance.routeNodeInstanceId = :routeNodeInstanceId and n.key = :key"),
30  	@NamedQuery(name="NodeState.FindNodeStateById", query="select n from NodeState as n where n.stateId = :nodeStateId")
31  })
32  public class NodeState extends State {
33  
34      private static final long serialVersionUID = -4382379569851955918L;
35  
36      @ManyToOne(fetch=FetchType.EAGER)
37  	@JoinColumn(name="RTE_NODE_INSTN_ID")
38  	private RouteNodeInstance nodeInstance;
39      @Version
40  	@Column(name="VER_NBR")
41  	private Integer lockVerNbr;
42      
43      public NodeState() {}
44      
45      public NodeState(String key, String value) {
46      	super(key, value);
47      }
48      
49      
50      public RouteNodeInstance getNodeInstance() {
51          return nodeInstance;
52      }
53      public void setNodeInstance(RouteNodeInstance nodeInstance) {
54          this.nodeInstance = nodeInstance;
55      }
56  
57      public String getNodeStateId() {
58          return getStateId();
59      }
60  
61      public void setNodeStateId(String nodeStateId) {
62          setStateId(nodeStateId);
63      }
64  
65      public Integer getLockVerNbr() {
66          return lockVerNbr;
67      }
68  
69      public void setLockVerNbr(Integer lockVerNbr) {
70          this.lockVerNbr = lockVerNbr;
71      }
72  }