01: package org.dbbrowser.db.engine.updateengine;
02:
03: import java.sql.Statement;
04:
05: import org.dbbrowser.db.engine.exception.DBEngineException;
06: import org.dbbrowser.db.engine.model.ColumnInfo;
07: import org.dbbrowser.db.engine.model.DBRow;
08: import org.dbbrowser.db.engine.model.View;
09:
10: /**
11: * Methods which must be implemented by a Update Engine. The UI uses these methods to update the database
12: */
13: public interface DBUpdateEngine {
14: /**
15: * Update the view definition for the view
16: * @param view
17: * @throws DBEngineException
18: */
19: public void updateViewDefinition(View view)
20: throws DBEngineException;
21:
22: /**
23: * Add new column to the table
24: * @param schemaName
25: * @param tableName
26: * @param columnInfo
27: * @throws DBEngineException
28: */
29: public void addNewColumn(String schemaName, String tableName,
30: ColumnInfo columnInfo) throws DBEngineException;
31:
32: /**
33: * Drop the column from the table
34: * @param schemaName
35: * @param tableName
36: * @param columnInfo
37: * @throws DBEngineException
38: */
39: public void dropColumn(String schemaName, String tableName,
40: ColumnInfo columnInfo) throws DBEngineException;
41:
42: /**
43: * Add a new row to the database
44: * @param schemaName
45: * @param tableName
46: * @param dbRow
47: * @throws DBEngineException
48: */
49: public void addNewRow(String schemaName, String tableName,
50: DBRow dbRow) throws DBEngineException;
51:
52: /**
53: * Update the database using the data from the DBRow
54: * @param schemaName
55: * @param tableName
56: * @param dbRow
57: * @throws DBEngineException
58: */
59: public void update(String schemaName, String tableName, DBRow dbRow)
60: throws DBEngineException;
61:
62: /**
63: * Delete the row
64: * @param schemaName
65: * @param tableName
66: * @param dbRow
67: * @throws DBEngineException
68: */
69: public void deleteRow(String schemaName, String tableName,
70: DBRow dbRow) throws DBEngineException;
71:
72: /**
73: * Return the statement used to update the database
74: * @return
75: */
76: public Statement getStatement();
77: }
|