Package org.dspace.app.rest.repository
Class DSpaceObjectRestRepository<M extends DSpaceObject,R extends DSpaceObjectRest>
java.lang.Object
org.dspace.app.rest.repository.AbstractDSpaceRestRepository
org.dspace.app.rest.repository.DSpaceRestRepository<R,UUID>
org.dspace.app.rest.repository.DSpaceObjectRestRepository<M,R>
- Type Parameters:
M- the specific type of DSpaceObject.R- the corresponding DSpaceObjectRest.
- All Implemented Interfaces:
ReloadableEntityObjectRepository<M,,UUID> Aware,BeanNameAware,org.springframework.data.repository.CrudRepository<R,,UUID> org.springframework.data.repository.PagingAndSortingRepository<R,,UUID> org.springframework.data.repository.Repository<R,UUID>
- Direct Known Subclasses:
BitstreamRestRepository,BundleRestRepository,CollectionRestRepository,CommunityRestRepository,EPersonRestRepository,GroupRestRepository,ItemRestRepository,SiteRestRepository
public abstract class DSpaceObjectRestRepository<M extends DSpaceObject,R extends DSpaceObjectRest>
extends DSpaceRestRepository<R,UUID>
implements ReloadableEntityObjectRepository<M,UUID>
Base class for DSpaceObject-based Rest Repositories, providing common functionality.
-
Field Summary
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils -
Method Summary
Modifier and TypeMethodDescriptionfindDomainObjectByPk(Context context, UUID uuid) protected voidpatchDSpaceObject(String apiCategory, String model, UUID id, Patch patch) Updates the DSpaceObject according to the given Patch.Methods inherited from class org.dspace.app.rest.repository.DSpaceRestRepository
action, action, count, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, delete, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAll, findAll, findAll, findAllById, findById, findOne, getDomainClass, patch, patch, put, put, put, put, save, save, saveAll, setBeanName, upload, upload, uploadMethods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContext
-
Method Details
-
patchDSpaceObject
protected void patchDSpaceObject(String apiCategory, String model, UUID id, Patch patch) throws AuthorizeException, org.springframework.data.rest.webmvc.ResourceNotFoundException, SQLException, UnprocessableEntityException Updates the DSpaceObject according to the given Patch.- Parameters:
apiCategory- the api category.model- the api model.id- the id of the DSpaceObject.patch- the patch to apply.- Throws:
AuthorizeException- if the action is unauthorized.org.springframework.data.rest.webmvc.ResourceNotFoundException- if the DSpace object was not found.SQLException- if a database error occurs.UnprocessableEntityException- if the patch attempts to modify an unmodifiable attribute of the object.
-
findDomainObjectByPk
- Specified by:
findDomainObjectByPkin interfaceReloadableEntityObjectRepository<M extends DSpaceObject,R extends DSpaceObjectRest> - Parameters:
context- the DSpace contextuuid- the primary key shared between the rest and dspace api object- Returns:
- the dspace api model object related to the specified id
- Throws:
SQLException- if a database error occurs
-
getPKClass
- Specified by:
getPKClassin interfaceReloadableEntityObjectRepository<M extends DSpaceObject,R extends DSpaceObjectRest> - Returns:
- the class of the primary key
-