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.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.FetchType;
24  import javax.persistence.GeneratedValue;
25  import javax.persistence.Id;
26  import javax.persistence.JoinColumn;
27  import javax.persistence.ManyToOne;
28  import javax.persistence.Table;
29  import java.io.Serializable;
30  
31  @Entity
32  @Table(name = "KRMS_RULE_ATTR_T")
33  public class RuleAttributeBo extends BaseAttributeBo implements Serializable {
34  
35      private static final long serialVersionUID = 1l;
36  
37      @PortableSequenceGenerator(name = "KRMS_RULE_ATTR_S")
38      @GeneratedValue(generator = "KRMS_RULE_ATTR_S")
39      @Id
40      @Column(name = "RULE_ATTR_ID")
41      private String id;
42  
43      @ManyToOne()
44      @JoinColumn(name = "RULE_ID")
45      private RuleBo rule;
46  
47      @ManyToOne(cascade = CascadeType.REFRESH)
48      @JoinColumn(name = "ATTR_DEFN_ID", referencedColumnName = "ATTR_DEFN_ID")
49      private KrmsAttributeDefinitionBo attributeDefinition;
50  
51      @Override
52      public KrmsAttributeDefinitionBo getAttributeDefinition() {
53          return attributeDefinition;
54      }
55  
56      public void setAttributeDefinition(KrmsAttributeDefinitionBo attributeDefinition) {
57          this.attributeDefinition = attributeDefinition;
58      }
59  
60      public RuleBo getRule() {
61          return rule;
62      }
63  
64      public void setRule(RuleBo rule) {
65          this.rule = rule;
66      }
67  
68      @Override
69      public String getId() {
70          return id;
71      }
72  
73      public void setId(String id) {
74          this.id = id;
75      }
76  }