1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
package org.kuali.student.enrollment.class1.lpr.model; |
13 | |
|
14 | |
import javax.persistence.Entity; |
15 | |
import javax.persistence.JoinColumn; |
16 | |
import javax.persistence.ManyToOne; |
17 | |
import javax.persistence.Table; |
18 | |
|
19 | |
import org.kuali.student.r2.common.entity.BaseAttributeEntity; |
20 | |
import org.kuali.student.r2.common.entity.BaseAttributeEntityNew; |
21 | |
import org.kuali.student.r2.common.infc.Attribute; |
22 | |
|
23 | 0 | @Entity |
24 | |
@Table(name = "KSEN_LPR_ATTR") |
25 | |
public class LprAttributeEntity extends BaseAttributeEntityNew<LprEntity> { |
26 | |
|
27 | |
@ManyToOne |
28 | |
@JoinColumn(name = "OWNER_ID") |
29 | |
private LprEntity owner; |
30 | |
|
31 | 0 | public LprAttributeEntity() {} |
32 | |
|
33 | |
public LprAttributeEntity(String key, String value) { |
34 | 0 | super(key, value); |
35 | 0 | } |
36 | |
|
37 | |
public LprAttributeEntity(Attribute att) { |
38 | 0 | super(att); |
39 | 0 | } |
40 | |
|
41 | |
@Override |
42 | |
public void setOwner(LprEntity owner) { |
43 | 0 | this.owner = owner; |
44 | 0 | } |
45 | |
|
46 | |
@Override |
47 | |
public LprEntity getOwner() { |
48 | 0 | return owner; |
49 | |
} |
50 | |
|
51 | |
public void fromDto (Attribute att) { |
52 | |
|
53 | 0 | setKey(att.getKey()); |
54 | 0 | setValue(att.getValue()); |
55 | 0 | } |
56 | |
|
57 | |
@Override |
58 | |
public String toString() { |
59 | 0 | StringBuilder builder = new StringBuilder(); |
60 | 0 | builder.append("LprAttributeEntity [owner="); |
61 | 0 | builder.append(owner); |
62 | 0 | builder.append(", id="); |
63 | 0 | builder.append(getId()); |
64 | 0 | builder.append(", key="); |
65 | 0 | builder.append(getKey()); |
66 | 0 | builder.append(", value="); |
67 | 0 | builder.append(getValue()); |
68 | 0 | builder.append("]"); |
69 | 0 | return builder.toString(); |
70 | |
} |
71 | |
|
72 | |
|
73 | |
} |