com.h3c.util.dao

## Interface BaseDao<I extends Serializable,P extends Storable<I>,T extends Transportable<? super T,I>,F,S>

- Type Parameters:
    `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 model persistent object
    `T` - type of the transport object
    `F` - type of the associated filter
    `S` - type of the associated sort specification type
  All Known Subinterfaces:
    BidirectionalDependentDao<I,P,T,Q,F,S,E,W,R>, Dao<I,P,T,F,S>
  All Known Implementing Classes:
    AbstractBaseDao, AbstractBidirectionalDependentDao, AbstractDao

      public interface BaseDao<I extends Serializable,P extends Storable<I>,T extends Transportable<? super T,I>,F,S>

  Base Data Access Object.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `count(F filter, DataStoreContext context)` Gets the number of persist objects based on a filter criteria.
    `List<P>` | `find(F filter, SortSpecification<S> sortSpec, DataStoreContext context)` Get the set of persist objects based on the given filter criteria.
    `Page<P>` | `find(F filter, SortSpecification<S> sortSpec, PageRequest pageRequest, DataStoreContext context)` Get the set of persist objects based on the given filter criteria.
    `List<P>` | `findAll(SortSpecification<S> sortSpec, DataStoreContext context)` Gets all the persistent objects.
    `P` | `get(Id<T,I> id, DataStoreContext context)` Get the persistent object with the given id.

- - ### Method Detail

    - #### get

          P get(Id<T,I> id,
              DataStoreContext context)

      Get the persistent object with the given id.
      Parameters:
        `id` - persistent object's id
        `context` - data store context
      Returns:
        the persistent object

    - #### find

          List<P> find(F filter,
                     SortSpecification<S> sortSpec,
                     DataStoreContext context)

      Get the set of persist objects based on the given filter criteria.
      Parameters:
        `filter` - Filter criteria
        `sortSpec` - sort specification
        `context` - data store context
      Returns:
        A set of persistent object instances

    - #### find

          Page<P> find(F filter,
                     SortSpecification<S> sortSpec,
                     PageRequest pageRequest,
                     DataStoreContext context)
                                           throws IndexOutOfBoundsException

      Get the set of persist objects based on the given filter criteria.
      Parameters:
        `filter` - Filter criteria
        `sortSpec` - sort specification
        `pageRequest` - the page of data desired
        `context` - data store context
      Returns:
        A set of persistent object instances
      Throws:
        `IndexOutOfBoundsException` - if page request is for a page outside the maximum or minimum pages for the request

    - #### findAll

          List<P> findAll(SortSpecification<S> sortSpec,
                        DataStoreContext context)

      Gets all the persistent objects.
      Parameters:
        `sortSpec` - sort specification
        `context` - data store context
      Returns:
        A set of persist object instances

    - #### count

          long count(F filter,
                   DataStoreContext context)

      Gets the number of persist objects based on a filter criteria.
      Parameters:
        `filter` - Filter criteria
        `context` - data store context
      Returns:
        The instances count

Copyright © 2014. All Rights Reserved.