Package net.sourceforge.wampum.finance.entities

Examples of net.sourceforge.wampum.finance.entities.TransactionDAO


            preparedStatement.setString(1, fitID);
            resultSet = preparedStatement.executeQuery();
           
            if (resultSet.next()) {
              String transID = resultSet.getString("TRANSACTION_ID");
              TransactionDAO transDAO = (TransactionDAO)this.daoFactory.getDAO("transaction");
              List transList = transDAO.load("WHERE TRANSACTION_ID = '" + transID + "'", null, false);
              retVal = (Transaction)transList.get(0);
            }
        }
        catch (Exception ex) {
          throw new RuntimeException(ex);
View Full Code Here


        } 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

      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

      if (trans.getTransactionID() != null) {
        RegisterDAO registerDAO = (RegisterDAO)daoFactory.getDAO("register");
        registerDAO.deleteTransaction(trans);
      }
     
      TransactionDAO transDAO = (TransactionDAO)daoFactory.getDAO("transaction");
      transDAO.create(trans, false);
     
      TransSplitDAO transSplitDAO = (TransSplitDAO)daoFactory.getDAO("transSplit");
      TransSplit transSplit = null;
      for (int i=0; i<this.transSplitList.size(); i++) {
        transSplit = (TransSplit)transSplitList.get(i);
View Full Code Here

    if (name.equalsIgnoreCase("account"))
      dao = new AccountDAO();
    else if (name.equalsIgnoreCase("budget"))
      dao = new BudgetDAO();
    else if (name.equalsIgnoreCase("transaction"))
      dao = new TransactionDAO();
    else if (name.equalsIgnoreCase("transSplit"))
      dao = new TransSplitDAO();
    else if (name.equalsIgnoreCase("payee"))
      dao = new PayeeDAO();
    else if (name.equalsIgnoreCase("register"))
View Full Code Here

            newSplit.setAccount(newAccount);
            newSplit.setAmount(new Double(-amount));
            trans.appendTransSplit(newSplit);
          }
        }
        TransactionDAO transDAO = (TransactionDAO)factory.getDAO("transaction");
        transDAO.store(trans, true);
        transIDList.add(trans.getTransactionID());
        factory.commit();
//        factory.close();
      }
      catch (Exception ex) {
View Full Code Here

            newSplit.setAccount(newAccount);
            newSplit.setAmount(new Double(-amount));
            trans.appendTransSplit(newSplit);
          }
        }
        TransactionDAO transDAO = (TransactionDAO)factory.getDAO("transaction");
        transDAO.store(trans, true);
        factory.commit();
        factory.close();
      }
      catch (Exception ex) {
        System.out.println("Error with transaction: Payee" + trans.getPayee().getName() + "\n" +
View Full Code Here

      }
      currentAccount = null;
    }
    else if (qName.equalsIgnoreCase("gnc:transaction")) {
      recordType = "";
      TransactionDAO transactionDAO = (TransactionDAO)daoFactory.getDAO("transaction");
      try {
        //System.out.println("Transaction: " + currentTransaction.getTransactionID());
        String where = "where TRANSACTION_ID = '" + currentTransaction.getTransactionID() + "'";
        if (transactionDAO.load(where, null, true).size() == 0) {
          Payee payee = PayeeUtils.findPayee(currentTransaction.getDescription(), true);
          currentTransaction.setPayee(payee);
          transactionDAO.create(currentTransaction, false);
          if (this.eventListener != null)
            this.eventListener.GNUCashEvent(new GNUCashEvent("Transaction: " + currentTransaction.getDescription() +
                " Payee:" + payee.getName()));
        }
        else {
          Payee payee = PayeeUtils.findPayee(currentTransaction.getDescription(), true);
          currentTransaction.setPayee(payee);
          transactionDAO.update(currentTransaction, false);
        }
       
        // create transaction splits
        TransSplitDAO transSplitDAO = (TransSplitDAO)daoFactory.getDAO("transSplit");
        try {
View Full Code Here

            account.setAccountList(new ArrayList());
            XMLUtil.appendChildNode(accountsElement, AccountXML.createXMLDocument(account).getDocumentElement());
          }
         
          Element transElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Transactions", null);
          TransactionDAO transDAO = (TransactionDAO)daoFactory.getDAO("transaction");
          List transList = transDAO.load(null, null, false);
          Transaction trans = null;
          for (int i=0; i<transList.size(); i++) {
            trans = (Transaction)transList.get(i);
            List transSplitList = trans.getTransSplitList();
            for (int j=0; j<transSplitList.size(); j++) {
View Full Code Here

TOP

Related Classes of net.sourceforge.wampum.finance.entities.TransactionDAO

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.