Package org.dspace.eperson.dao
Interface EPersonDAO
- All Superinterfaces:
DSpaceObjectDAO<EPerson>,DSpaceObjectLegacySupportDAO<EPerson>,GenericDAO<EPerson>
- All Known Implementing Classes:
EPersonDAOImpl
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 Summary
Modifier and TypeMethodDescriptionintcountByGroups(Context context, Set<Group> groups) Count total number of EPersons who are a member of one or more of the listed groups.intfindAll(Context context, MetadataField metadataFieldSort, String sortColumn, int pageSize, int offset) findAllSubscribers(Context context) findByEmail(Context context, String email) findByGroups(Context context, Set<Group> groups, int pageSize, int offset) Find all EPersons who are a member of one or more of the listed groups in a paginated fashion.findByNetid(Context context, String netid) findNotActiveSince(Context context, Instant date) search(Context context, String query, List<MetadataField> queryFields, List<MetadataField> sortFields, int offset, int limit) Search all EPersons by the given MetadataField objects, sorting by the given sort fields.searchNotMember(Context context, String query, List<MetadataField> queryFields, Group excludeGroup, List<MetadataField> sortFields, int offset, int limit) Search all EPersons via their firstname, lastname, email (fuzzy match), limited to those EPersons which are NOT a member of the given group.intsearchNotMemberCount(Context context, String query, List<MetadataField> queryFields, Group excludeGroup) Count number of EPersons that match a given search (fuzzy match) across firstname, lastname and email.intsearchResultCount(Context context, String query, List<MetadataField> queryFields) Count number of EPersons who match a search on the given metadata fields.Methods inherited from interface org.dspace.content.dao.DSpaceObjectLegacySupportDAO
findByLegacyId
-
Method Details
-
findByEmail
- Throws:
SQLException
-
findByNetid
- 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 contextquery- the text to search EPersons forqueryFields- the metadata fields to search within (email is also included automatically)sortFields- the metadata field(s) to sort the results byoffset- the position of the first result to returnlimit- 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 contextquery- the text to search EPersons forqueryFields- 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 contextquery- the text to search EPersons forqueryFields- 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 returnlimit- 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 contextquery- 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 Contextgroups- Set of group(s) to check membership inpageSize- number of EPerson objects to load at one time. Set to <=0 to disable paginationoffset- 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
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 Contextgroups- 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
- Throws:
SQLException
-
findNotActiveSince
- Throws:
SQLException
-
findAll
List<EPerson> findAll(Context context, MetadataField metadataFieldSort, String sortColumn, int pageSize, int offset) throws SQLException - Throws:
SQLException
-
findAllSubscribers
- Throws:
SQLException
-
countRows
- Throws:
SQLException
-