1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.bo;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import javax.persistence.Transient;
22
23 import org.kuali.rice.krad.service.KRADServiceLocator;
24 import org.kuali.rice.krad.service.LegacyDataAppAdapter;
25
26
27
28
29
30
31
32
33
34 public class PersistableBusinessObjectBaseAdapter extends DataObjectBase {
35 private static final long serialVersionUID = 1L;
36 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PersistableBusinessObjectBaseAdapter.class);
37
38 @Transient protected boolean newCollectionRecord;
39 @Transient protected Object extension;
40
41
42
43
44
45
46 public void refresh() {
47
48 }
49
50 public void refreshNonUpdateableReferences() {
51 getLegacyDataAdapter().refreshAllNonUpdatingReferences(this);
52 }
53
54 public void refreshReferenceObject(String referenceObjectName) {
55 getLegacyDataAdapter().refreshReferenceObject(this, referenceObjectName);
56 }
57
58
59
60
61
62
63
64 @Deprecated
65 protected LegacyDataAppAdapter getLegacyDataAdapter() {
66 return KRADServiceLocator.getLegacyDataAdapter();
67 }
68
69 public List buildListOfDeletionAwareLists() {
70 return new ArrayList();
71 }
72
73 public void linkEditableUserFields() {
74
75 }
76
77 public Object getExtension() {
78 if ( extension == null
79 && getLegacyDataAdapter().isPersistable(this.getClass())) {
80 try {
81 extension = getLegacyDataAdapter().getExtension(this.getClass());
82 } catch ( Exception ex ) {
83 LOG.error( "unable to create extension object", ex );
84 }
85 }
86 return extension;
87 }
88
89 public void setExtension(Object extension) {
90 this.extension = extension;
91 }
92
93 public boolean isNewCollectionRecord() {
94 return newCollectionRecord;
95 }
96
97 public void setNewCollectionRecord(boolean isNewCollectionRecord) {
98 this.newCollectionRecord = isNewCollectionRecord;
99 }
100 }