| Constructor and Description |
|---|
AuthorDAOSpringJDBCImpl() |
| Modifier and Type | Method and Description |
|---|---|
Long |
findAuthorByFirstLastName(Author author)
Finds the id of the given
Author object in the database,
using the firstName and lastName properties
to lookup the record. |
void |
insert(Author author)
Inserts the given author into the database.
|
void |
insertNewAuthor(Author author)
Insert a new Author into the DB.
|
void |
setAuthorIds(ArrayList authors)
Walks input ArrayList, looking up and setting ID properties for
each Author in the list.
|
void |
setInsertAuthorByFirstlastNameSQL(String insertAuthorByFirstlastNameSQL)
Used for Spring Dependency Injection
|
void |
setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
Used for Spring Dependency Injection
|
void |
setResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource resourceBundleMessageSource)
Used for Spring Dependency Injection
|
void |
setSelectAuthorByFirstLastNameSQL(String selectAuthorByFirstLastNameSQL)
Used for Spring Dependency Injection
|
public void setSelectAuthorByFirstLastNameSQL(String selectAuthorByFirstLastNameSQL)
public void setInsertAuthorByFirstlastNameSQL(String insertAuthorByFirstlastNameSQL)
public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
jdbcTemplate - The jdbcTemplate to set.public void setResourceBundleMessageSource(org.springframework.context.support.ResourceBundleMessageSource resourceBundleMessageSource)
public void insert(Author author) throws LibraryException
AuthorDAOInserts the given author into the database. Has the side effect of
setting the id field of author to the
sequentially generated ID of the new record.
First checks to see if an author with the same
firstName and lastName as author
exists. If so, no insert is performed; but author.id is
updated to the id of the previously existing record.
insert in interface AuthorDAOLibraryException - if a data access error occurspublic Long findAuthorByFirstLastName(Author author) throws LibraryException
AuthorDAOAuthor object in the database,
using the firstName and lastName properties
to lookup the record.findAuthorByFirstLastName in interface AuthorDAOauthor - Author to lookup by nameLibraryExceptionpublic void insertNewAuthor(Author author) throws LibraryException
author - author To be inserted in the DBLibraryExceptionpublic void setAuthorIds(ArrayList authors) throws LibraryException
AuthorDAOsetAuthorIds in interface AuthorDAOauthors - = ArrayList of AuthorsLibraryExceptionCopyright © 2003-2017 The Virtual Library Team. All Rights Reserved.