01: /**********************************************************************
02: Copyright (c) 2002 Mike Martin (TJDO) and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15: Contributors:
16: 2003 Andy Jefferson - coding standards
17: 2007 Andy Jefferson - moved to be RelationMappingCallbacks
18: ...
19: **********************************************************************/package org.jpox.store.mapping;
20:
21: import org.jpox.StateManager;
22:
23: /**
24: * Interface defining a series of callbacks that are called when this mapping goes through
25: * certain lifecycle events. This interface would be implemented by any type of mapping that handles
26: * a relation and so may need to perform action just before or just after a lifecycle event.
27: *
28: * @version $Revision: 1.5 $
29: **/
30: public interface MappingCallbacks {
31: /**
32: * Method called after the insert of the object so that additional operations can be performed if necessary.
33: * @param sm StateManager of the owner
34: */
35: void postInsert(StateManager sm);
36:
37: /**
38: * Method called after the retrieval of the object, so that additional operations can be performed if necessary.
39: * @param sm StateManager of the owner
40: */
41: void postFetch(StateManager sm);
42:
43: /**
44: * Method called after the update of the object, so that additional operations can be performed if necessary.
45: * @param sm StateManager of the owner
46: */
47: void postUpdate(StateManager sm);
48:
49: /**
50: * Method called before the delete of objects, so that additional operations can be performed if necessary.
51: * @param sm StateManager of the owner
52: */
53: void preDelete(StateManager sm);
54: }
|