Interface EPersonDAO

All Superinterfaces:
DSpaceObjectDAO<EPerson>, DSpaceObjectLegacySupportDAO<EPerson>, GenericDAO<EPerson>
All Known Implementing Classes:
EPersonDAOImpl

public interface EPersonDAO extends DSpaceObjectDAO<EPerson>, DSpaceObjectLegacySupportDAO<EPerson>
Database Access Object interface class for the EPerson object. The implementation of this class is responsible for all database calls for the EPerson object and is autowired by spring This class should only be accessed from a single service and should never be exposed outside of the API
Author:
kevinvandevelde at atmire.com
  • Method Details

    • findByEmail

      EPerson findByEmail(Context context, String email) throws SQLException
      Throws:
      SQLException
    • findByNetid

      EPerson findByNetid(Context context, String netid) throws SQLException
      Throws:
      SQLException
    • search

      List<EPerson> search(Context context, String query, List<MetadataField> queryFields, List<MetadataField> sortFields, int offset, int limit) throws SQLException
      Search all EPersons by the given MetadataField objects, sorting by the given sort fields.

      NOTE: As long as a query is specified, the EPerson's email address is included in the search alongside any given metadata fields.

      Parameters:
      context - DSpace context
      query - the text to search EPersons for
      queryFields - the metadata fields to search within (email is also included automatically)
      sortFields - the metadata field(s) to sort the results by
      offset - the position of the first result to return
      limit - how many results return
      Returns:
      List of matching EPerson objects
      Throws:
      SQLException - if an error occurs
    • searchResultCount

      int searchResultCount(Context context, String query, List<MetadataField> queryFields) throws SQLException
      Count number of EPersons who match a search on the given metadata fields. This returns the count of total results for the same query using the 'search()', and therefore can be used to provide pagination.
      Parameters:
      context - DSpace context
      query - the text to search EPersons for
      queryFields - the metadata fields to search within (email is also included automatically)
      Returns:
      total number of EPersons who match the query
      Throws:
      SQLException - if an error occurs
    • searchNotMember

      List<EPerson> searchNotMember(Context context, String query, List<MetadataField> queryFields, Group excludeGroup, List<MetadataField> sortFields, int offset, int limit) throws SQLException
      Search all EPersons via their firstname, lastname, email (fuzzy match), limited to those EPersons which are NOT a member of the given group. This may be used to search across EPersons which are valid to add as members to the given group.
      Parameters:
      context - The DSpace context
      query - the text to search EPersons for
      queryFields - the metadata fields to search within (email is also included automatically)
      excludeGroup - Group to exclude results from. Members of this group will never be returned.
      offset - the position of the first result to return
      limit - how many results return
      Returns:
      EPersons matching the query (which are not members of the given group)
      Throws:
      SQLException - if database error
    • searchNotMemberCount

      int searchNotMemberCount(Context context, String query, List<MetadataField> queryFields, Group excludeGroup) throws SQLException
      Count number of EPersons that match a given search (fuzzy match) across firstname, lastname and email. This search is limited to those EPersons which are NOT a member of the given group. This may be used (with searchNotMember()) to perform a paginated search across EPersons which are valid to add to the given group.
      Parameters:
      context - The DSpace context
      query - querystring to fuzzy match against.
      queryFields - the metadata fields to search within (email is also included automatically)
      excludeGroup - Group to exclude results from. Members of this group will never be returned.
      Returns:
      Groups matching the query (which are not members of the given parent)
      Throws:
      SQLException - if database error
    • findByGroups

      List<EPerson> findByGroups(Context context, Set<Group> groups, int pageSize, int offset) throws SQLException
      Find all EPersons who are a member of one or more of the listed groups in a paginated fashion. This returns EPersons ordered by UUID.
      Parameters:
      context - current Context
      groups - Set of group(s) to check membership in
      pageSize - number of EPerson objects to load at one time. Set to <=0 to disable pagination
      offset - number of page to load (starting with 1). Set to <=0 to disable pagination
      Returns:
      List of all EPersons who are a member of one or more groups.
      Throws:
      SQLException
    • countByGroups

      int countByGroups(Context context, Set<Group> groups) throws SQLException
      Count total number of EPersons who are a member of one or more of the listed groups. This provides the total number of results to expect from corresponding findByGroups() for pagination purposes.
      Parameters:
      context - current Context
      groups - Set of group(s) to check membership in
      Returns:
      total number of (unique) EPersons who are a member of one or more groups.
      Throws:
      SQLException
    • findWithPasswordWithoutDigestAlgorithm

      List<EPerson> findWithPasswordWithoutDigestAlgorithm(Context context) throws SQLException
      Throws:
      SQLException
    • findNotActiveSince

      List<EPerson> findNotActiveSince(Context context, Instant date) throws SQLException
      Throws:
      SQLException
    • findAll

      List<EPerson> findAll(Context context, MetadataField metadataFieldSort, String sortColumn, int pageSize, int offset) throws SQLException
      Throws:
      SQLException
    • findAllSubscribers

      List<EPerson> findAllSubscribers(Context context) throws SQLException
      Throws:
      SQLException
    • countRows

      int countRows(Context context) throws SQLException
      Throws:
      SQLException