001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krms.impl.repository; 017 018import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator; 019 020import javax.persistence.CascadeType; 021import javax.persistence.Column; 022import javax.persistence.Entity; 023import javax.persistence.FetchType; 024import javax.persistence.GeneratedValue; 025import javax.persistence.Id; 026import javax.persistence.JoinColumn; 027import javax.persistence.ManyToOne; 028import javax.persistence.Table; 029import java.io.Serializable; 030 031@Entity 032@Table(name = "KRMS_RULE_ATTR_T") 033public class RuleAttributeBo extends BaseAttributeBo implements Serializable { 034 035 private static final long serialVersionUID = 1l; 036 037 @PortableSequenceGenerator(name = "KRMS_RULE_ATTR_S") 038 @GeneratedValue(generator = "KRMS_RULE_ATTR_S") 039 @Id 040 @Column(name = "RULE_ATTR_ID") 041 private String id; 042 043 @ManyToOne() 044 @JoinColumn(name = "RULE_ID") 045 private RuleBo rule; 046 047 @ManyToOne(cascade = CascadeType.REFRESH) 048 @JoinColumn(name = "ATTR_DEFN_ID", referencedColumnName = "ATTR_DEFN_ID") 049 private KrmsAttributeDefinitionBo attributeDefinition; 050 051 @Override 052 public KrmsAttributeDefinitionBo getAttributeDefinition() { 053 return attributeDefinition; 054 } 055 056 public void setAttributeDefinition(KrmsAttributeDefinitionBo attributeDefinition) { 057 this.attributeDefinition = attributeDefinition; 058 } 059 060 public RuleBo getRule() { 061 return rule; 062 } 063 064 public void setRule(RuleBo rule) { 065 this.rule = rule; 066 } 067 068 @Override 069 public String getId() { 070 return id; 071 } 072 073 public void setId(String id) { 074 this.id = id; 075 } 076}