Package org.dspace.content.dao
Interface ItemDAO
-
- All Superinterfaces:
DSpaceObjectDAO<Item>,DSpaceObjectLegacySupportDAO<Item>,GenericDAO<Item>
- All Known Implementing Classes:
ItemDAOImpl
public interface ItemDAO extends DSpaceObjectLegacySupportDAO<Item>
Database Access Object interface class for the Item object. The implementation of this class is responsible for all database calls for the Item 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountArchivedByCollectionExcludingOwning(Context context, Collection collection)Counts all the items that are archived and for which the given Collection is part of the Item's Collections but it is not the owning CollectionintcountItems(Context context, boolean includeArchived, boolean includeWithdrawn)Count number of items based on specific status flagsintcountItems(Context context, List<Collection> collections, boolean includeArchived, boolean includeWithdrawn)Count number of unique items across several collections at once.intcountItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn)Count number of items in a given collectionintcountItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn)Count number of items from the specified submitter based on specific status flagsintcountRows(Context context)Count total number of items (rows in item table)Iterator<Item>findAll(Context context, boolean archived)Iterator<Item>findAll(Context context, boolean archived, boolean withdrawn)Iterator<Item>findAll(Context context, boolean archived, boolean withdrawn, boolean discoverable, Date lastModified)Get all Items installed or withdrawn, discoverable, and modified since a Date.Iterator<Item>findAll(Context context, boolean archived, int limit, int offset)Iterator<Item>findAllByCollection(Context context, Collection collection)Iterator<Item>findAllByCollection(Context context, Collection collection, Integer limit, Integer offset)Iterator<Item>findArchivedByCollection(Context context, Collection collection, Integer limit, Integer offset)Iterator<Item>findArchivedByCollectionExcludingOwning(Context context, Collection collection, Integer limit, Integer offset)Returns all the Items in an iterator that are archived and for which the given Collection is part of the Item's Collections but it is not the owning collectionIterator<Item>findByAuthorityValue(Context context, MetadataField metadataField, String authority, boolean inArchive)Iterator<Item>findByLastModifiedSince(Context context, Date since)Find all Items modified since a Date.Iterator<Item>findByMetadataField(Context context, MetadataField metadataField, String value, boolean inArchive)Iterator<Item>findByMetadataQuery(Context context, List<List<MetadataField>> listFieldList, List<String> query_op, List<String> query_val, List<UUID> collectionUuids, String regexClause, int offset, int limit)Iterator<Item>findBySubmitter(Context context, EPerson eperson)Iterator<Item>findBySubmitter(Context context, EPerson eperson, boolean retrieveAllItems)Find all the items by a given submitter.Iterator<Item>findBySubmitter(Context context, EPerson eperson, MetadataField metadataField, int limit)-
Methods inherited from interface org.dspace.content.dao.DSpaceObjectLegacySupportDAO
findByLegacyId
-
Methods inherited from interface org.dspace.core.GenericDAO
create, delete, findAll, findAll, findByID, findByID, findMany, findUnique, save
-
-
-
-
Method Detail
-
findAll
Iterator<Item> findAll(Context context, boolean archived) throws SQLException
- Throws:
SQLException
-
findAll
Iterator<Item> findAll(Context context, boolean archived, int limit, int offset) throws SQLException
- Throws:
SQLException
-
findAll
Iterator<Item> findAll(Context context, boolean archived, boolean withdrawn) throws SQLException
- Throws:
SQLException
-
findByLastModifiedSince
Iterator<Item> findByLastModifiedSince(Context context, Date since) throws SQLException
Find all Items modified since a Date.- Parameters:
context- Contextsince- Earliest interesting last-modified date.- Returns:
- iterator over items
- Throws:
SQLException- if database error
-
findBySubmitter
Iterator<Item> findBySubmitter(Context context, EPerson eperson) throws SQLException
- Throws:
SQLException
-
findBySubmitter
Iterator<Item> findBySubmitter(Context context, EPerson eperson, boolean retrieveAllItems) throws SQLException
Find all the items by a given submitter. The order is indeterminate. All items are included.- Parameters:
context- DSpace context objecteperson- the submitterretrieveAllItems- flag to determine if only archive should be returned- Returns:
- an iterator over the items submitted by eperson
- Throws:
SQLException- if database error
-
findBySubmitter
Iterator<Item> findBySubmitter(Context context, EPerson eperson, MetadataField metadataField, int limit) throws SQLException
- Throws:
SQLException
-
findByMetadataField
Iterator<Item> findByMetadataField(Context context, MetadataField metadataField, String value, boolean inArchive) throws SQLException
- Throws:
SQLException
-
findByMetadataQuery
Iterator<Item> findByMetadataQuery(Context context, List<List<MetadataField>> listFieldList, List<String> query_op, List<String> query_val, List<UUID> collectionUuids, String regexClause, int offset, int limit) throws SQLException
- Throws:
SQLException
-
findByAuthorityValue
Iterator<Item> findByAuthorityValue(Context context, MetadataField metadataField, String authority, boolean inArchive) throws SQLException
- Throws:
SQLException
-
findArchivedByCollection
Iterator<Item> findArchivedByCollection(Context context, Collection collection, Integer limit, Integer offset) throws SQLException
- Throws:
SQLException
-
findArchivedByCollectionExcludingOwning
Iterator<Item> findArchivedByCollectionExcludingOwning(Context context, Collection collection, Integer limit, Integer offset) throws SQLException
Returns all the Items in an iterator that are archived and for which the given Collection is part of the Item's Collections but it is not the owning collection- Parameters:
context- The relevant DSpace contextcollection- The collection to check onlimit- The limit for the queryoffset- The offset for the query- Returns:
- An iterator containing the items for which the constraints hold true
- Throws:
SQLException- If something goes wrong
-
countArchivedByCollectionExcludingOwning
int countArchivedByCollectionExcludingOwning(Context context, Collection collection) throws SQLException
Counts all the items that are archived and for which the given Collection is part of the Item's Collections but it is not the owning Collection- Parameters:
context- The relevant DSpace contextcollection- The collection to check on- Returns:
- The total amount of items that fit the constraints
- Throws:
SQLException- If something goes wrong
-
findAllByCollection
Iterator<Item> findAllByCollection(Context context, Collection collection) throws SQLException
- Throws:
SQLException
-
findAllByCollection
Iterator<Item> findAllByCollection(Context context, Collection collection, Integer limit, Integer offset) throws SQLException
- Throws:
SQLException
-
countItems
int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn) throws SQLException
Count number of items in a given collection- Parameters:
context- contextcollection- the collectionincludeArchived- whether to include archived items in countincludeWithdrawn- whether to include withdrawn items in count- Returns:
- item count
- Throws:
SQLException- if database error
-
countItems
int countItems(Context context, List<Collection> collections, boolean includeArchived, boolean includeWithdrawn) throws SQLException
Count number of unique items across several collections at once. This method can be used withCommunityService.getAllCollections(Context, Community)to determine the unique number of items in a Community.- Parameters:
context- contextcollections- the list of collectionsincludeArchived- whether to include archived items in countincludeWithdrawn- whether to include withdrawn items in count- Returns:
- item count
- Throws:
SQLException- if database error
-
findAll
Iterator<Item> findAll(Context context, boolean archived, boolean withdrawn, boolean discoverable, Date lastModified) throws SQLException
Get all Items installed or withdrawn, discoverable, and modified since a Date.- Parameters:
context- contextarchived- whether to find archivedwithdrawn- whether to find withdrawndiscoverable- whether to find discoverablelastModified- earliest interesting last-modified date.- Returns:
- iterator over items
- Throws:
SQLException- if database error
-
countRows
int countRows(Context context) throws SQLException
Count total number of items (rows in item table)- Parameters:
context- context- Returns:
- total count
- Throws:
SQLException- if database error
-
countItems
int countItems(Context context, boolean includeArchived, boolean includeWithdrawn) throws SQLException
Count number of items based on specific status flags- Parameters:
context- contextincludeArchived- whether to include archived items in countincludeWithdrawn- whether to include withdrawn items in count- Returns:
- count of items
- Throws:
SQLException- if database error
-
countItems
int countItems(Context context, EPerson submitter, boolean includeArchived, boolean includeWithdrawn) throws SQLException
Count number of items from the specified submitter based on specific status flags- Parameters:
context- contextsubmitter- the submitterincludeArchived- whether to include archived items in countincludeWithdrawn- whether to include withdrawn items in count- Returns:
- count of items
- Throws:
SQLException- if database error
-
-