View Javadoc
1   /**
2    * Copyright 2005-2016 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.krms.impl.repository;
17  
18  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Entity;
22  import javax.persistence.FetchType;
23  import javax.persistence.GeneratedValue;
24  import javax.persistence.Id;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.ManyToOne;
27  import javax.persistence.Table;
28  import java.io.Serializable;
29  
30  @Entity
31  @Table(name = "KRMS_ACTN_ATTR_T")
32  public class ActionAttributeBo extends BaseAttributeBo implements Serializable {
33  
34      private static final long serialVersionUID = 1l;
35  
36      @PortableSequenceGenerator(name = "KRMS_ACTN_ATTR_S")
37      @GeneratedValue(generator = "KRMS_ACTN_ATTR_S")
38      @Id
39      @Column(name = "ACTN_ATTR_DATA_ID")
40      private String id;
41  
42      @ManyToOne()
43      @JoinColumn(name = "ACTN_ID")
44      private ActionBo action;
45  
46      @ManyToOne()
47      @JoinColumn(name = "ATTR_DEFN_ID", referencedColumnName = "ATTR_DEFN_ID")
48      private KrmsAttributeDefinitionBo attributeDefinition;
49  
50      @Override
51      public KrmsAttributeDefinitionBo getAttributeDefinition() {
52          return attributeDefinition;
53      }
54  
55      public void setAttributeDefinition(KrmsAttributeDefinitionBo attributeDefinition) {
56          this.attributeDefinition = attributeDefinition;
57      }
58  
59      public String getActionId() {
60          if (action != null) {
61              return action.getId();
62          }
63  
64          return null;
65      }
66  
67      public ActionBo getAction() {
68          return action;
69      }
70  
71      public void setAction(ActionBo action) {
72          this.action = action;
73      }
74  
75      @Override
76      public String getId() {
77          return id;
78      }
79  
80      public void setId(String id) {
81          this.id = id;
82      }
83  }