KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > persist > db > DatabaseFactory


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: DatabaseFactory.java,v 1.4 2007/01/07 06:14:18 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.core.persist.db;
23
24 import java.sql.ResultSet JavaDoc;
25
26 import org.opensubsystems.core.data.DataObject;
27 import org.opensubsystems.core.error.OSSDatabaseAccessException;
28
29 /**
30  * This interface should be implemented by all data object factories, which
31  * support basic operations with data objects persisted in the database.
32  *
33  * @version $Id: DatabaseFactory.java,v 1.4 2007/01/07 06:14:18 bastafidli Exp $
34  * @author Miro Halas
35  * @code.reviewer Miro Halas
36  * @code.reviewed Initial revision
37  */

38 public interface DatabaseFactory
39 {
40    /**
41     * Load full DataObject from the result set. It is used when all attributes
42     * of the data objects should be loaded as efficiently as possible.
43     *
44     * Every data has to be loaded otherwise we couldn't test the existence data
45     * therefore this method is commong to all the database factories
46     *
47     * @param rsQueryResults - ResultSet retrieved from the database
48     * @param initialIndex - initial column index in the result set to retrieve,
49     * by default this is 1. This allows to include columns
50     * for this database factory mixed with columns for
51     * other database factories and the load them efficiently.
52     * @return DataObject - with specific columns set
53     * @throws OSSDatabaseAccessException - error during ResultSet parsing
54     */

55    DataObject load(
56       ResultSet JavaDoc rsQueryResults,
57       int initialIndex
58    ) throws OSSDatabaseAccessException;
59 }
60
Popular Tags