01: /*
02: * Copyright 2004 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: ComplexMapping.java,v 1.2 2004/02/01 18:22:42 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: import com.triactive.jdo.StateManager;
14:
15: /**
16: * A database mapping that incorporates custom logic for object storage and
17: * retrieval.
18: *
19: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
20: * @version $Revision: 1.2 $
21: */
22:
23: public abstract class ComplexMapping extends Mapping {
24: /**
25: * Create a new complex mapping with the given DatabaseAdapter for the given
26: * type.
27: *
28: * @param dba The DatabaseAdapter that this Mapping should use.
29: * @param type The Class that this mapping maps to the database.
30: */
31:
32: protected ComplexMapping(DatabaseAdapter dba, Class type) {
33: super (dba, type);
34: }
35:
36: /**
37: * Inserts an object in the database.
38: *
39: * @param sm
40: * The state manager of the instance owning the Java object being
41: * inserted.
42: * @param value
43: * The object to insert.
44: */
45:
46: public abstract void insertObject(StateManager sm, Object value);
47:
48: /**
49: * Fetchs an object from the database.
50: *
51: * @param sm
52: * The state manager of the instance owning the Java object being
53: * fetched.
54: */
55:
56: public abstract Object fetchObject(StateManager sm);
57:
58: /**
59: * Updates an object in the database.
60: *
61: * @param sm
62: * The state manager of the instance owning the Java object being
63: * updated.
64: * @param value
65: * The object to update.
66: */
67:
68: public abstract void updateObject(StateManager sm, Object value);
69:
70: /**
71: * Deletes an object from the database.
72: *
73: * @param sm
74: * The state manager of the instance owning the Java object being
75: * deleted.
76: */
77:
78: public abstract void deleteObject(StateManager sm);
79: }
|