Package ejava.examples.daoex.dao
Interface BookDAO
-
- All Known Implementing Classes:
JDBCBookDAOImpl
,JPABookDAOImpl
,JPANativeSQLBookDAO
public interface BookDAO
This interface provides an example DAO interface for a Book. Note that the technology associate with the DAO should not be exposed in this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Book
create(Book book)
Add the book to the database.List<Book>
findAll(int start, int count)
Returns a collection of books, starting at the index provided and limiting the collection to the count value.Book
get(long id)
Gets a book from the database by its ID.void
remove(Book book)
Removes a book from the database.Book
update(Book book)
Updates the book in the database with the values in this object.
-
-
-
Method Detail
-
create
Book create(Book book) throws PersistenceException
Add the book to the database.- Throws:
PersistenceException
-
update
Book update(Book book) throws PersistenceException
Updates the book in the database with the values in this object.- Throws:
PersistenceException
-
get
Book get(long id) throws PersistenceException
Gets a book from the database by its ID.- Throws:
PersistenceException
-
remove
void remove(Book book) throws PersistenceException
Removes a book from the database.- Throws:
PersistenceException
-
findAll
List<Book> findAll(int start, int count) throws PersistenceException
Returns a collection of books, starting at the index provided and limiting the collection to the count value.- Throws:
PersistenceException
-
-