View Javadoc

1   /**
2    * Copyright 2005-2015 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.ksb.messaging.bam;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.hibernate.annotations.GenericGenerator;
20  import org.hibernate.annotations.Parameter;
21  
22  import javax.persistence.CascadeType;
23  import javax.persistence.Column;
24  import javax.persistence.Entity;
25  import javax.persistence.FetchType;
26  import javax.persistence.GeneratedValue;
27  import javax.persistence.Id;
28  import javax.persistence.JoinColumn;
29  import javax.persistence.Lob;
30  import javax.persistence.ManyToOne;
31  import javax.persistence.Table;
32  
33  /**
34   * A parameter of a method invocation recorded by the BAM.
35   *
36   * @author Kuali Rice Team (rice.collab@kuali.org)
37   */
38  @Entity
39  @Table(name="KRSB_BAM_PARM_T")
40  //@Sequence(name="KRSB_BAM_PARM_S", property="bamParamId")
41  public class BAMParam {
42  
43  	@Id
44  	@GeneratedValue(generator="KRSB_BAM_PARM_S")
45  	@GenericGenerator(name="KRSB_BAM_PARM_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
46  			@Parameter(name="sequence_name",value="KRSB_BAM_PARM_S"),
47  			@Parameter(name="value_column",value="id")
48  	})
49  	@Column(name="BAM_PARM_ID")
50  	private Long bamParamId;
51  	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST})
52  	@JoinColumn(name="BAM_ID")
53  	private BAMTargetEntry bamTargetEntry;
54  	@Lob
55  	@Column(name="PARM")
56  	private String param;
57  		
58  	public BAMTargetEntry getBamTargetEntry() {
59  		return this.bamTargetEntry;
60  	}
61  	public void setBamTargetEntry(BAMTargetEntry bamTargetEntry) {
62  		this.bamTargetEntry = bamTargetEntry;
63  	}
64  	public Long getBamParamId() {
65  		return this.bamParamId;
66  	}
67  	public void setBamParamId(Long bamParamId) {
68  		this.bamParamId = bamParamId;
69  	}
70  	public String getParam() {
71  		return this.param;
72  	}
73  	public void setParam(String paramToString) {
74  		if (StringUtils.isEmpty(paramToString)) {
75  			paramToString = "<null>";//oracle blows null constraint on empty strings
76  		}
77  		this.param = paramToString;
78  	}
79  }