jgnash.engine.db4o
Class Db4oAccountDAO

java.lang.Object
  extended by jgnash.engine.dao.AbstractDAO
      extended by jgnash.engine.db4o.AbstractDb4oDAO
          extended by jgnash.engine.db4o.Db4oAccountDAO
All Implemented Interfaces:
AccountDAO

 class Db4oAccountDAO
extends AbstractDb4oDAO
implements AccountDAO

db4o Account DAO

Version:
$Id$
Author:
Craig Cavanaugh

Nested Class Summary
private static class Db4oAccountDAO.AccountGroupPredicate
           
private static class Db4oAccountDAO.AccountTypePredicate
           
 
Field Summary
private  java.util.logging.Logger logger
           
 
Fields inherited from class jgnash.engine.db4o.AbstractDb4oDAO
commitCount, container, GLOBAL_SEMAPHORE, isRemote, MAX_COMMIT_TIME, SEMAPHORE_WAIT_TIME, SEMAPHORE_WARNING
 
Constructor Summary
Db4oAccountDAO(com.db4o.ObjectContainer container, boolean isRemote)
           
 
Method Summary
 boolean addAccount(Account parent, Account child)
           
 boolean addAccountSecurity(Account account, SecurityNode node)
          Adds a SecurityNode from a InvestmentAccount
 boolean addRootAccount(RootAccount account)
           
 Account getAccountByUuid(java.lang.String uuid)
           
 java.util.List<Account> getAccountList()
           
 java.util.List<Account> getExpenseAccountList()
          Returns a list of ExpenseAccounts
 java.util.List<Account> getIncomeAccountList()
          Returns a list of IncomeAccounts
 java.util.List<Account> getInvestmentAccountList()
          Returns a list of InvestmentAccounts
 RootAccount getRootAccount()
           
 void refreshAccount(Account account)
          Force the engine to refresh the loading account.
 boolean removeAccountProperty(Account account, java.lang.Object object)
           
 boolean setAccountProperty(Account account, java.lang.Object object)
           
 boolean toggleAccountVisibility(Account account)
          Toggles the visibility of an account given its ID.
 boolean updateAccount(Account account)
           
 
Methods inherited from class jgnash.engine.db4o.AbstractDb4oDAO
commit, commitAndReset
 
Methods inherited from class jgnash.engine.dao.AbstractDAO
stripMarkedForRemoval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private java.util.logging.Logger logger
Constructor Detail

Db4oAccountDAO

Db4oAccountDAO(com.db4o.ObjectContainer container,
               boolean isRemote)
Method Detail

getRootAccount

public RootAccount getRootAccount()
Specified by:
getRootAccount in interface AccountDAO

getAccountList

public java.util.List<Account> getAccountList()
Specified by:
getAccountList in interface AccountDAO

addAccount

public boolean addAccount(Account parent,
                          Account child)
Specified by:
addAccount in interface AccountDAO

addRootAccount

public boolean addRootAccount(RootAccount account)
Specified by:
addRootAccount in interface AccountDAO

addAccountSecurity

public boolean addAccountSecurity(Account account,
                                  SecurityNode node)
Description copied from interface: AccountDAO
Adds a SecurityNode from a InvestmentAccount

Specified by:
addAccountSecurity in interface AccountDAO
Parameters:
account - account to add security to
node - security to add
Returns:
true if success

getIncomeAccountList

public java.util.List<Account> getIncomeAccountList()
Description copied from interface: AccountDAO
Returns a list of IncomeAccounts

Specified by:
getIncomeAccountList in interface AccountDAO
Returns:
list of income accounts

getExpenseAccountList

public java.util.List<Account> getExpenseAccountList()
Description copied from interface: AccountDAO
Returns a list of ExpenseAccounts

Specified by:
getExpenseAccountList in interface AccountDAO
Returns:
list of expense accounts

getInvestmentAccountList

public java.util.List<Account> getInvestmentAccountList()
Description copied from interface: AccountDAO
Returns a list of InvestmentAccounts

Specified by:
getInvestmentAccountList in interface AccountDAO
Returns:
list of investment accounts

getAccountByUuid

public Account getAccountByUuid(java.lang.String uuid)
Specified by:
getAccountByUuid in interface AccountDAO

updateAccount

public boolean updateAccount(Account account)
Specified by:
updateAccount in interface AccountDAO

setAccountProperty

public boolean setAccountProperty(Account account,
                                  java.lang.Object object)
Specified by:
setAccountProperty in interface AccountDAO

removeAccountProperty

public boolean removeAccountProperty(Account account,
                                     java.lang.Object object)
Specified by:
removeAccountProperty in interface AccountDAO

toggleAccountVisibility

public boolean toggleAccountVisibility(Account account)
Description copied from interface: AccountDAO
Toggles the visibility of an account given its ID.

Specified by:
toggleAccountVisibility in interface AccountDAO
Parameters:
account - The account to toggle visibility
Returns:
true if the supplied account ID was found false if the supplied account ID was not found
See Also:
AccountDAO.toggleAccountVisibility(jgnash.engine.Account)

refreshAccount

public void refreshAccount(Account account)
Description copied from interface: AccountDAO
Force the engine to refresh the loading account. Intended for client / server use

Specified by:
refreshAccount in interface AccountDAO
Parameters:
account - account to refresh