1 56 package org.objectstyle.cayenne.client; 57 58 import org.objectstyle.cayenne.Persistent; 59 import org.objectstyle.cayenne.graph.BeanMergeHandler; 60 import org.objectstyle.cayenne.graph.GraphMap; 61 62 68 class ClientObjectContextMergeHandler extends BeanMergeHandler { 69 70 ClientStateRecorder stateRecorder; 71 72 ClientObjectContextMergeHandler(ClientStateRecorder stateRecorder, GraphMap graphMap) { 73 super(graphMap); 74 75 this.stateRecorder = stateRecorder; 76 } 77 78 public void nodeIdChanged(Object nodeId, Object newId) { 79 Object node = graphMap.unregisterNode(nodeId); 80 81 if (node != null) { 82 graphMap.registerNode(newId, node); 83 84 if (node instanceof Persistent) { 85 ((Persistent) node).setOid(newId); 87 } 88 89 stateRecorder.nodeIdChanged(nodeId, newId); 91 } 92 } 93 } 94 | Popular Tags |