2 * Copyright (C) 2001, 2002 The Mir-coders group
\r
4 * This file is part of Mir.
\r
6 * Mir is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 2 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Mir is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with Mir; if not, write to the Free Software
\r
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 * In addition, as a special exception, The Mir-coders gives permission to link
\r
21 * the code of this program with the com.oreilly.servlet library, any library
\r
22 * licensed under the Apache Software License, The Sun (tm) Java Advanced
\r
23 * Imaging library (JAI), The Sun JIMI library (or with modified versions of
\r
24 * the above that use the same license as the above), and distribute linked
\r
25 * combinations including the two. You must obey the GNU General Public
\r
26 * License in all respects for all of the code used other than the above
\r
27 * mentioned libraries. If you modify this file, you may extend this exception
\r
28 * to your version of the file, but you are not obligated to do so. If you do
\r
29 * not wish to do so, delete this exception statement from your version.
\r
32 * Implementiert Interface für die Speicherschicht.
\r
33 * Bislang gibt es in der Bibliothek nur die Möglichkeit
\r
34 * in einer Datenbank zu speichern.
\r
37 package mir.storage;
\r
42 import freemarker.template.*;
\r
43 import mir.entity.*;
\r
47 * Implementiert Interface für die Speicherschicht.
\r
48 * Bislang gibt es in der Bibliothek nur die Möglichkeit
\r
49 * in einer Datenbank zu speichern.
\r
51 * @version 29.6.1999
\r
53 public interface StorageObject {
\r
56 * Dokumentation siehe Database.java
\r
59 * @exception StorageObjectException
\r
61 abstract public Entity selectById(String id) throws StorageObjectException;
\r
64 * Dokumentation siehe Database.java
\r
67 * @return EntityList
\r
68 * @exception StorageObjectException
\r
70 abstract public EntityList selectByFieldValue(String aField, String aValue) throws
\r
71 StorageObjectException;
\r
74 * Dokumentation siehe Database.java
\r
75 * @param whereClause
\r
76 * @return EntityList
\r
77 * @exception StorageObjectException
\r
79 abstract public EntityList selectByWhereClause(String whereClause) throws
\r
80 StorageObjectException;
\r
83 * Dokumentation siehe Database.java
\r
84 * @param whereClause
\r
86 * @return EntityList
\r
87 * @exception StorageObjectException
\r
89 abstract public EntityList selectByWhereClause(String whereClause, int offset) throws
\r
90 StorageObjectException;
\r
93 * Dokumentation siehe Database.java
\r
94 * @param whereClause
\r
97 * @return EntityList
\r
98 * @exception StorageObjectException
\r
100 abstract public EntityList selectByWhereClause(String whereClause,
\r
103 StorageObjectException;
\r
106 * Dokumentation siehe Database.java
\r
107 * @param whereClause
\r
111 * @return EntityList
\r
112 * @exception StorageObjectException
\r
114 abstract public EntityList selectByWhereClause(String whereClause,
\r
116 int offset, int limit) throws
\r
117 StorageObjectException;
\r
120 * Dokumentation siehe Database.java
\r
123 * @exception StorageObjectException
\r
125 abstract public boolean delete(String id) throws StorageObjectException;
\r
128 * Dokumentation siehe Database.java
\r
129 * @return ArrayList
\r
130 * @exception StorageObjectException
\r
132 abstract public ArrayList getFields() throws StorageObjectException;
\r
135 * Dokumentation siehe Database.java
\r
137 * @exception StorageObjectException
\r
139 abstract public int[] getTypes() throws StorageObjectException;
\r
142 * Dokumentation siehe Database.java
\r
143 * @return ArrayList
\r
144 * @exception StorageObjectException
\r
146 abstract public ArrayList getLabels() throws StorageObjectException;
\r
149 * Dokumentation siehe Database.java
\r
151 * @exception StorageObjectException
\r
153 abstract public void update(Entity a) throws StorageObjectException;
\r
156 * Dokumentation siehe Database.java
\r
158 * @return String id
\r
159 * @exception StorageObjectException
\r
161 abstract public String insert(Entity a) throws StorageObjectException;
\r
164 * Dokumentation siehe Database.java
\r
165 * @return Class Klasse der Entity
\r
167 abstract public Class getEntityClass();
\r
170 * put your documentation comment here
\r
173 abstract public String getIdName();
\r
176 * Dokumentation siehe Database.java
\r
179 abstract public String getTableName();
\r
182 * Dokumentation siehe Database.java
\r
183 * @return SimpleHash
\r
185 abstract public SimpleHash getHashData();
\r
188 * Dokumentation siehe Database.java
\r
189 * @return Connection
\r
190 * @exception StorageObjectException
\r
192 abstract public Connection getPooledCon() throws StorageObjectException;
\r
195 * Dokumentation siehe Database.java
\r
198 * @return ResultSet
\r
199 * @exception StorageObjectException, SQLException
\r
201 abstract public ResultSet executeSql(Statement a, String sql) throws
\r
202 StorageObjectException,
\r
206 * Dokumentation siehe Database.java
\r
210 abstract public void freeConnection(Connection con, Statement stmt) throws
\r
211 StorageObjectException;
\r
214 * Dokumentation siehe Database.java
\r
217 abstract public SimpleList getPopupData() throws StorageObjectException;
\r
219 abstract public int executeUpdate(Statement a, String sql) throws
\r
220 StorageObjectException, SQLException;
\r
222 abstract public int executeUpdate(String sql) throws StorageObjectException,
\r
225 abstract public int getSize(String where) throws SQLException,
\r
226 StorageObjectException;
\r