001/**
002 * Copyright 2005-2017 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.Column;
021import javax.persistence.Entity;
022import javax.persistence.FetchType;
023import javax.persistence.GeneratedValue;
024import javax.persistence.Id;
025import javax.persistence.JoinColumn;
026import javax.persistence.ManyToOne;
027import javax.persistence.Table;
028import java.io.Serializable;
029
030@Entity
031@Table(name = "KRMS_ACTN_ATTR_T")
032public class ActionAttributeBo extends BaseAttributeBo implements Serializable {
033
034    private static final long serialVersionUID = 1l;
035
036    @PortableSequenceGenerator(name = "KRMS_ACTN_ATTR_S")
037    @GeneratedValue(generator = "KRMS_ACTN_ATTR_S")
038    @Id
039    @Column(name = "ACTN_ATTR_DATA_ID")
040    private String id;
041
042    @ManyToOne()
043    @JoinColumn(name = "ACTN_ID")
044    private ActionBo action;
045
046    @ManyToOne()
047    @JoinColumn(name = "ATTR_DEFN_ID", referencedColumnName = "ATTR_DEFN_ID")
048    private KrmsAttributeDefinitionBo attributeDefinition;
049
050    @Override
051    public KrmsAttributeDefinitionBo getAttributeDefinition() {
052        return attributeDefinition;
053    }
054
055    public void setAttributeDefinition(KrmsAttributeDefinitionBo attributeDefinition) {
056        this.attributeDefinition = attributeDefinition;
057    }
058
059    public String getActionId() {
060        if (action != null) {
061            return action.getId();
062        }
063
064        return null;
065    }
066
067    public ActionBo getAction() {
068        return action;
069    }
070
071    public void setAction(ActionBo action) {
072        this.action = action;
073    }
074
075    @Override
076    public String getId() {
077        return id;
078    }
079
080    public void setId(String id) {
081        this.id = id;
082    }
083}