• R/O
  • SSH
  • HTTPS

estocdb: Commit


Commit MetaInfo

Revisão29 (tree)
Hora2009-05-22 16:28:43
Autorshun_m

Mensagem de Log

(mensagem de log vazia)

Mudança Sumário

Diff

--- trunk/src/estoc/dbm/DataAccessImpl.java (revision 28)
+++ trunk/src/estoc/dbm/DataAccessImpl.java (revision 29)
@@ -97,6 +97,11 @@
9797 * @see dbm.DataAccess#delete(java.lang.Object)
9898 */
9999 public boolean delete(Object obj) throws SQLException {
100+ if (obj instanceof Class<?>) {
101+ String tableName = getTableName((Class<?>) obj);
102+ connection.createStatement().executeUpdate("DELETE FROM " + tableName);
103+ return true;
104+ }
100105 Class<?> clz = obj.getClass();
101106 PreparedStatement stmt = deleteStmts.get(clz);
102107 if (stmt == null || stmt.getConnection() != connection) {
@@ -227,9 +232,6 @@
227232 String tableName = getTableName(clz);
228233 String sql = creator.getInsertSql(tableName, columns);
229234 LOG.info("sql= " + sql);
230-
231-
232-
233235 stmt = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
234236 insertStmts.put(clz, stmt);
235237 return stmt;
Show on old repository browser