Examples of ItemException


Examples of org.ytreza.app.noterex.database.exception.ItemException

      while (result.next()) {
        list.add(new Tag(result.getInt("id"), this));
      }
      result.close();
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }
    return list;
  }
View Full Code Here

Examples of org.ytreza.app.noterex.database.exception.ItemException

     
      if (tag != null) {
        return tag; 
      }
    } catch (SQLException e) {
      throw new ItemException(Type.SELECT_ERROR, e);
    }

    throw new ItemException(Type.ITEM_MISSING);
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

    if (listValues.containsKey(id)){
      MockObject object = new MockObject();
      object.setValue(listValues.get(id));
      return new Origin<MockObject>(table, table.getTableFactory(), id, object);
    }else {
      throw new ItemException(ItemException.ErrorType.ITEM_DOESNT_EXIST);
    }
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      }

      set.close();
      statement.close();
    } catch (SQLException e) {
      throw new ItemException(ItemException.ErrorType.CANT_GET, e);
    }
    return list;
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      ResultSet set = statement.executeQuery("SELECT * FROM " + getTable().getTableName() + " where id = " + id);
      if (set.next()) {
        idFound = set.getInt("id");
        initializeFromResultSet(map, set);
      } else {
        throw new ItemException(ItemException.ErrorType.ITEM_DOESNT_EXIST);
      }
      set.close();
      statement.close();
    } catch (SQLException e) {
      throw new UnableToInitializeException(e);
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      set = statement.executeQuery("SELECT id FROM " + getTableName() + new FilterJdbc(filter) + " ORDER BY id");

      if (set.next()) {
        id = set.getInt("id");
      } else {
        throw new ItemException(ItemException.ErrorType.ITEM_DOESNT_EXIST);
      }

      if (set.next()) {
        throw new NotUniqueItemException();
      }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      }

      set.close();
      statement.close();
    } catch (SQLException e) {
      throw new ItemException(ItemException.ErrorType.CANT_GET,e);
    }
    return list;
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      }

      set.close();
      statement.close();
    } catch (SQLException e) {
      throw new ItemException(ItemException.ErrorType.CANT_GET,e);
    }
    return list;
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

      statement.executeUpdate("DELETE FROM " + getTableName() + new FilterJdbc(filter));

      statement.close();
    } catch (SQLException e) {
      throw new ItemException(ItemException.ErrorType.CANT_DELETE,e);
    }
  }
View Full Code Here

Examples of org.ytreza.data.table.exception.ItemException

  public void deleteItem(Origin<T> origin) throws ItemException, UnableToDeleteException {
    if (origin.canBeDeleted()) {
      strategy.deleteItem(origin);
      origin.setId(-1);
    } else {
      throw new ItemException(ItemException.ErrorType.CANT_DELETE);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.