| net.sf.jmoney.model2.IEntryQueries
All known Subclasses: net.sf.jmoney.jdbcdatastore.SessionManager,
IEntryQueries | public interface IEntryQueries (Code) | | Interface containing methods that execute queries against the datastore.
Plug-ins that implement a datastore may optionally implement this interface.
Consumers obtain this interface through the getAdapter method in the session
object.
The queries in this interface are all require access to the list of entries
and therefore it is a good idea for datastore implementations to implement
this interface if the entries are not cached in memory.
author: Nigel Westbury |
Method Summary | |
long[] | getEntryTotalsByMonth(CapitalAccount account, int startYear, int startMonth, int numberOfMonths, boolean includeSubAccounts) Return the total amount of entries in the account in each month. | Collection<Entry> | getSortedEntries(CapitalAccount account, PropertyAccessor sortProperty, boolean descending) Return a sorted collection of Entry objects.
The returned Collection is be implemented by the datastore.
The implementation is therefore optimized by the datastore.
For example, if the datastore is a JDBC database then the size()
method will get the count from the database by executing a command
of the form "select count(*) from entries where account = ?".
The entries themselves will not be read from the database unless
the Collection is iterated or the toArray method is called.
If the datastore is backed by a database that supports an
ORDER BY clause then the sorting will generally be passed on
the the database.
Parameters: account - The account whose entries are to be returned. Parameters: sortProperty - The property used for the sort. | long | sumOfAmounts(CurrencyAccount account, Date fromDate, Date toDate) Sum the amount for all entries in the given range
(inclusive of the 'from' and 'to' dates). |
getEntryTotalsByMonth | long[] getEntryTotalsByMonth(CapitalAccount account, int startYear, int startMonth, int numberOfMonths, boolean includeSubAccounts)(Code) | | Return the total amount of entries in the account in each month.
The range of months are given by the startYear, startMonth, and
numberOfMonths parameters.
Parameters: startYear - Parameters: startMonth - Parameters: numberOfMonths - Parameters: includeSubAccounts - An array with a size equal to the numberOfMonths |
getSortedEntries | Collection<Entry> getSortedEntries(CapitalAccount account, PropertyAccessor sortProperty, boolean descending)(Code) | | Return a sorted collection of Entry objects.
The returned Collection is be implemented by the datastore.
The implementation is therefore optimized by the datastore.
For example, if the datastore is a JDBC database then the size()
method will get the count from the database by executing a command
of the form "select count(*) from entries where account = ?".
The entries themselves will not be read from the database unless
the Collection is iterated or the toArray method is called.
If the datastore is backed by a database that supports an
ORDER BY clause then the sorting will generally be passed on
the the database.
Parameters: account - The account whose entries are to be returned. Parameters: sortProperty - The property used for the sort. This propertymay be a property in the Entry object, a property inthe Transaction object, or a property in the Account object. Parameters: descending - if true, sort in descending order |
sumOfAmounts | long sumOfAmounts(CurrencyAccount account, Date fromDate, Date toDate)(Code) | | Sum the amount for all entries in the given range
(inclusive of the 'from' and 'to' dates).
Parameters: account - Parameters: fromDate - Parameters: toDate - |
|
|