Package app.controler.note

Source Code of app.controler.note.NoteManager

package app.controler.note;

import java.util.ArrayList;
import java.util.List;

import org.ytreza.data.table.exception.ItemException;
import org.ytreza.data.table.jdbc.JdbcCommand;

import app.database.TableFactory;

public class NoteManager {

  private TableFactory factory;

  public NoteManager(TableFactory factory) {
    this.factory = factory;
  }

  public Note create() {
    return new NoteImp(factory);
  }

  public Note get(Integer id) {
    return new NoteImp(factory, id);
  }

  public List<Integer> getAllIds()  {
    List<Integer> list = new ArrayList<Integer>();
    try {
      String command = "Select id" +
          " from note" +
          " order by subject";

      for (Integer id : factory.getTableNote().getIdWhere(new JdbcCommand(command))) {
        list.add(id);
      }
    } catch (ItemException e) {
      // AUTO_TODO Auto-generated catch block
      e.printStackTrace();
    }
    return list;
  }
}
TOP

Related Classes of app.controler.note.NoteManager

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.