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.ksb.messaging.bam;
017
018import org.apache.commons.lang.StringUtils;
019import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
020
021import javax.persistence.CascadeType;
022import javax.persistence.Column;
023import javax.persistence.Entity;
024import javax.persistence.FetchType;
025import javax.persistence.GeneratedValue;
026import javax.persistence.Id;
027import javax.persistence.JoinColumn;
028import javax.persistence.Lob;
029import javax.persistence.ManyToOne;
030import javax.persistence.Table;
031
032/**
033 * A parameter of a method invocation recorded by the BAM.
034 *
035 * @author Kuali Rice Team (rice.collab@kuali.org)
036 */
037@Entity
038@Table(name = "KRSB_BAM_PARM_T")
039public class BAMParam {
040
041        @Id
042        @GeneratedValue(generator = "KRSB_BAM_PARM_S")
043    @PortableSequenceGenerator(name = "KRSB_BAM_PARM_S")
044    @Column(name = "BAM_PARM_ID")
045        private Long bamParamId;
046
047        @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
048        @JoinColumn(name = "BAM_ID")
049        private BAMTargetEntry bamTargetEntry;
050
051        @Lob
052        @Column(name = "PARM")
053        private String param;
054                
055        public BAMTargetEntry getBamTargetEntry() {
056                return this.bamTargetEntry;
057        }
058        public void setBamTargetEntry(BAMTargetEntry bamTargetEntry) {
059                this.bamTargetEntry = bamTargetEntry;
060        }
061        public Long getBamParamId() {
062                return this.bamParamId;
063        }
064        public void setBamParamId(Long bamParamId) {
065                this.bamParamId = bamParamId;
066        }
067        public String getParam() {
068                return this.param;
069        }
070        public void setParam(String paramToString) {
071                if (StringUtils.isEmpty(paramToString)) {
072                        paramToString = "<null>";//oracle blows null constraint on empty strings
073                }
074                this.param = paramToString;
075        }
076}