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 java.sql.Connection;
39 import java.sql.ResultSet;
40 import java.sql.SQLException;
41 import java.sql.Statement;
42 import java.util.List;
44 import mir.entity.Entity;
45 import mir.entity.EntityList;
46 import freemarker.template.SimpleHash;
47 import freemarker.template.SimpleList;
51 * Implementiert Interface f?r die Speicherschicht.
52 * Bislang gibt es in der Bibliothek nur die M?glichkeit
53 * in einer Datenbank zu speichern.
57 public interface StorageObject {
59 * Dokumentation siehe Database.java
62 * @exception StorageObjectException
64 abstract public Entity selectById(String id) throws StorageObjectExc;
67 * Dokumentation siehe Database.java
71 * @exception StorageObjectException
73 abstract public EntityList selectByFieldValue(String aField, String aValue)
74 throws StorageObjectFailure;
77 * Dokumentation siehe Database.java
80 * @exception StorageObjectException
82 abstract public EntityList selectByWhereClause(String whereClause)
83 throws StorageObjectFailure;
86 * Dokumentation siehe Database.java
90 * @exception StorageObjectException
92 abstract public EntityList selectByWhereClause(String whereClause, int offset)
93 throws StorageObjectFailure;
96 * Dokumentation siehe Database.java
101 * @exception StorageObjectException
103 abstract public EntityList selectByWhereClause(String whereClause,
104 String orderBy, int offset) throws StorageObjectFailure;
107 * Dokumentation siehe Database.java
113 * @exception StorageObjectException
115 abstract public EntityList selectByWhereClause(String whereClause,
116 String orderBy, int offset, int limit) throws StorageObjectFailure;
119 * Dokumentation siehe Database.java
122 * @exception StorageObjectException
124 abstract public boolean delete(String id) throws StorageObjectFailure;
127 * Dokumentation siehe Database.java
129 * @exception StorageObjectException
131 abstract public List getFields() throws StorageObjectFailure;
134 * Dokumentation siehe Database.java
136 * @exception StorageObjectException
138 abstract public int[] getTypes() throws StorageObjectFailure;
141 * Dokumentation siehe Database.java
143 * @exception StorageObjectException
145 abstract public List getLabels() throws StorageObjectFailure;
148 * Dokumentation siehe Database.java
150 * @exception StorageObjectException
152 abstract public void update(Entity a) throws StorageObjectFailure;
155 * Dokumentation siehe Database.java
158 * @exception StorageObjectException
160 abstract public String insert(Entity a) throws StorageObjectFailure;
163 * Dokumentation siehe Database.java
164 * @return Class Klasse der Entity
166 abstract public Class getEntityClass();
169 * put your documentation comment here
172 abstract public String getIdName();
175 * Dokumentation siehe Database.java
178 abstract public String getTableName();
181 * Dokumentation siehe Database.java
184 abstract public SimpleHash getHashData();
187 * Dokumentation siehe Database.java
189 * @exception StorageObjectException
191 abstract public Connection getPooledCon() throws StorageObjectFailure;
194 * Dokumentation siehe Database.java
198 * @exception StorageObjectException, SQLException
200 abstract public ResultSet executeSql(Statement a, String sql)
201 throws StorageObjectFailure, SQLException;
204 * Dokumentation siehe Database.java
208 abstract public void freeConnection(Connection con, Statement stmt)
209 throws StorageObjectFailure;
212 * Dokumentation siehe Database.java
215 abstract public SimpleList getPopupData() throws StorageObjectFailure;
217 abstract public int executeUpdate(Statement a, String sql)
218 throws StorageObjectFailure, SQLException;
220 abstract public int executeUpdate(String sql)
221 throws StorageObjectFailure, SQLException;
223 abstract public int getSize(String where)
224 throws SQLException, StorageObjectFailure;