com.h3c.util.dao

## Interface Dao<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 Superinterfaces:
    BaseDao<I,P,T,F,S>, Converter<P,T>
  All Known Implementing Classes:
    AbstractDao

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

  Data Access Object.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `P` | `create(T transportable, DataStoreContext context)` Creates a new persistent object with the data from the given transport object.
    `long` | `delete(F filter, DataStoreContext context)` Deletes all persistent objects matching the given filter.
    `boolean` | `delete(Id<T,I> id, DataStoreContext context)` Deletes the persistent object with the given id.
    `void` | `delete(P storable, DataStoreContext context)` Deletes a persistent object.
    `long` | `deleteAll(DataStoreContext context)` Deletes all the persistent objects.
    `P` | `update(T transportable, DataStoreContext context)` Updates the persistent object related to the given transport object.

    - ### Methods inherited from interface com.h3c.util.dao.BaseDao

      `count, find, find, findAll, get`

    - ### Methods inherited from interface com.h3c.util.Converter

      `convert`

- - ### Method Detail

    - #### create

          P create(T transportable,
                 DataStoreContext context)

      Creates a new persistent object with the data from the given transport object.
      Parameters:
        `transportable` - transport object to get the data from
        `context` - data store context
      Returns:
        the new created persistent object

    - #### update

          P update(T transportable,
                 DataStoreContext context)

      Updates the persistent object related to the given transport object.
      Parameters:
        `transportable` - transport object to get the data from
        `context` - data store context
      Returns:
        the updated persistent object

    - #### delete

          void delete(P storable,
                    DataStoreContext context)

      Deletes a persistent object.

      Concrete classes could override this method to do any pre-processing / post-processing work.

      Parameters:
        `storable` - the persistent object to delete
        `context` - data store context

    - #### delete

          boolean delete(Id<T,I> id,
                       DataStoreContext context)

      Deletes the persistent object with the given id.
      Parameters:
        `id` - persistent object's id
        `context` - data store context
      Returns:
        `true` if the persistent object was found and deleted, `false` if it was not found

    - #### delete

          long delete(F filter,
                    DataStoreContext context)

      Deletes all persistent objects matching the given filter.
      Parameters:
        `filter` - filter
        `context` - data store context
      Returns:
        number of deleted objects

    - #### deleteAll

          long deleteAll(DataStoreContext context)

      Deletes all the persistent objects.
      Parameters:
        `context` - data store context
      Returns:
        the count of entries deleted

Copyright © 2014. All Rights Reserved.