2 * Copyright (C) 2001, 2002 The Mir-coders group
4 * This file is part of Mir.
6 * Mir is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Mir is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Mir; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * In addition, as a special exception, The Mir-coders gives permission to link
21 * the code of this program with the com.oreilly.servlet library, any library
22 * licensed under the Apache Software License, The Sun (tm) Java Advanced
23 * Imaging library (JAI), The Sun JIMI library (or with modified versions of
24 * the above that use the same license as the above), and distribute linked
25 * combinations including the two. You must obey the GNU General Public
26 * License in all respects for all of the code used other than the above
27 * mentioned libraries. If you modify this file, you may extend this exception
28 * to your version of the file, but you are not obligated to do so. If you do
29 * not wish to do so, delete this exception statement from your version.
32 * Implementiert Interface f?r die Speicherschicht.
33 * Bislang gibt es in der Bibliothek nur die M?glichkeit
34 * in einer Datenbank zu speichern.
38 import freemarker.template.SimpleHash;
39 import freemarker.template.SimpleList;
41 import mir.entity.Entity;
42 import mir.entity.EntityList;
44 import java.sql.Connection;
45 import java.sql.ResultSet;
46 import java.sql.SQLException;
47 import java.sql.Statement;
49 import java.util.List;
53 * Implementiert Interface f?r die Speicherschicht.
54 * Bislang gibt es in der Bibliothek nur die M?glichkeit
55 * in einer Datenbank zu speichern.
59 public interface StorageObject {
61 * Dokumentation siehe Database.java
64 * @exception StorageObjectException
66 abstract public Entity selectById(String id) throws StorageObjectExc;
69 * Dokumentation siehe Database.java
73 * @exception StorageObjectException
75 abstract public EntityList selectByFieldValue(String aField, String aValue)
76 throws StorageObjectFailure;
79 * Dokumentation siehe Database.java
82 * @exception StorageObjectException
84 abstract public EntityList selectByWhereClause(String whereClause)
85 throws StorageObjectFailure;
88 * Dokumentation siehe Database.java
92 * @exception StorageObjectException
94 abstract public EntityList selectByWhereClause(String whereClause, int offset)
95 throws StorageObjectFailure;
98 * Dokumentation siehe Database.java
103 * @exception StorageObjectException
105 abstract public EntityList selectByWhereClause(String whereClause,
106 String orderBy, int offset) throws StorageObjectFailure;
109 * Dokumentation siehe Database.java
115 * @exception StorageObjectException
117 abstract public EntityList selectByWhereClause(String whereClause,
118 String orderBy, int offset, int limit) throws StorageObjectFailure;
121 * Dokumentation siehe Database.java
124 * @exception StorageObjectException
126 abstract public boolean delete(String id) throws StorageObjectFailure;
129 * Dokumentation siehe Database.java
131 * @exception StorageObjectException
133 abstract public List getFields() throws StorageObjectFailure;
136 * Dokumentation siehe Database.java
138 * @exception StorageObjectException
140 abstract public int[] getTypes() throws StorageObjectFailure;
143 * Dokumentation siehe Database.java
145 * @exception StorageObjectException
147 abstract public List getLabels() throws StorageObjectFailure;
150 * Dokumentation siehe Database.java
152 * @exception StorageObjectException
154 abstract public void update(Entity a) throws StorageObjectFailure;
157 * Dokumentation siehe Database.java
160 * @exception StorageObjectException
162 abstract public String insert(Entity a) throws StorageObjectFailure;
165 * Dokumentation siehe Database.java
166 * @return Class Klasse der Entity
168 abstract public Class getEntityClass();
171 * put your documentation comment here
174 abstract public String getIdName();
177 * Dokumentation siehe Database.java
180 abstract public String getTableName();
183 * Dokumentation siehe Database.java
186 abstract public SimpleHash getHashData();
189 * Dokumentation siehe Database.java
191 * @exception StorageObjectException
193 abstract public Connection getPooledCon() throws StorageObjectFailure;
196 * Dokumentation siehe Database.java
200 * @exception StorageObjectException, SQLException
202 abstract public ResultSet executeSql(Statement a, String sql)
203 throws StorageObjectFailure, SQLException;
206 * Dokumentation siehe Database.java
210 abstract public void freeConnection(Connection con, Statement stmt)
211 throws StorageObjectFailure;
214 * Dokumentation siehe Database.java
217 abstract public SimpleList getPopupData() throws StorageObjectFailure;
219 abstract public int executeUpdate(Statement a, String sql)
220 throws StorageObjectFailure, SQLException;
222 abstract public int executeUpdate(String sql)
223 throws StorageObjectFailure, SQLException;
225 abstract public int getSize(String where)
226 throws SQLException, StorageObjectFailure;