KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > patterns > listdata > persist > db > ListDatabaseFactory


1 /*
2  * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: ListDatabaseFactory.java,v 1.3 2007/01/07 06:14:23 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.listdata.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 browsing through list of data object page by pages retrieve from the
32  * database.
33  *
34  * @version $Id: ListDatabaseFactory.java,v 1.3 2007/01/07 06:14:23 bastafidli Exp $
35  * @author Julo Legeny
36  * @code.reviewer Miro Halas
37  * @code.reviewed Initial revision
38  */

39 public interface ListDatabaseFactory
40 {
41    /**
42     * Load partial DataObject from the result set. It is used when only limited
43     * information from DB is requested. That means that only some attributes in
44     * the data object will be initialized and loaded.
45     *
46     * @param rsResults - ResultSet retrieved from the database
47     * @param columnCodes - list of columns selected in ResultSet
48     * @param initialIndex - initial column index in the result set to retrieve,
49     * by default this is 1
50     * @return DataObject - with specific columns set
51     * @throws OSSDatabaseAccessException - error during ResultSet parsing
52     */

53    DataObject load(
54       ResultSet JavaDoc rsResults,
55       int[] columnCodes,
56       int initialIndex
57    ) throws OSSDatabaseAccessException;
58 }
59
Popular Tags