Package org.ytreza.app.noterex.model

Examples of org.ytreza.app.noterex.model.Note


      window.setVisible(true);
    }
  }

  public void createNote() {
    WindowNote windowForm = new WindowNote(window, indexer, new Note(), factory);
    windowForm.setVisible(true);
  }
View Full Code Here


      window.setVisible(true);
    }
  }

  public void createNote() {
    WindowNote windowForm = new WindowNote(window, indexer, new Note(), factory);
    windowForm.setVisible(true);
  }
View Full Code Here

  public Note getItem(Integer id) throws ItemException{
    try {
      selectOneStatement.setInt(1, id);
      ResultSet result = selectOneStatement.executeQuery();

      Note note = null;
      if (result.next()) {
        note = new Note(id, this);
      }
      result.close();
     
      if (note != null) {
        return note; 
View Full Code Here

    List<Note> list = new ArrayList<Note>();
    try {
      ResultSet result = selectAllStatement.executeQuery();

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

  public Note getItemForInit(Integer id) throws ItemException {
    try {
      selectOneStatement.setInt(1, id);
      ResultSet resultNote = selectOneStatement.executeQuery();

      Note note = null;
      if (resultNote.next()) {
        note = new Note(resultNote.getString("subject"), resultNote.getString("text"), resultNote.getString("keywords"));
      }
      resultNote.close();
     
      if (note != null) {
        return note; 
View Full Code Here

  }
 
  private void readNextNote() {
    try {
      if (set.next()) {
        nextNote = new Note(set.getInt("id"), reader);
        hasNext = true;
      } else {
        hasNext = false;
      }
    } catch (SQLException e) {
View Full Code Here

  }

  @Override
  public Note next() {
    if (hasNext) {
      Note currentNote = nextNote;
      readNextNote();
      return currentNote;
    } else {
      throw new NoSuchElementException();
    }
View Full Code Here

    this.window = window;
    this.indexer = indexer;
    if (note != null) {
      this.note = note;
    } else {
      this.note = new Note();
    }
  }
View Full Code Here

    return null;
  }

  @Override
  public Note getItemForInit(Integer id) throws ItemException {
    return new Note("","","");
  }
View Full Code Here

  public void tearDown() throws Exception {
  }

  @Test
  public void testSaveNewNote() throws ItemException {
    Note note = new Note("subject","text");
    Assert.assertTrue(note.getId() == -1);
    note.save(factory);
    Assert.assertFalse(note.getId() == -1);
  }
View Full Code Here

TOP

Related Classes of org.ytreza.app.noterex.model.Note

Copyright © 2018 www.massapicom. 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.