KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > metainfo > api > Mapping


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.metainfo.api;
25
26 import java.util.Collection JavaDoc;
27
28 /**
29  * A Mapping object contains mapping structures obtained by applying a set of
30  * mapping rules whose syntax and semantics depend of a particular mapper.
31  *
32  * Mapping rules define the way class instances will be stored on a particular
33  * type of persistent store and how they will be read and write from/to the
34  * persistent store.
35  *
36  */

37 public interface Mapping extends MetaObject {
38     /**
39      * Returns the name of the mapper.
40      * @return the mapper name.
41      */

42     String JavaDoc getMapperName();
43
44     /**
45      * Sets the mapper name.
46      * @param mapperName the mapper name.
47      */

48     void setMapperName(String JavaDoc mapperName);
49
50     /**
51      * Returns the mapping structure of the class.
52      * @return a ClassMapping object.
53      */

54     ClassMapping getClassMapping();
55
56     /**
57      * Sets the mapping structure of the class.
58      * @param classMapping a ClassMapping object.
59      */

60     void setClassMapping(ClassMapping classMapping);
61
62     /**
63      * Returns the GenClassMapping object of a GenClass.
64      * @param genclassid a GenClass identifier.
65      * @return a GenClassMapping object.
66      */

67     GenClassMapping getGenClassMapping(String JavaDoc genclassid);
68
69     /**
70      * Returns a collection of GenClassMapping objects.
71      * @return a collection.
72      */

73     Collection JavaDoc getGenClassMappings();
74
75     /**
76      * Adds a GenClassMapping object.
77      * @param genClassId a GenClass identifier,
78      * genClassMapping a GenClassMapping object.
79      */

80     void addGenClassMapping(String JavaDoc genClassId,
81                             GenClassMapping genClassMapping);
82     /**
83      * Create a class mapping
84      * @param ruleName
85      * @return
86      */

87     ClassMapping createClassMapping(String JavaDoc ruleName);
88
89 }
90
Popular Tags