I
- type of the persistent object and transport object id.
This type should be immutable. It is critical this type
implements equals() and hashCode() correctly.P
- type of the persistent object.F
- type of the associated filter.S
- type of the associated sort specification type.C
- type of the data store execution context.public interface BaseDao<I extends Serializable,P extends Storable<I>,F,S,C>
BaseDao
is the Base Data Access Object. This interface provides
methods for all read operations from the underlying persistence storage.
All methods in this DAO deal with persistent objects instead of
transport objects because the result of a query not necessarily has to
fit into a single transport object. Result of methods defined in
this class will have to be converted to the right transport object.Modifier and Type | Method and Description |
---|---|
long |
count(F filter,
C context)
Gets the number of persisted objects based on a filter criteria.
|
List<P> |
find(F filter,
SortSpecification<S> sortSpecification,
C context)
Get the list of persistent objects based on the given filter criteria.
|
MarkPage<P> |
find(F filter,
SortSpecification<S> sortSpecification,
MarkPageRequest<?> request,
C context) |
List<P> |
findAll(SortSpecification<S> sortSpecification,
C context)
Gets all the persistent objects.
|
P |
get(I id,
C context)
Get the persistent object with the given id.
|
P get(I id, C context)
id
- persistent object's id.context
- data store context.List<P> find(F filter, SortSpecification<S> sortSpecification, C context) throws Exception
filter
- filter.sortSpecification
- sort specification.context
- data store context.Exception
- errorList<P> findAll(SortSpecification<S> sortSpecification, C context) throws Exception
sortSpecification
- sort specification.context
- data store context.Exception
- errorMarkPage<P> find(F filter, SortSpecification<S> sortSpecification, MarkPageRequest<?> request, C context) throws Exception
Exception
long count(F filter, C context) throws PersistenceConnException
filter
- filter.context
- data store context.PersistenceConnException
- Database connection failure exception.Copyright © 2015. All Rights Reserved.