| 1 | |
package org.kuali.student.r2.common.entity; |
| 2 | |
|
| 3 | |
import javax.persistence.Column; |
| 4 | |
import javax.persistence.MappedSuperclass; |
| 5 | |
|
| 6 | |
import org.kuali.student.common.dto.AttributeInfo; |
| 7 | |
import org.kuali.student.common.infc.Attribute; |
| 8 | |
import org.kuali.student.core.entity.BaseEntity; |
| 9 | |
import org.kuali.student.core.entity.KSEntityConstants; |
| 10 | |
|
| 11 | |
@MappedSuperclass |
| 12 | |
public class BaseAttributeEntity extends BaseEntity { |
| 13 | |
|
| 14 | |
@Column(name = "\"KEY\"") |
| 15 | |
private String key; |
| 16 | |
|
| 17 | |
@Column(name = "VALUE",length=KSEntityConstants.LONG_TEXT_LENGTH) |
| 18 | |
private String value; |
| 19 | |
|
| 20 | 0 | public BaseAttributeEntity() { |
| 21 | 0 | } |
| 22 | |
|
| 23 | 0 | public BaseAttributeEntity(String key, String value) { |
| 24 | 0 | this.key = key; |
| 25 | 0 | this.value = value; |
| 26 | 0 | } |
| 27 | |
|
| 28 | 0 | public BaseAttributeEntity(Attribute att) { |
| 29 | 0 | this.setId(att.getId()); |
| 30 | 0 | this.key = att.getKey(); |
| 31 | 0 | this.value = att.getValue(); |
| 32 | 0 | } |
| 33 | |
|
| 34 | |
public String getKey() { |
| 35 | 0 | return key; |
| 36 | |
} |
| 37 | |
|
| 38 | |
public void setKey(String key) { |
| 39 | 0 | this.key = key; |
| 40 | 0 | } |
| 41 | |
|
| 42 | |
public String getValue() { |
| 43 | 0 | return value; |
| 44 | |
} |
| 45 | |
|
| 46 | |
public void setValue(String value) { |
| 47 | 0 | this.value = value; |
| 48 | 0 | } |
| 49 | |
|
| 50 | |
public AttributeInfo toDto() { |
| 51 | 0 | AttributeInfo.Builder builder = new AttributeInfo.Builder(); |
| 52 | 0 | builder.setId(this.getId()); |
| 53 | 0 | builder.setKey(this.getKey()); |
| 54 | 0 | builder.setValue(this.getValue()); |
| 55 | 0 | return builder.build(); |
| 56 | |
} |
| 57 | |
|
| 58 | |
} |