Package org.dspace.authorize.dao.impl
Class ResourcePolicyDAOImpl
java.lang.Object
org.dspace.core.AbstractHibernateDAO<ResourcePolicy>
org.dspace.authorize.dao.impl.ResourcePolicyDAOImpl
- All Implemented Interfaces:
ResourcePolicyDAO,GenericDAO<ResourcePolicy>
public class ResourcePolicyDAOImpl
extends AbstractHibernateDAO<ResourcePolicy>
implements ResourcePolicyDAO
Hibernate implementation of the Database Access Object interface class for the ResourcePolicy object.
This class is responsible for all database calls for the ResourcePolicy object and is autowired by spring
This class should never be accessed directly.
- Author:
- kevinvandevelde at atmire.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountByEPerson(Context context, EPerson ePerson) Count all the resource policies of the ePersonintcountByEPersonAndResourceUuid(Context context, EPerson eperson, UUID resourceUuid) Count all the policies related to a resourceUuid belong to an ePersonintcountByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid) Count all the resource policies of the group and of the resourceUuidintcountByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId) Count all the policies related to a resourceUuid and actionIdintcountByResourceUuid(Context context, UUID resourceUuid) Count all the policies by resourceUuidintcountResourcePolicyByGroup(Context context, Group group) Count all the resource policies of the groupvoiddeleteByDso(Context context, DSpaceObject dso) voiddeleteByDsoAndAction(Context context, DSpaceObject dso, int actionId) voiddeleteByDsoAndType(Context context, DSpaceObject dso, String type) voiddeleteByDsoAndTypeAndAction(Context context, DSpaceObject dso, String type, int actionId) voiddeleteByDsoAndTypeNotEqualsTo(Context context, DSpaceObject dso, String type) voiddeleteByDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) voiddeleteByDsoGroupPolicies(Context context, DSpaceObject dso, Group group) voiddeleteByEPerson(Context context, EPerson ePerson) Deletes all policies that belong to an EPersonvoiddeleteByGroup(Context context, Group group) findByDso(Context context, DSpaceObject dso) findByDSoAndAction(Context context, DSpaceObject dso, int actionId) findByDSoAndActionExceptRpType(Context context, DSpaceObject dso, int action, String rpType) Return a list of policies for an object that match the action except the record labeled with the rpTypefindByDsoAndType(Context context, DSpaceObject dso, String type) findByEPerson(Context context, EPerson ePerson) findByEPerson(Context context, EPerson ePerson, int offset, int limit) Return a paginated list of policies that belong to an EPersonfindByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a resourceUuid belong to an ePersonfindByEPersonGroupTypeIdAction(Context context, EPerson e, List<Group> groups, int action, int type_id) findByGroup(Context context, Group group) findByGroup(Context context, Group group, int offset, int limit) Return a paginated list of policies related to a groupfindByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a group and related to a resourceUuidfindByResouceUuid(Context context, UUID resourceUuid, int offset, int limit) Return a paginated list of policies related to a DSpace resourcefindByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId, int offset, int limit) Return a paginated list of policies related to a DSpace resource filter by actionIdfindByTypeGroupAction(Context context, DSpaceObject dso, Group group, int action) findByTypeGroupActionExceptId(Context context, DSpaceObject dso, Group group, int action, int notPolicyID) Look for ResourcePolicies by DSpaceObject, Group, and action, ignoring IDs with a specific PolicyID.findOneById(Context context, Integer id) Methods inherited from class org.dspace.core.AbstractHibernateDAO
count, count, countLong, create, createQuery, createQuery, delete, executeCriteriaQuery, findAll, findAll, findByID, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResult
-
Constructor Details
-
ResourcePolicyDAOImpl
protected ResourcePolicyDAOImpl()
-
-
Method Details
-
findByDso
- Specified by:
findByDsoin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByDsoAndType
public List<ResourcePolicy> findByDsoAndType(Context context, DSpaceObject dso, String type) throws SQLException - Specified by:
findByDsoAndTypein interfaceResourcePolicyDAO- Throws:
SQLException
-
findByEPerson
- Specified by:
findByEPersonin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByGroup
- Specified by:
findByGroupin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByDSoAndAction
public List<ResourcePolicy> findByDSoAndAction(Context context, DSpaceObject dso, int actionId) throws SQLException - Specified by:
findByDSoAndActionin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDsoAndTypeAndAction
public void deleteByDsoAndTypeAndAction(Context context, DSpaceObject dso, String type, int actionId) throws SQLException - Specified by:
deleteByDsoAndTypeAndActionin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByTypeGroupAction
public List<ResourcePolicy> findByTypeGroupAction(Context context, DSpaceObject dso, Group group, int action) throws SQLException - Specified by:
findByTypeGroupActionin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByTypeGroupActionExceptId
public List<ResourcePolicy> findByTypeGroupActionExceptId(Context context, DSpaceObject dso, Group group, int action, int notPolicyID) throws SQLException Description copied from interface:ResourcePolicyDAOLook for ResourcePolicies by DSpaceObject, Group, and action, ignoring IDs with a specific PolicyID. This method can be used to detect duplicate ResourcePolicies.- Specified by:
findByTypeGroupActionExceptIdin interfaceResourcePolicyDAOnotPolicyID- ResourcePolicies with this ID will be ignored while looking out for equal ResourcePolicies.- Returns:
- List of resource policies for the same DSpaceObject, group and action but other policyID.
- Throws:
SQLException
-
findByEPersonGroupTypeIdAction
public List<ResourcePolicy> findByEPersonGroupTypeIdAction(Context context, EPerson e, List<Group> groups, int action, int type_id) throws SQLException - Specified by:
findByEPersonGroupTypeIdActionin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDso
- Specified by:
deleteByDsoin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDsoAndAction
public void deleteByDsoAndAction(Context context, DSpaceObject dso, int actionId) throws SQLException - Specified by:
deleteByDsoAndActionin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDsoAndType
- Specified by:
deleteByDsoAndTypein interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByGroup
- Specified by:
deleteByGroupin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDsoGroupPolicies
public void deleteByDsoGroupPolicies(Context context, DSpaceObject dso, Group group) throws SQLException - Specified by:
deleteByDsoGroupPoliciesin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByDsoEPersonPolicies
public void deleteByDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson) throws SQLException - Specified by:
deleteByDsoEPersonPoliciesin interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByEPerson
Description copied from interface:ResourcePolicyDAODeletes all policies that belong to an EPerson- Specified by:
deleteByEPersonin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectePerson- ePerson whose policies to delete- Throws:
SQLException- if database error
-
deleteByDsoAndTypeNotEqualsTo
public void deleteByDsoAndTypeNotEqualsTo(Context context, DSpaceObject dso, String type) throws SQLException - Specified by:
deleteByDsoAndTypeNotEqualsToin interfaceResourcePolicyDAO- Throws:
SQLException
-
findByDSoAndActionExceptRpType
public List<ResourcePolicy> findByDSoAndActionExceptRpType(Context context, DSpaceObject dso, int action, String rpType) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a list of policies for an object that match the action except the record labeled with the rpType- Specified by:
findByDSoAndActionExceptRpTypein interfaceResourcePolicyDAO- Parameters:
context- contextdso- DSpaceObject policies relate toaction- action (defined in class Constants)rpType- the resource policy type- Returns:
- list of resource policies
- Throws:
SQLException- if there's a database problem
-
findByEPerson
public List<ResourcePolicy> findByEPerson(Context context, EPerson ePerson, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies that belong to an EPerson- Specified by:
findByEPersonin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to findoffset- the position of the first result to returnlimit- paging limit- Throws:
SQLException- if database error
-
countByEPerson
Description copied from interface:ResourcePolicyDAOCount all the resource policies of the ePerson- Specified by:
countByEPersonin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to count- Returns:
- total resource policies of the ePerson
- Throws:
SQLException- if database error
-
findByEPersonAndResourceUuid
public List<ResourcePolicy> findByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies related to a resourceUuid belong to an ePerson- Specified by:
findByEPersonAndResourceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectePerson- ePerson whose policies want to findresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByEPersonAndResourceUuid
public int countByEPersonAndResourceUuid(Context context, EPerson eperson, UUID resourceUuid) throws SQLException Description copied from interface:ResourcePolicyDAOCount all the policies related to a resourceUuid belong to an ePerson- Specified by:
countByEPersonAndResourceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objecteperson- ePerson whose policies want to findresourceUuid- the uuid of an DSpace resource- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByResouceUuidAndActionId
public List<ResourcePolicy> findByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies related to a DSpace resource filter by actionId- Specified by:
findByResouceUuidAndActionIdin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceactionId- id relative to action as READ, WRITE, DELITE etc.offset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByResouceUuidAndActionId
public int countByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId) throws SQLException Description copied from interface:ResourcePolicyDAOCount all the policies related to a resourceUuid and actionId- Specified by:
countByResouceUuidAndActionIdin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceactionId- id relative to action as READ, WRITE, DELITE etc.- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByResouceUuid
public List<ResourcePolicy> findByResouceUuid(Context context, UUID resourceUuid, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies related to a DSpace resource- Specified by:
findByResouceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByResourceUuid
Description copied from interface:ResourcePolicyDAOCount all the policies by resourceUuid- Specified by:
countByResourceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectresourceUuid- the uuid of an DSpace resource- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByGroup
public List<ResourcePolicy> findByGroup(Context context, Group group, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies related to a group- Specified by:
findByGroupin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectgroup- DSpace groupoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countResourcePolicyByGroup
Description copied from interface:ResourcePolicyDAOCount all the resource policies of the group- Specified by:
countResourcePolicyByGroupin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectgroup- DSpace group- Returns:
- total policies
- Throws:
SQLException- if database error
-
findByGroupAndResourceUuid
public List<ResourcePolicy> findByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid, int offset, int limit) throws SQLException Description copied from interface:ResourcePolicyDAOReturn a paginated list of policies related to a group and related to a resourceUuid- Specified by:
findByGroupAndResourceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectgroup- DSpace groupresourceUuid- the uuid of an DSpace resourceoffset- the position of the first result to returnlimit- paging limit- Returns:
- list of resource policies
- Throws:
SQLException- if database error
-
countByGroupAndResourceUuid
public int countByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid) throws SQLException Description copied from interface:ResourcePolicyDAOCount all the resource policies of the group and of the resourceUuid- Specified by:
countByGroupAndResourceUuidin interfaceResourcePolicyDAO- Parameters:
context- DSpace context objectgroup- DSpace groupresourceUuid- the uuid of an DSpace resource- Returns:
- total policies
- Throws:
SQLException- if database error
-
findOneById
- Specified by:
findOneByIdin interfaceResourcePolicyDAO- Throws:
SQLException
-