1677903f545be6e9d15688f6ba32ad4636b31f39
[mir.git] / source / mir / storage / StorageObject.java
1 /*
2  * Implementiert Interface für die Speicherschicht.
3  * Bislang gibt es in der Bibliothek nur die Möglichkeit
4  * in einer Datenbank zu speichern.
5  */
6 package mir.storage;
7
8 import java.lang.*;
9 import java.util.*;
10 import java.sql.*;
11 import freemarker.template.*;
12 import mir.entity.*;
13
14
15 /**
16  * Implementiert Interface für die Speicherschicht.
17  * Bislang gibt es in der Bibliothek nur die Möglichkeit
18  * in einer Datenbank zu speichern.
19  * @author RK
20  * @version     29.6.1999
21  */
22 public interface StorageObject {
23
24         /**
25          * Dokumentation siehe Database.java
26          * @param id
27          * @return Entity
28          * @exception StorageObjectException
29          */
30         abstract public Entity selectById (String id) throws StorageObjectException;
31
32
33
34         /**
35          * Dokumentation siehe Database.java
36          * @param aField
37          * @param aValue
38          * @return EntityList
39          * @exception StorageObjectException
40          */
41         abstract public EntityList selectByFieldValue (String aField, String aValue) throws StorageObjectException;
42
43
44
45         /**
46          * Dokumentation siehe Database.java
47          * @param whereClause
48          * @return EntityList
49          * @exception StorageObjectException
50          */
51         abstract public EntityList selectByWhereClause (String whereClause) throws StorageObjectException;
52
53
54
55         /**
56          * Dokumentation siehe Database.java
57          * @param whereClause
58          * @param offset
59          * @return EntityList
60          * @exception StorageObjectException
61          */
62         abstract public EntityList selectByWhereClause (String whereClause, int offset) throws StorageObjectException;
63
64
65
66         /**
67          * Dokumentation siehe Database.java
68          * @param whereClause
69          * @param orderBy
70          * @param offset
71          * @return EntityList
72          * @exception StorageObjectException
73          */
74         abstract public EntityList selectByWhereClause (String whereClause, String orderBy,
75                         int offset) throws StorageObjectException;
76
77
78
79         /**
80          * Dokumentation siehe Database.java
81          * @param whereClause
82          * @param orderBy
83          * @param offset
84          * @param limit
85          * @return EntityList
86          * @exception StorageObjectException
87          */
88         abstract public EntityList selectByWhereClause (String whereClause, String orderBy,
89                         int offset, int limit) throws StorageObjectException;
90
91
92
93         /**
94          * Dokumentation siehe Database.java
95          * @param id
96          * @return boolen
97          * @exception StorageObjectException
98          */
99         abstract public boolean delete (String id) throws StorageObjectException;
100
101
102
103         /**
104          * Dokumentation siehe Database.java
105          * @return ArrayList
106          * @exception StorageObjectException
107          */
108         abstract public ArrayList getFields () throws StorageObjectException;
109
110
111
112         /**
113          * Dokumentation siehe Database.java
114          * @return int[]
115          * @exception StorageObjectException
116          */
117         abstract public int[] getTypes () throws StorageObjectException;
118
119
120
121         /**
122          * Dokumentation siehe Database.java
123          * @return ArrayList
124          * @exception StorageObjectException
125          */
126         abstract public ArrayList getLabels () throws StorageObjectException;
127
128
129
130         /**
131          * Dokumentation siehe Database.java
132          * @param a
133          * @exception StorageObjectException
134          */
135         abstract public void update (Entity a) throws StorageObjectException;
136
137
138
139         /**
140          * Dokumentation siehe Database.java
141          * @param a
142          * @return String id
143          * @exception StorageObjectException
144          */
145         abstract public String insert (Entity a) throws StorageObjectException;
146
147
148
149         /**
150          * Dokumentation siehe Database.java
151          * @return Class Klasse der Entity
152          */
153                 abstract public Class getEntityClass();
154
155
156
157         /**
158          * put your documentation comment here
159          * @return
160          */
161                 abstract public String getIdName();
162
163
164
165         /**
166          * Dokumentation siehe Database.java
167          * @return String
168          */
169                 abstract public String getTableName();
170
171
172
173         /**
174          * Dokumentation siehe Database.java
175          * @return SimpleHash
176          */
177                 abstract public SimpleHash getHashData();
178
179
180
181         /**
182          * Dokumentation siehe Database.java
183          * @return Connection
184          * @exception StorageObjectException
185          */
186         abstract public Connection getPooledCon () throws StorageObjectException;
187
188
189
190         /**
191          * Dokumentation siehe Database.java
192          * @param a
193          * @param sql
194          * @return ResultSet
195          * @exception StorageObjectException, SQLException
196          */
197         abstract public ResultSet executeSql (Statement a, String sql) throws StorageObjectException,
198                         SQLException;
199
200
201
202         /**
203          * Dokumentation siehe Database.java
204          * @param con
205          * @param stmt
206          */
207                 abstract public void freeConnection(Connection con,  Statement stmt);
208
209
210
211         /**
212          * Dokumentation siehe Database.java
213          * @return
214          */
215         abstract public SimpleList getPopupData ();
216
217         abstract public int executeUpdate(Statement a, String sql) throws StorageObjectException, SQLException ;
218         abstract public int executeUpdate(String sql) throws StorageObjectException, SQLException ;
219         abstract public int getSize(String where) throws SQLException,StorageObjectException;
220
221 }
222
223
224