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