1 | |
package org.kuali.student.core.bo; |
2 | |
|
3 | |
import java.util.LinkedHashMap; |
4 | |
|
5 | |
import javax.persistence.Column; |
6 | |
import javax.persistence.Id; |
7 | |
import javax.persistence.MappedSuperclass; |
8 | |
|
9 | |
import org.apache.ojb.broker.PersistenceBroker; |
10 | |
import org.apache.ojb.broker.PersistenceBrokerException; |
11 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; |
12 | |
import org.kuali.student.common.util.UUIDHelper; |
13 | |
|
14 | |
@MappedSuperclass |
15 | 0 | public abstract class KsBusinessObjectBase extends PersistableBusinessObjectBase implements KsBusinessObject { |
16 | |
|
17 | |
private static final long serialVersionUID = 1L; |
18 | |
|
19 | |
@Id |
20 | |
@Column(name = "ID") |
21 | |
private String id; |
22 | |
|
23 | |
|
24 | |
@Override |
25 | |
public void beforeInsert(PersistenceBroker persistenceBroker) throws PersistenceBrokerException { |
26 | 0 | this.id = UUIDHelper.genStringUUID(this.id); |
27 | 0 | super.beforeInsert(persistenceBroker); |
28 | 0 | } |
29 | |
|
30 | |
@Override |
31 | |
protected LinkedHashMap<String, Object> toStringMapper() { |
32 | 0 | LinkedHashMap<String, Object> toStringMap = new LinkedHashMap<String, Object>(); |
33 | |
|
34 | 0 | toStringMap.put("id", id); |
35 | |
|
36 | 0 | return toStringMap; |
37 | |
} |
38 | |
|
39 | |
public String getId() { |
40 | 0 | return id; |
41 | |
} |
42 | |
|
43 | |
public void setId(String id) { |
44 | 0 | this.id = id; |
45 | 0 | } |
46 | |
|
47 | |
} |