Constructor and Description |
---|
ReaderDAOSpringJDBCImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
deskPhoneExists(String deskphone)
Checks to see if a Reader with a specified deskphone exists in the database
|
long |
getReaderID(String firstName,
String lastName)
Looks up the ID of a reader from first and last name.
|
ArrayList |
getReaders()
Retrive all Readers from the database
|
void |
insert(Reader reader)
Inserts Reader into the database.
|
boolean |
readerExists(long id)
Checks to see if a Reader id exists in the database
|
boolean |
readerExists(String deskphone)
Checks to see if a Reader with a specified deskphone exists in the database
|
boolean |
readerExists(String firstName,
String lastName)
Checks to see if a reader with the given first and last name is
registered in the database.
|
void |
resetPassword(String user,
String newPwd)
Resets user's password
|
Reader |
retrieve(Reader rd)
Retrieve Reader from the database
|
Reader |
retrieveByFirstLastName(String firstName,
String lastName)
Retrieve Reader by first and last name from the database
|
Reader |
retrieveByGenericCriteria(String sqlString,
Object[] criteria)
Retrieve Reader using a parameterized query.
|
Reader |
retrieveById(long id)
Retrieve Reader by id from the database
|
Reader |
retrieveByPhone(String deskphone)
Retrieve Reader by deskphone from the database
|
Reader |
retrieveByUid(String uid)
Retrieve Reader by uid from the database
|
void |
setCrypto(Crypto crypto)
Used for Spring Dependency Injection
|
void |
setDeleteReaderAdminRoleSQL(String deleteReaderAdminRoleSQL)
Used for Spring Dependency Injection
|
void |
setInsertReaderAdminRoleSQL(String insertReaderAdminRoleSQL)
Used for Spring Dependency Injection
|
void |
setInsertReaderSQL(String insertReaderSQL)
Used for Spring Dependency Injection
|
void |
setInsertUserRoleSQL(String insertUserRoleSQL)
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 |
setSelectAllReadersSQL(String selectAllReadersSQL)
Used for Spring Dependency Injection
|
void |
setSelectReaderAdminRoleSQL(String selectReaderAdminRoleSQL)
Used for Spring Dependency Injection
|
void |
setSelectReaderByDeskPhoneSQL(String selectReaderByDeskPhoneSQL)
Used for Spring Dependency Injection
|
void |
setSelectReaderByFirstLastNameSQL(String selectReaderByFirstLastNameSQL)
Used for Spring Dependency Injection
|
void |
setSelectReaderByIdSQL(String selectReaderByIdSQL)
Used for Spring Dependency Injection
|
void |
setSelectReaderIdByUidSQL(String selectReaderIdByUidSQL)
Used for Spring Dependency Injection
|
void |
setUpdateReaderPasswordSQL(String updateReaderPasswordSQL)
Used for Spring Dependency Injection
|
void |
setUpdateReaderSQL(String updateReaderSQL)
Used for Spring Dependency Injection
|
boolean |
uidExists(String uid)
Checks to see if a Reader uid exists in the database
|
void |
update(Reader reader)
Update Reader in the database, using the UID of the Reader to
locate the database record.
|
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 setUpdateReaderPasswordSQL(String updateReaderPasswordSQL)
public void setSelectReaderByFirstLastNameSQL(String selectReaderByFirstLastNameSQL)
public void setSelectAllReadersSQL(String selectAllReadersSQL)
public void setInsertReaderSQL(String insertReaderSQL)
public void setInsertUserRoleSQL(String insertUserRoleSQL)
public void setSelectReaderIdByUidSQL(String selectReaderIdByUidSQL)
public void setSelectReaderByIdSQL(String selectReaderByIdSQL)
public void setSelectReaderByDeskPhoneSQL(String selectReaderByDeskPhoneSQL)
public void setUpdateReaderSQL(String updateReaderSQL)
public void setDeleteReaderAdminRoleSQL(String deleteReaderAdminRoleSQL)
public void setInsertReaderAdminRoleSQL(String insertReaderAdminRoleSQL)
public void setSelectReaderAdminRoleSQL(String selectReaderAdminRoleSQL)
public void setCrypto(Crypto crypto)
public void insert(Reader reader) throws LibraryException
insert
in interface ReaderDAO
LibraryException
public void update(Reader reader) throws LibraryException
update
in interface ReaderDAO
LibraryException
- if reader is null or contains insufficient datapublic Reader retrieve(Reader rd) throws LibraryException
retrieve
in interface ReaderDAO
LibraryException
public Reader retrieveById(long id) throws LibraryException
retrieveById
in interface ReaderDAO
LibraryException
public Reader retrieveByUid(String uid) throws LibraryException
retrieveByUid
in interface ReaderDAO
LibraryException
public Reader retrieveByPhone(String deskphone) throws LibraryException
retrieveByPhone
in interface ReaderDAO
LibraryException
public Reader retrieveByFirstLastName(String firstName, String lastName) throws LibraryException
LibraryException
public Reader retrieveByGenericCriteria(String sqlString, Object[] criteria) throws LibraryException
sqlString
- - Parameterized SQL querycriteria
- - Query parametersLibraryException
- if an error occurs retrieving the readerpublic boolean uidExists(String uid) throws LibraryException
uidExists
in interface ReaderDAO
uid
- = uid to look forLibraryException
public boolean readerExists(long id) throws LibraryException
readerExists
in interface ReaderDAO
id
- = id to look forLibraryException
public boolean readerExists(String deskphone) throws LibraryException
deskphone
- = deskphone to look forLibraryException
public boolean deskPhoneExists(String deskphone) throws LibraryException
deskPhoneExists
in interface ReaderDAO
deskphone
- = deskphone to look forLibraryException
public boolean readerExists(String firstName, String lastName) throws LibraryException
readerExists
in interface ReaderDAO
firstName
- = reader's first namelastName
- = reader's last nameLibraryException
public ArrayList getReaders() throws LibraryException
getReaders
in interface ReaderDAO
LibraryException
public long getReaderID(String firstName, String lastName) throws LibraryException
getReaderID
in interface ReaderDAO
firstName
- = first name of the readerlastName
- = last name of the readerLibraryException
- if there is no such readerpublic void resetPassword(String user, String newPwd) throws LibraryException
resetPassword
in interface ReaderDAO
user
- = uidnewPwd
- = new passwordLibraryException
- - mostly for DB access, HOWEVER it will not
throw any error if the user does not exist in the DB!Copyright © 2003-2017 The Virtual Library Team. All Rights Reserved.