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
39 import java.sql.Connection;
\r
40 import java.sql.ResultSet;
\r
41 import java.sql.SQLException;
\r
42 import java.sql.Statement;
\r
43 import java.util.ArrayList;
\r
45 import mir.entity.Entity;
\r
46 import mir.entity.EntityList;
\r
47 import freemarker.template.SimpleHash;
\r
48 import freemarker.template.SimpleList;
\r
52 * Implementiert Interface f?r die Speicherschicht.
\r
53 * Bislang gibt es in der Bibliothek nur die M?glichkeit
\r
54 * in einer Datenbank zu speichern.
\r
56 * @version 29.6.1999
\r
58 public interface StorageObject {
\r
61 * Dokumentation siehe Database.java
\r
64 * @exception StorageObjectException
\r
66 abstract public Entity selectById(String id) throws StorageObjectExc;
\r
69 * Dokumentation siehe Database.java
\r
72 * @return EntityList
\r
73 * @exception StorageObjectException
\r
75 abstract public EntityList selectByFieldValue(String aField, String aValue) throws
\r
76 StorageObjectFailure;
\r
79 * Dokumentation siehe Database.java
\r
80 * @param whereClause
\r
81 * @return EntityList
\r
82 * @exception StorageObjectException
\r
84 abstract public EntityList selectByWhereClause(String whereClause) throws
\r
85 StorageObjectFailure;
\r
88 * Dokumentation siehe Database.java
\r
89 * @param whereClause
\r
91 * @return EntityList
\r
92 * @exception StorageObjectException
\r
94 abstract public EntityList selectByWhereClause(String whereClause, int offset) throws
\r
95 StorageObjectFailure;
\r
98 * Dokumentation siehe Database.java
\r
99 * @param whereClause
\r
102 * @return EntityList
\r
103 * @exception StorageObjectException
\r
105 abstract public EntityList selectByWhereClause(String whereClause,
\r
108 StorageObjectFailure;
\r
111 * Dokumentation siehe Database.java
\r
112 * @param whereClause
\r
116 * @return EntityList
\r
117 * @exception StorageObjectException
\r
119 abstract public EntityList selectByWhereClause(String whereClause,
\r
121 int offset, int limit) throws
\r
122 StorageObjectFailure;
\r
125 * Dokumentation siehe Database.java
\r
128 * @exception StorageObjectException
\r
130 abstract public boolean delete(String id) throws StorageObjectFailure;
\r
133 * Dokumentation siehe Database.java
\r
134 * @return ArrayList
\r
135 * @exception StorageObjectException
\r
137 abstract public ArrayList getFields() throws StorageObjectFailure;
\r
140 * Dokumentation siehe Database.java
\r
142 * @exception StorageObjectException
\r
144 abstract public int[] getTypes() throws StorageObjectFailure;
\r
147 * Dokumentation siehe Database.java
\r
148 * @return ArrayList
\r
149 * @exception StorageObjectException
\r
151 abstract public ArrayList getLabels() throws StorageObjectFailure;
\r
154 * Dokumentation siehe Database.java
\r
156 * @exception StorageObjectException
\r
158 abstract public void update(Entity a) throws StorageObjectFailure;
\r
161 * Dokumentation siehe Database.java
\r
163 * @return String id
\r
164 * @exception StorageObjectException
\r
166 abstract public String insert(Entity a) throws StorageObjectFailure;
\r
169 * Dokumentation siehe Database.java
\r
170 * @return Class Klasse der Entity
\r
172 abstract public Class getEntityClass();
\r
175 * put your documentation comment here
\r
178 abstract public String getIdName();
\r
181 * Dokumentation siehe Database.java
\r
184 abstract public String getTableName();
\r
187 * Dokumentation siehe Database.java
\r
188 * @return SimpleHash
\r
190 abstract public SimpleHash getHashData();
\r
193 * Dokumentation siehe Database.java
\r
194 * @return Connection
\r
195 * @exception StorageObjectException
\r
197 abstract public Connection getPooledCon() throws StorageObjectFailure;
\r
200 * Dokumentation siehe Database.java
\r
203 * @return ResultSet
\r
204 * @exception StorageObjectException, SQLException
\r
206 abstract public ResultSet executeSql(Statement a, String sql) throws
\r
207 StorageObjectFailure,
\r
211 * Dokumentation siehe Database.java
\r
215 abstract public void freeConnection(Connection con, Statement stmt) throws
\r
216 StorageObjectFailure;
\r
219 * Dokumentation siehe Database.java
\r
222 abstract public SimpleList getPopupData() throws StorageObjectFailure;
\r
224 abstract public int executeUpdate(Statement a, String sql) throws
\r
225 StorageObjectFailure, SQLException;
\r
227 abstract public int executeUpdate(String sql) throws StorageObjectFailure,
\r
230 abstract public int getSize(String where) throws SQLException,
\r
231 StorageObjectFailure;
\r