net.dontdrinkandroot.persistence.dao

## Interface TypedDao<E extends Entity<K>,K>

Type Parameters:
  `E` - Type of the `Entity`.
  `K` - Type of the `Entity`'s primary id.

All Superinterfaces:
  GenericDao

All Known Implementing Classes:
  TypedJpaDao

    public interface TypedDao<E extends Entity<K>,K>
    extends GenericDao

Contract of a Data Access Object that manages a specific `Entity` class.

Author:
  Philip W. Sorst <philip@sorst.net>

### Method Summary

Methods
`void` `delete(E entity)` Deletes the given Entity.
`void` `delete(K id)` Deletes the entity with the given id.
`E` `find(K id)` Finds the entity with the given id.
`List<E>` `findAll()` Finds all entities.
`List<E>` `findAll(Collection<PredicateBuilder<E>> predicateBuilders)` Finds all entities that match all predicates generated by the given `PredicateBuilder` s.
`List<E>` `findAll(PredicateBuilder<E>... predicateBuilders)` Finds all entities that match all predicates generated by the given `PredicateBuilder` s.
`List<E>` `findAll(PredicateBuilder<E> predicateBuilder)` Finds all entities that match all predicates generated by the given `PredicateBuilder` s.
`List<E>` `findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute, boolean asc)` Finds all entities ordered by the given attribute and the given sort order.
`List<E>` `findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute, boolean asc, int firstResult, int numResults)` Finds all entities ordered by the given attribute and the given sort order with the result set limit to the given size.
`long` `getCount()` Get the total number of entities in this Dao.
`E` `load(K id)` Loads the entity with the given id or throws an Exception if it was not found.

### Methods inherited from interface net.dontdrinkandroot.persistence.dao.GenericDao

`delete, delete, find, findAll, getCount, load, save`

### Method Detail

#### delete

    void delete(E entity)

Deletes the given Entity.

#### delete

    void delete(K id)

Deletes the entity with the given id.

#### find

    E find(K id)

Finds the entity with the given id.

#### findAll

    List<E> findAll()

Finds all entities.

#### load

    E load(K id)

Loads the entity with the given id or throws an Exception if it was not found.

#### getCount

    long getCount()

Get the total number of entities in this Dao.

#### findAll

    List<E> findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
                  boolean asc)

Finds all entities ordered by the given attribute and the given sort order.

Parameters:
  `asc` - True to sort in ascending order, false to sort in descending order.

#### findAll

    List<E> findAll(javax.persistence.metamodel.SingularAttribute<? super E,?> attribute,
                  boolean asc,
                  int firstResult,
                  int numResults)

Finds all entities ordered by the given attribute and the given sort order with the result set limit to the given size.

Parameters:
  `asc` - True to sort in ascending order, false to sort in descending order.
  `firstResult` - Position of the first result to retrieve.
  `maxResults` - The maximum number of results to retrieve.

#### findAll

    List<E> findAll(Collection<PredicateBuilder<E>> predicateBuilders)

Finds all entities that match all predicates generated by the given `PredicateBuilder` s.

#### findAll

    List<E> findAll(PredicateBuilder<E> predicateBuilder)

Finds all entities that match all predicates generated by the given `PredicateBuilder` s.

#### findAll

    List<E> findAll(PredicateBuilder<E>... predicateBuilders)

Finds all entities that match all predicates generated by the given `PredicateBuilder` s.