KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > ComplexMapping


1 /*
2  * Copyright 2004 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: ComplexMapping.java,v 1.2 2004/02/01 18:22:42 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13 import com.triactive.jdo.StateManager;
14
15
16 /**
17  * A database mapping that incorporates custom logic for object storage and
18  * retrieval.
19  *
20  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
21  * @version $Revision: 1.2 $
22  */

23
24 public abstract class ComplexMapping extends Mapping
25 {
26     /**
27      * Create a new complex mapping with the given DatabaseAdapter for the given
28      * type.
29      *
30      * @param dba The DatabaseAdapter that this Mapping should use.
31      * @param type The Class that this mapping maps to the database.
32      */

33
34     protected ComplexMapping(DatabaseAdapter dba, Class JavaDoc type)
35     {
36         super(dba, type);
37     }
38
39
40     /**
41      * Inserts an object in the database.
42      *
43      * @param sm
44      * The state manager of the instance owning the Java object being
45      * inserted.
46      * @param value
47      * The object to insert.
48      */

49
50     public abstract void insertObject(StateManager sm, Object JavaDoc value);
51
52
53     /**
54      * Fetchs an object from the database.
55      *
56      * @param sm
57      * The state manager of the instance owning the Java object being
58      * fetched.
59      */

60
61     public abstract Object JavaDoc fetchObject(StateManager sm);
62
63
64     /**
65      * Updates an object in the database.
66      *
67      * @param sm
68      * The state manager of the instance owning the Java object being
69      * updated.
70      * @param value
71      * The object to update.
72      */

73
74     public abstract void updateObject(StateManager sm, Object JavaDoc value);
75
76
77     /**
78      * Deletes an object from the database.
79      *
80      * @param sm
81      * The state manager of the instance owning the Java object being
82      * deleted.
83      */

84
85     public abstract void deleteObject(StateManager sm);
86 }
87
Popular Tags