1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.ksb.messaging.bam;
18
19 import javax.persistence.CascadeType;
20 import javax.persistence.Column;
21 import javax.persistence.Entity;
22 import javax.persistence.FetchType;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.Id;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.Lob;
27 import javax.persistence.ManyToOne;
28 import javax.persistence.Table;
29
30 import org.apache.commons.lang.StringUtils;
31 import org.hibernate.annotations.GenericGenerator;
32 import org.hibernate.annotations.Parameter;
33 import org.kuali.rice.core.framework.persistence.jpa.OrmUtils;
34 import org.kuali.rice.ksb.service.KSBServiceLocator;
35
36
37
38
39
40
41 @Entity
42 @Table(name="KRSB_BAM_PARM_T")
43
44 public class BAMParam {
45
46 @Id
47 @GeneratedValue(generator="KRSB_BAM_PARM_S")
48 @GenericGenerator(name="KRSB_BAM_PARM_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
49 @Parameter(name="sequence_name",value="KRSB_BAM_PARM_S"),
50 @Parameter(name="value_column",value="id")
51 })
52 @Column(name="BAM_PARM_ID")
53 private Long bamParamId;
54 @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST})
55 @JoinColumn(name="BAM_ID")
56 private BAMTargetEntry bamTargetEntry;
57 @Lob
58 @Column(name="PARM")
59 private String param;
60
61
62 public void beforeInsert(){
63 OrmUtils.populateAutoIncValue(this, KSBServiceLocator.getRegistryEntityManagerFactory().createEntityManager());
64 }
65
66 public BAMTargetEntry getBamTargetEntry() {
67 return this.bamTargetEntry;
68 }
69 public void setBamTargetEntry(BAMTargetEntry bamTargetEntry) {
70 this.bamTargetEntry = bamTargetEntry;
71 }
72 public Long getBamParamId() {
73 return this.bamParamId;
74 }
75 public void setBamParamId(Long bamParamId) {
76 this.bamParamId = bamParamId;
77 }
78 public String getParam() {
79 return this.param;
80 }
81 public void setParam(String paramToString) {
82 if (StringUtils.isEmpty(paramToString)) {
83 paramToString = "<null>";
84 }
85 this.param = paramToString;
86 }
87 }