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 Modifier Constructor Description protectedResourcePolicyDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountByEPerson(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)voiddeleteByDsoAndTypeNotEqualsTo(Context context, DSpaceObject dso, String type)voiddeleteByDsoEPersonPolicies(Context context, DSpaceObject dso, EPerson ePerson)voiddeleteByDsoGroupPolicies(Context context, DSpaceObject dso, Group group)voiddeleteByGroup(Context context, Group group)List<ResourcePolicy>findByDso(Context context, DSpaceObject dso)List<ResourcePolicy>findByDSoAndAction(Context context, DSpaceObject dso, int actionId)List<ResourcePolicy>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 rpTypeList<ResourcePolicy>findByDsoAndType(Context context, DSpaceObject dso, String type)List<ResourcePolicy>findByEPerson(Context context, EPerson ePerson, int offset, int limit)Return a paginated list of policies that belong to an EPersonList<ResourcePolicy>findByEPersonAndResourceUuid(Context context, EPerson ePerson, UUID resourceUuid, int offset, int limit)Return a paginated list of policies related to a resourceUuid belong to an ePersonList<ResourcePolicy>findByEPersonGroupTypeIdAction(Context context, EPerson e, List<Group> groups, int action, int type_id)List<ResourcePolicy>findByGroup(Context context, Group group)List<ResourcePolicy>findByGroup(Context context, Group group, int offset, int limit)Return a paginated list of policies related to a groupList<ResourcePolicy>findByGroupAndResourceUuid(Context context, Group group, UUID resourceUuid, int offset, int limit)Return a paginated list of policies related to a group and related to a resourceUuidList<ResourcePolicy>findByResouceUuid(Context context, UUID resourceUuid, int offset, int limit)Return a paginated list of policies related to a DSpace resourceList<ResourcePolicy>findByResouceUuidAndActionId(Context context, UUID resourceUuid, int actionId, int offset, int limit)Return a paginated list of policies related to a DSpace resource filter by actionIdList<ResourcePolicy>findByTypeGroupAction(Context context, DSpaceObject dso, Group group, int action)List<ResourcePolicy>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.ResourcePolicyfindOneById(Context context, Integer id)-
Methods inherited from class org.dspace.core.AbstractHibernateDAO
count, count, countLong, create, createQuery, delete, executeCriteriaQuery, findAll, findAll, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.core.GenericDAO
create, delete, findAll, findAll, findByID, findByID, findMany, findUnique, save
-
-
-
-
Method Detail
-
findByDso
public List<ResourcePolicy> findByDso(Context context, DSpaceObject dso) throws SQLException
- 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
-
findByGroup
public List<ResourcePolicy> findByGroup(Context context, Group group) throws SQLException
- 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
-
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
public void deleteByDso(Context context, DSpaceObject dso) throws SQLException
- 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
public void deleteByDsoAndType(Context context, DSpaceObject dso, String type) throws SQLException
- Specified by:
deleteByDsoAndTypein interfaceResourcePolicyDAO- Throws:
SQLException
-
deleteByGroup
public void deleteByGroup(Context context, Group group) throws SQLException
- 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
-
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
public int countByEPerson(Context context, EPerson eperson) throws SQLException
Description copied from interface:ResourcePolicyDAOCount all the resource policies of the ePerson- Specified by:
countByEPersonin interfaceResourcePolicyDAO- Parameters:
context- DSpace context object- 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
public int countByResourceUuid(Context context, UUID resourceUuid) throws SQLException
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
public int countResourcePolicyByGroup(Context context, Group group) throws SQLException
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
public ResourcePolicy findOneById(Context context, Integer id) throws SQLException
- Specified by:
findOneByIdin interfaceResourcePolicyDAO- Throws:
SQLException
-
-