Examples of AccountDAO


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

              }
              if (!createTrans)
                return;
            }
           
            AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
            Account newAccount = (Account)accountDAO.load("WHERE TITLE = 'Imbalance-USD'", null, true).get(0);
            TransSplit transSplit = new TransSplit();
            transSplit.setParentTransaction(trans);
            Account account = new Account();
            account.setAccountID(accountID);
            transSplit.setAccount(account);
View Full Code Here

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

              }
              trans.appendTransSplit(newSplit);
            }
          }
          else {
            AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
            Account newAccount = (Account)accountDAO.load("WHERE TITLE = 'Imbalance-USD'", null, true).get(0);
            TransSplit transSplit = new TransSplit();
            transSplit.setParentTransaction(trans);
            Account account = new Account();
            account.setAccountID(accountID);
            transSplit.setAccount(account);
View Full Code Here

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

  public void endElement(String uri, String localName, String qName)
    throws SAXException {
    tagData = tagData.trim();
    if (qName.equalsIgnoreCase("gnc:account")) {
      recordType = "";
      AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
      try {
        if (this.eventListener != null)
          this.eventListener.GNUCashEvent(new GNUCashEvent("Acocunt: " + currentAccount.getTitle()));
        String where = "where ACCOUNT_ID = '" + currentAccount.getAccountID() + "'";
        if (accountDAO.load(where, null, true).size() == 0)
          accountDAO.create(currentAccount, false);
        else
          accountDAO.update(currentAccount, false);
      }
      catch (Exception ex) {
        System.out.println("Error with account:\n" +
          currentAccount.getTitle() + "\n" +
          currentAccount.getAccountID());
View Full Code Here

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

            payee = (Payee)payees.get(i);
            XMLUtil.appendChildNode(payeesElement, PayeeXML.createXMLDocument(payee).getDocumentElement());
          }
         
          Element accountsElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Accounts", null);
          AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
          List accounts = accountDAO.load(null, "ORDER BY TITLE", false);
          Account account = null;
          for (int i=0; i<accounts.size(); i++) {
            account = (Account)accounts.get(i);
            account.setAccountList(new ArrayList());
            XMLUtil.appendChildNode(accountsElement, AccountXML.createXMLDocument(account).getDocumentElement());
View Full Code Here

Examples of org.zanata.dao.AccountDAO

    public boolean isNewUser(String username) {
        Object user = lookupUser(username);
        // also look in the credentials table
        if (user == null) {
            AccountDAO accountDAO =
                    ServiceLocator.instance().getInstance(AccountDAO.class);
            user = accountDAO.getByCredentialsId(username);
        }
        return user == null;
    }
View Full Code Here

Examples of org.zanata.dao.AccountDAO

        @Setter
        private String filter;

        @Override
        public DataPage<String> fetchPage(int startRow, int pageSize) {
            AccountDAO accountDAO =
                    (AccountDAO) Component.getInstance(AccountDAO.class,
                            ScopeType.STATELESS);

            List<String> userList =
                    accountDAO.getUserNames(filter, startRow, pageSize);

            int listSize = accountDAO.getUserCount(filter);

            return new DataPage<String>(listSize, startRow, userList);
        }
View Full Code Here

Examples of org.zanata.dao.AccountDAO

        private static final long serialVersionUID = 1L;

        @Override
        public void afterOpenIdAuth(OpenIdAuthenticationResult result) {
            if (result.isAuthenticated()) {
                AccountDAO accountDAO =
                        ServiceLocator.instance().getInstance(AccountDAO.class);
                HAccount account =
                        accountDAO.getByCredentialsId(result
                                .getAuthenticatedId());
                if (account == null) {
                    account = new HAccount(); // In case an account is not found
                }
                Contexts.getSessionContext().set("obsoleteAccount", account); // Outject
View Full Code Here

Examples of org.zanata.dao.AccountDAO

         * caller's context
         */
        if (username != null) {
            // Only if it's an authenticated task should it try and do this
            // injection
            AccountDAO accountDAO =
                    ServiceLocator.instance().getInstance(AccountDAO.class);
            ZanataJpaIdentityStore idStore =
                    ServiceLocator.instance().getInstance(
                            ZanataJpaIdentityStore.class);
            AuthenticationEvents authEvts =
                    ServiceLocator.instance().getInstance(
                            AuthenticationEvents.class);
            HAccount authenticatedAccount = accountDAO.getByUsername(username);
            idStore.setAuthenticateUser(authenticatedAccount);
        }
    }
View Full Code Here

Examples of org.zanata.dao.AccountDAO

                DatabaseOperation.DELETE_ALL));
    }

    @BeforeMethod
    public void setUp() throws Exception {
        AccountDAO accountDAO = new AccountDAO(getSession());
        HAccount authenticatedAccount = getEm().find(HAccount.class, 1L);
        // @formatter:off
        handler = SeamAutowire.instance()
            .reset()
            .use(JpaIdentityStore.AUTHENTICATED_USER, authenticatedAccount)
View Full Code Here

Examples of org.zanata.dao.AccountDAO

        super.newSession();
        this.prepareResources(); // Reset Seam as part of new transaction
                                 // simulation

        AccountDAO accountDAO = getSeamAutowire().autowire(AccountDAO.class);

        // Translator
        HAccount translator = accountDAO.getByUsername("demo");

        // Translate using the web editor
        this.simulateWebEditorTranslation("sample-project", "1.0", "my.txt",
                "tf1", translator, de_de, "Translated", ContentState.Approved);
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.