Esempio n. 1
0
  public void update(Address obj) {
    String values = null, where = null;
    int typeId = 0;

    try {
      typeId = _dao.typeGateway().getByType(ADDRESS_TABLE, obj.getType().toString());

      values =
          CLIENT_ID
              + " = "
              + obj.getClientId()
              + ", "
              + ADDRESS
              + " = '"
              + obj.getAddress()
              + "', "
              + ADDRESSTYPE_ID
              + " = "
              + typeId
              + "";
      where = "WHERE " + ID + " = " + obj.getID();
      _commandString = "UPDATE " + ADDRESS_TABLE + " SET " + values + " " + where;
      _updateCount = _statement.executeUpdate(_commandString);
    } catch (Exception e) {
      _dao.processSQLError(e);
    }
  }
Esempio n. 2
0
 public void delete(Address obj) {
   _dao.globalGateway().delete(ADDRESS_TABLE, obj.getID());
 }