Package net.sourceforge.wampum.system.data

Examples of net.sourceforge.wampum.system.data.DAOFactory


  }
 
  private static String[] columnNames = {"Date", "Payee", "Deposit", "Withdraw", "Balance"};
  public void updateRegisterTableData() {
    if (currentAccount != null) {
      DAOFactory daoFactory = new DAOFactory();
      RegisterDAO registerDao = (RegisterDAO)daoFactory.getDAO("register");
      transactionList = registerDao.loadTransactionsForAccount(currentAccount.getAccountID());
    }
   
    TableModel dataModel = new AbstractTableModel() {
      private static final long serialVersionUID = 1;
View Full Code Here


            //no rows are selected
        } else {
            int selectedRow = lsm.getMinSelectionIndex();
            RegisterTrans trans = (RegisterTrans)transactionList.get(selectedRow);
           
        DAOFactory daoFactory = new DAOFactory();
        TransactionDAO transDao = (TransactionDAO)daoFactory.getDAO("transaction");
        List transList = transDao.load("WHERE TRANSACTION_ID = '" + trans.getTransactionID() + "'", null, false);
           
            transController.setTransaction((Transaction)transList.get(0), trans.getAmount(), trans.getBalance());
        }
  }
View Full Code Here

      checkButtonStatus();
    }
  }
 
  private void updateParentList() {
    DAOFactory factory = new DAOFactory();
    AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
    String whereClause = null;
    if (this.currentAccount.getAccountID() != null && !this.currentAccount.getAccountID().equals("")) {
      whereClause = "WHERE ACCOUNT_ID NOT IN ('" + this.currentAccount.getAccountID() + "')";
    }
    List accountList = accountDAO.load(whereClause, "ORDER BY TITLE", true);
View Full Code Here

  public static Payee findPayee(String name, boolean create) {
    if (name == null)
      throw new RuntimeException("Payee name is null!");
    Payee payee = null;
    if (payeeList == null) {
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeList = payeeDao.load(null, null, true);
    }
   
    boolean found = false;
    int count = 0;
    Payee currentPayee = null;
    while (!found && count<payeeList.size()) {
      currentPayee = (Payee)payeeList.get(count);
      if (name.equalsIgnoreCase(currentPayee.getName()) ||
          (currentPayee.getFilters() != null &&
          Pattern.matches(currentPayee.getFilters(), name))) {
        found = true;
        payee = currentPayee;
      }
      count++;
    }
   
    if (!found) {
      payee = new Payee();
      payee.setName(name);
     
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeDao.create(payee, false);
    }
   
    return payee;
  }
View Full Code Here

    finally {
      if (ps != null) { try {ps.close(); } catch (Throwable th) {}}
      if (conn != null) { try {conn.close(); } catch (Throwable th) {}}
    }
   
    DAOFactory daoFactory = new DAOFactory();
    PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
    payeeDao.delete(mergePayee);
  }
View Full Code Here

      ps.setString(2, accountID);
      resultSet = ps.executeQuery();
     
      if (resultSet.next()) {
        String transactionID = resultSet.getString("TRANSACTION_ID");
        DAOFactory daoFactory = new DAOFactory();
        TransactionDAO transDAO = (TransactionDAO)daoFactory.getDAO("transaction");
        retVal = (Transaction)transDAO.load("WHERE TRANSACTION_ID = '" + transactionID + "'", null, false).get(0);
      }
    }
    catch (Exception ex) {
      throw new RuntimeException(ex);
View Full Code Here

import net.sourceforge.wampum.system.data.DAOFactory;

public class AccountTreeDAO {
 
  public static List loadAccountTree() {
    DAOFactory daoFactory = new DAOFactory();
    AccountDAO accountDao = (AccountDAO)daoFactory.getDAO("account");
    List accountList = accountDao.load(null, "ORDER BY TITLE", true);
   
    // get root list
    List rootList = new ArrayList();
    Account account = null;
View Full Code Here

 
  public AccountEditor() {
    super();
    this.setRenderer(new AccountRenderer());
   
    DAOFactory factory = new DAOFactory();
    AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
    accountList = accountDAO.load(null, "ORDER BY TITLE", true);
    Account account = null;
    for (int i=0; i<accountList.size(); i++) {
      account = (Account)accountList.get(i);
      this.addItem(account);
View Full Code Here

  protected List transIDList = null;
 
  public QIFParser() {
    transIDList = new ArrayList();
    dateFormat = new SimpleDateFormat("MM/dd/yyyy");
    factory = new DAOFactory();
  }
View Full Code Here

      deletePayees();
     
      FileInputStream fis = new FileInputStream("./data/payees.csv");
      BufferedReader in = new BufferedReader(new InputStreamReader(fis));
     
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
     
      String textLine = null;
      String[] payeeStr = null;
      Payee payee = null;
      while ((textLine = in.readLine()) != null) {
        payeeStr = textLine.split(",");
        payee = new Payee();
        payee.setName(payeeStr[0]);
        payee.setFilters(payeeStr[1]);
        payeeDao.create(payee, false);
      }
      daoFactory.commit();
    }
    catch (Exception ex) {
      throw new RuntimeException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.wampum.system.data.DAOFactory

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.