|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Id - Identification typeElement - Element typepublic interface IBaseReadOnlyDao<Id,Element>
Data Access Object (DAO) Pattern: Abstracts from any direct type of
database or persistence mechanism. Provides specific operations without
exposing details of the database.
Responsibility : Partial base Data Access Object abstraction
providing Read-Only features:
![]() |
![]() |
| Method Summary | |
|---|---|
boolean |
contains(Element anElement)
Returns true if the specified Element exists in the persistent storage, false otherwise. |
int |
count()
Returns the total number of records. |
List<Element> |
findAll()
Returns all Elements from the persistent storage. |
Element |
findById(Id anId)
Returns the Element matching the given ID. |
ISession |
getSession()
Returns the ISession adapted from the implementation-specific |
ITransaction |
getTransaction()
Returns the ITransaction adapted from the implementation-specific |
| Method Detail |
|---|
boolean contains(Element anElement)
throws DaoException,
IllegalArgumentException
anElement - Element to find in this persistent storage.
DaoException
IllegalArgumentException - 'anId' must not be null.
int count()
throws DaoException
"SELECT * FROM ...". Noteworthy that every call to
this function will trigger a new execution of a statement. Therefore if
the count value is needed several times in the client code it is a good
idea to cache it there.
DaoException
Element findById(Id anId)
throws DaoException,
IllegalArgumentException
anId - ID of the Element to retrieve.
DaoException
IllegalArgumentException - 'anId' must not be null.
List<Element> findAll()
throws DaoException
DaoExceptionISession getSession()
ISession adapted from the implementation-specific
ISession adapted from the implementation-specificIAdapterITransaction getTransaction()
ITransaction adapted from the implementation-specific
ITransaction adapted from the implementation-specificIAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||