1 19 package org.apache.cayenne.intercept; 20 21 import java.util.Collection ; 22 import java.util.List ; 23 24 import org.apache.cayenne.DataChannel; 25 import org.apache.cayenne.DeleteDenyException; 26 import org.apache.cayenne.ObjectContext; 27 import org.apache.cayenne.ObjectId; 28 import org.apache.cayenne.Persistent; 29 import org.apache.cayenne.QueryResponse; 30 import org.apache.cayenne.graph.GraphManager; 31 import org.apache.cayenne.map.EntityResolver; 32 import org.apache.cayenne.query.Query; 33 34 41 public class ObjectContextDecorator implements ObjectContext { 42 43 protected ObjectContext context; 44 45 public void commitChanges() { 46 context.commitChanges(); 47 } 48 49 public void commitChangesToParent() { 50 context.commitChangesToParent(); 51 } 52 53 public Collection deletedObjects() { 54 return context.deletedObjects(); 55 } 56 57 public void deleteObject(Object object) throws DeleteDenyException { 58 context.deleteObject(object); 59 } 60 61 public DataChannel getChannel() { 62 return context.getChannel(); 63 } 64 65 public EntityResolver getEntityResolver() { 66 return context.getEntityResolver(); 67 } 68 69 public GraphManager getGraphManager() { 70 return context.getGraphManager(); 71 } 72 73 public Persistent localObject(ObjectId id, Object prototype) { 74 return context.localObject(id, prototype); 75 } 76 77 public Collection modifiedObjects() { 78 return context.modifiedObjects(); 79 } 80 81 public Persistent newObject(Class persistentClass) { 82 return context.newObject(persistentClass); 83 } 84 85 public void registerNewObject(Object object) { 86 context.registerNewObject(object); 87 } 88 89 public Collection newObjects() { 90 return context.newObjects(); 91 } 92 93 public QueryResponse performGenericQuery(Query query) { 94 return context.performGenericQuery(query); 95 } 96 97 public List performQuery(Query query) { 98 return context.performQuery(query); 99 } 100 101 104 public void prepareForAccess(Persistent object, String property) { 105 context.prepareForAccess(object, property); 106 } 107 108 public void prepareForAccess(Persistent object, String property, boolean lazyFaulting) { 109 context.prepareForAccess(object, property, lazyFaulting); 110 } 111 112 public void propertyChanged( 113 Persistent object, 114 String property, 115 Object oldValue, 116 Object newValue) { 117 context.propertyChanged(object, property, oldValue, newValue); 118 } 119 120 public void rollbackChanges() { 121 context.rollbackChanges(); 122 } 123 124 public void rollbackChangesLocally() { 125 context.rollbackChangesLocally(); 126 } 127 128 public Collection uncommittedObjects() { 129 return context.uncommittedObjects(); 130 } 131 132 public ObjectContext getContext() { 133 return context; 134 } 135 136 public void setContext(ObjectContext context) { 137 this.context = context; 138 } 139 } 140 | Popular Tags |