KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > mappeddata > persist > MappingFactory


1 /*
2  * Copyright (c) 2006 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: MappingFactory.java,v 1.10 2007/01/07 06:15:07 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.patterns.mappeddata.persist;
23
24 import org.opensubsystems.core.error.OSSException;
25 import org.opensubsystems.core.persist.ModifiableDataFactory;
26 import org.opensubsystems.core.util.ThreeIntStruct;
27
28 /**
29  * Methods to create and delete mapped data in the persistence store.
30  *
31  * @version $Id: MappingFactory.java,v 1.10 2007/01/07 06:15:07 bastafidli Exp $
32  * @author Julian Legeny
33  * @code.reviewer Miro Halas
34  * @code.reviewed 1.5 2006/06/30 23:43:42 jlegeny
35  */

36 public interface MappingFactory extends ModifiableDataFactory
37 {
38    /**
39     * Create mapping record.
40     *
41     * @param tisIDs - IDs and mapping type that has to be added into mapping table
42     * 1st value = mapped ID from one table
43     * 2nd value = mapped ID from second table
44     * 3rd value = mapping type
45     * @throws OSSException - error during create
46     */

47    void create(
48       ThreeIntStruct tisIDs
49    ) throws OSSException;
50
51    /**
52     * Delete mapping record.
53     *
54     * @param tisIDs - IDs and mapping type that has to be deleted from mapping table
55     * 1st value = mapped ID from one table
56     * 2nd value = mapped ID from second table
57     * 3rd value = mapping type
58     * @throws OSSException - error during delete
59     */

60    void delete(
61       ThreeIntStruct tisIDs
62    ) throws OSSException;
63
64    /**
65     * Get array of mapped records for particular ID.
66     *
67     * @param iId - Id of the first data object in relation for which we want to
68     * retrieve Ids of the second objects in relation. This is id1
69     * specified during creation.
70     * @param iMappingType - mapping type the retrieved data belongs to
71     * @return int[] - array of ids of mapped data objects, these are id2 specified
72     * during creation.
73     * @throws OSSException - error during getting mapped data
74     */

75    int[] getMappedData(
76       int iId,
77       int iMappingType
78    ) throws OSSException;
79
80    /**
81     * Get array of mapped records for particular set of IDs.
82     *
83     * @param strColumnIDs - string representation of IDs separated by ','
84     * of the first data objects in relations for which we
85     * want to retrieve Ids of the second objects in
86     * relations. These are id1 specified during creation.
87     * @param iMappingType - mapping type the retrieved data belongs to
88     * @return int[] - array of ids of mapped data objects, these are id2 specified
89     * during creation.
90     * @throws OSSException - error during getting mapped data
91     */

92    int[] getMappedData(
93       String JavaDoc strColumnIDs,
94       int iMappingType
95    ) throws OSSException;
96 }
97
Popular Tags