jgnash.engine.db4o
Class Db4oCommodityDAO

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

 class Db4oCommodityDAO
extends AbstractDb4oDAO
implements CommodityDAO

Hides all the db4o commodity code

Version:
$Id$
Author:
Craig Cavanaugh

Nested Class Summary
private static class Db4oCommodityDAO.ActiveAccountCurrencyPredicate
          Query predicate that returns a set of active CurrencyNodes used in accounts
private static class Db4oCommodityDAO.ActiveSecurityCurrencyPredicate
          Query predicate that returns a set of active CurrencyNodes used in accounts
 
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
Db4oCommodityDAO(com.db4o.ObjectContainer container, boolean isRemote)
           
 
Method Summary
 boolean addCommodity(CommodityNode node)
           
 void addExchangeRate(ExchangeRate eRate)
           
 boolean addExchangeRateHistory(ExchangeRate rate, ExchangeRateHistoryNode hNode)
           
 boolean addSecurityHistory(SecurityNode node, SecurityHistoryNode hNode)
           
 java.util.Set<CurrencyNode> getActiveCurrencies()
          Returns the active currencies
 java.util.List<CurrencyNode> getCurrencies()
           
 ExchangeRate getExchangeNode(java.lang.String rateId)
           
 java.util.List<ExchangeRate> getExchangeRates()
           
 java.util.List<SecurityNode> getSecurities()
           
 void refreshCommodityNode(CommodityNode node)
           
 void refreshExchangeRate(ExchangeRate rate)
           
 boolean removeExchangeRateHistory(ExchangeRate rate, ExchangeRateHistoryNode hNode)
           
 boolean removeSecurityHistory(SecurityNode node, SecurityHistoryNode hNode)
           
 boolean updateCommodityNode(CommodityNode node)
           
 
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

Db4oCommodityDAO

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

addCommodity

public boolean addCommodity(CommodityNode node)
Specified by:
addCommodity in interface CommodityDAO

addSecurityHistory

public boolean addSecurityHistory(SecurityNode node,
                                  SecurityHistoryNode hNode)
Specified by:
addSecurityHistory in interface CommodityDAO

addExchangeRateHistory

public boolean addExchangeRateHistory(ExchangeRate rate,
                                      ExchangeRateHistoryNode hNode)
Specified by:
addExchangeRateHistory in interface CommodityDAO

removeExchangeRateHistory

public boolean removeExchangeRateHistory(ExchangeRate rate,
                                         ExchangeRateHistoryNode hNode)
Specified by:
removeExchangeRateHistory in interface CommodityDAO

getCurrencies

public java.util.List<CurrencyNode> getCurrencies()
Specified by:
getCurrencies in interface CommodityDAO

getExchangeNode

public ExchangeRate getExchangeNode(java.lang.String rateId)
Specified by:
getExchangeNode in interface CommodityDAO

getSecurities

public java.util.List<SecurityNode> getSecurities()
Specified by:
getSecurities in interface CommodityDAO
See Also:
CommodityDAO.getSecurities()

getExchangeRates

public java.util.List<ExchangeRate> getExchangeRates()
Specified by:
getExchangeRates in interface CommodityDAO

removeSecurityHistory

public boolean removeSecurityHistory(SecurityNode node,
                                     SecurityHistoryNode hNode)
Specified by:
removeSecurityHistory in interface CommodityDAO

addExchangeRate

public void addExchangeRate(ExchangeRate eRate)
Specified by:
addExchangeRate in interface CommodityDAO

refreshCommodityNode

public void refreshCommodityNode(CommodityNode node)
Specified by:
refreshCommodityNode in interface CommodityDAO

refreshExchangeRate

public void refreshExchangeRate(ExchangeRate rate)
Specified by:
refreshExchangeRate in interface CommodityDAO

updateCommodityNode

public boolean updateCommodityNode(CommodityNode node)
Specified by:
updateCommodityNode in interface CommodityDAO

getActiveCurrencies

public java.util.Set<CurrencyNode> getActiveCurrencies()
Description copied from interface: CommodityDAO
Returns the active currencies

Specified by:
getActiveCurrencies in interface CommodityDAO
Returns:
set of active currencies