コード例 #1
0
 public void delete(DomainObject obj, DomainObject assoc) throws SQLException {
   Connection connection = DbService.getConnection();
   PreparedStatement stmt = null;
   try {
     stmt = connection.prepareStatement(deleteStatement());
     stmt.setString(1, obj.getId());
     stmt.setString(2, assoc.getId());
     stmt.execute();
   } finally {
     cleanUp(stmt);
   }
 }
コード例 #2
0
 public void insert(DomainObject obj, DomainObject assoc) throws SQLException {
   Connection connection = DbService.getConnection();
   PreparedStatement stmt = null;
   try {
     stmt = connection.prepareStatement(insertStatement());
     stmt.setString(1, obj.getId());
     stmt.setString(2, assoc.getId());
     stmt.execute();
     // TODO cache!!
     // loaded.put(obj.getId(), obj);
   } finally {
     cleanUp(stmt);
   }
 }
コード例 #3
0
 public void delete(DomainObject obj, String sql) throws SQLException {
   if (obj == null) {
     return;
   }
   Connection connection = DbService.getConnection();
   PreparedStatement stmt = null;
   try {
     stmt = connection.prepareStatement(sql);
     stmt.setString(1, obj.getId());
     stmt.execute();
   } finally {
     cleanUp(stmt);
   }
 }