info.extensiblecatalog.nacm.model.persistence
Class BibliographicRecordDAO

java.lang.Object
  extended by info.extensiblecatalog.nacm.model.persistence.BibliographicRecordDAO

public class BibliographicRecordDAO
extends java.lang.Object

Provides store/find/delete functionality for bibliographic records

Author:
Dean Rzonca

Constructor Summary
BibliographicRecordDAO()
           
 
Method Summary
protected  java.util.List<BibliographicRecord> castList(java.util.List unsafe)
           
 int countUnmatchedRecords()
          Counts the records that have not been processed
 java.util.List<BibliographicRecord> findAllUnmatched()
          Finds all bibliographic records that have NOT been searched against authority records
 java.util.List<BibliographicRecord> findByAuthorityRecord(AuthorityRecord record)
          Finds bibliographic records that correspond to a given authority record
 BibliographicRecord findById(java.lang.Long id)
          Finds the bibliographic record with the given ID
 java.util.List<BibliographicRecord> findByNormalizedAuthor(java.lang.String author)
          Find bibliographic records by author (as entered, not authorized)
 java.util.List<BibliographicRecord> findByNormalizedSubject(java.lang.String subject)
          Find bibliographic records by subject
 java.util.List<BibliographicRecord> findByNormalizedTitle(java.lang.String title)
          Finds bibliographic records by title
 java.util.List<BibliographicRecord> findUnapprovedByConfidence(java.lang.Integer lowThreshold, java.lang.Integer highThreshold)
          Finds all biblioraphic records that have been processed, have a level of confidence within a certain range, and have not been approved
 void remove(BibliographicRecord record)
          Removes a bibliographic record from the database
 void store(BibliographicRecord recordToStore)
          Stores a bibliographic record in the database If the ID is not set (-1), one will be set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BibliographicRecordDAO

public BibliographicRecordDAO()
Method Detail

store

public void store(BibliographicRecord recordToStore)
Stores a bibliographic record in the database If the ID is not set (-1), one will be set

Parameters:
recordToStore - the bibliographic record to store

remove

public void remove(BibliographicRecord record)
Removes a bibliographic record from the database

Parameters:
id - the id of the bibliographic record to remove

findByNormalizedTitle

public java.util.List<BibliographicRecord> findByNormalizedTitle(java.lang.String title)
Finds bibliographic records by title

Parameters:
title - the title to search for
Returns:
All bibliographic records with the specified title

findByNormalizedSubject

public java.util.List<BibliographicRecord> findByNormalizedSubject(java.lang.String subject)
Find bibliographic records by subject

Parameters:
subject - the subject to search for, in normalized form
Returns:
All bibliographic records with the specified subject

findByNormalizedAuthor

public java.util.List<BibliographicRecord> findByNormalizedAuthor(java.lang.String author)
Find bibliographic records by author (as entered, not authorized)

Parameters:
author - the author to search for, in normalized form
Returns:
All bibliographic records with the specified author

findByAuthorityRecord

public java.util.List<BibliographicRecord> findByAuthorityRecord(AuthorityRecord record)
Finds bibliographic records that correspond to a given authority record

Parameters:
record - the authority record to search for
Returns:
All bibliographic records that refer to the given authority record

findAllUnmatched

public java.util.List<BibliographicRecord> findAllUnmatched()
Finds all bibliographic records that have NOT been searched against authority records

Returns:
All unprocessed bibliographic records

findUnapprovedByConfidence

public java.util.List<BibliographicRecord> findUnapprovedByConfidence(java.lang.Integer lowThreshold,
                                                                      java.lang.Integer highThreshold)
Finds all biblioraphic records that have been processed, have a level of confidence within a certain range, and have not been approved

Parameters:
lowThreshold - the minimum confidence level, as a percent (inclusive)
highThreshold - the maximum confidence level, as a percent (inclusive)
Returns:

findById

public BibliographicRecord findById(java.lang.Long id)
                             throws DataAccessException
Finds the bibliographic record with the given ID

Parameters:
id - the ID to search for
Returns:
a bibliographic record
Throws:
DataAccessException - if no record exists with the given ID

countUnmatchedRecords

public int countUnmatchedRecords()
Counts the records that have not been processed

Returns:
the number of unprocessed records

castList

protected java.util.List<BibliographicRecord> castList(java.util.List unsafe)