Package org.dspace.content.dao.impl
Class RelationshipDAOImpl
- java.lang.Object
-
- org.dspace.core.AbstractHibernateDAO<Relationship>
-
- org.dspace.content.dao.impl.RelationshipDAOImpl
-
- All Implemented Interfaces:
RelationshipDAO,GenericDAO<Relationship>
public class RelationshipDAOImpl extends AbstractHibernateDAO<Relationship> implements RelationshipDAO
-
-
Constructor Summary
Constructors Constructor Description RelationshipDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountByItem(Context context, Item item)This method returns a count of Relationship objects that have the given Item object as a leftItem or a rightItemintcountByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, boolean isLeft)Count total number of relationships (rows in relationship table) by an item and a relationship type and a boolean indicating whether the item should be the leftItem or the rightItemintcountByItemAndRelationshipTypeAndList(Context context, UUID focusUUID, RelationshipType relationshipType, List<UUID> items, boolean isLeft)Count total number of relationships that match focusItem on the one hand and matches list of related items elsewhere.intcountByRelationshipType(Context context, RelationshipType relationshipType)Count total number of relationships (rows in relationship table) by a relationship typeintcountByTypeName(Context context, String typeName)Count total number of relationships (rows in relationship table) given a typeNameintcountRows(Context context)Count total number of relationships (rows in relationship table)List<Relationship>findByItem(Context context, Item item, boolean excludeTilted)This method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItemList<Relationship>findByItem(Context context, Item item, Integer limit, Integer offset, boolean excludeTilted)This method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItemList<Relationship>findByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, boolean isLeft, Integer limit, Integer offset)This method returns a list of Relationship objects for the given RelationshipType object.List<Relationship>findByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, Integer limit, Integer offset)This method returns a list of Relationship objects for the given RelationshipType object.List<Relationship>findByItemAndRelationshipTypeAndList(Context context, UUID focusUUID, RelationshipType relationshipType, List<UUID> items, boolean isLeft, int offset, int limit)This method is used to retrieve relationships that match focusItem on the one hand and matches list of related items elsewhere.List<Relationship>findByRelationshipType(Context context, RelationshipType relationshipType)This method returns a list of Relationship objects for the given RelationshipType object.List<Relationship>findByRelationshipType(Context context, RelationshipType relationshipType, Integer limit, Integer offset)This method returns a list of Relationship objects for the given RelationshipType object.List<Relationship>findByTypeName(Context context, String typeName)This method returns a list of Relationship objects for the given typeNameList<Relationship>findByTypeName(Context context, String typeName, Integer limit, Integer offset)This method returns a list of Relationship objects for the given typeNameintfindNextLeftPlaceByLeftItem(Context context, Item item)This method returns the next leftplace integer to use for a relationship with this item as the leftItemintfindNextRightPlaceByRightItem(Context context, Item item)This method returns the next rightplace integer to use for a relationship with this item as the rightItem-
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, 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
-
findByItem
public List<Relationship> findByItem(Context context, Item item, boolean excludeTilted) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItem- Specified by:
findByItemin interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- The item that should be either a leftItem or a rightItem of all the Relationship objects in the returned listexcludeTilted- If true, excludes tilted relationships- Returns:
- The list of Relationship objects that contain either a left or a right item that is equal to the given item
- Throws:
SQLException- If something goes wrong
-
findByItem
public List<Relationship> findByItem(Context context, Item item, Integer limit, Integer offset, boolean excludeTilted) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItem- Specified by:
findByItemin interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- The item that should be either a leftItem or a rightItem of all the Relationship objects in the returned listlimit- paging limitoffset- paging offsetexcludeTilted- If true, excludes tilted relationships- Returns:
- The list of Relationship objects that contain either a left or a right item that is equal to the given item
- Throws:
SQLException- If something goes wrong
-
countByItem
public int countByItem(Context context, Item item) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a count of Relationship objects that have the given Item object as a leftItem or a rightItem- Specified by:
countByItemin interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- The item that should be either a leftItem or a rightItem of all the Relationship objects in the returned list- Returns:
- The list of Relationship objects that contain either a left or a right item that is equal to the given item
- Throws:
SQLException- If something goes wrong
-
findNextLeftPlaceByLeftItem
public int findNextLeftPlaceByLeftItem(Context context, Item item) throws SQLException
Description copied from interface:RelationshipDAOThis method returns the next leftplace integer to use for a relationship with this item as the leftItem- Specified by:
findNextLeftPlaceByLeftItemin interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- The item to be matched on leftItem- Returns:
- The next integer to be used for the leftplace of a relationship with the given item as a left item
- Throws:
SQLException- If something goes wrong
-
findNextRightPlaceByRightItem
public int findNextRightPlaceByRightItem(Context context, Item item) throws SQLException
Description copied from interface:RelationshipDAOThis method returns the next rightplace integer to use for a relationship with this item as the rightItem- Specified by:
findNextRightPlaceByRightItemin interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- The item to be matched on rightItem- Returns:
- The next integer to be used for the rightplace of a relationship with the given item as a right item
- Throws:
SQLException- If something goes wrong
-
findByRelationshipType
public List<Relationship> findByRelationshipType(Context context, RelationshipType relationshipType) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given RelationshipType object. It will construct a list of all Relationship objects that have the given RelationshipType object as the relationshipType property- Specified by:
findByRelationshipTypein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextrelationshipType- The RelationshipType object to be checked on- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
findByRelationshipType
public List<Relationship> findByRelationshipType(Context context, RelationshipType relationshipType, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given RelationshipType object. It will construct a list of all Relationship objects that have the given RelationshipType object as the relationshipType property- Specified by:
findByRelationshipTypein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextrelationshipType- The RelationshipType object to be checked onlimit- paging limitoffset- paging offset- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
findByItemAndRelationshipType
public List<Relationship> findByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given RelationshipType object. It will construct a list of all Relationship objects that have the given RelationshipType object as the relationshipType property- Specified by:
findByItemAndRelationshipTypein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- item to filter byrelationshipType- The RelationshipType object to be checked onlimit- paging limitoffset- paging offset- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
findByItemAndRelationshipType
public List<Relationship> findByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, boolean isLeft, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given RelationshipType object. It will construct a list of all Relationship objects that have the given RelationshipType object as the relationshipType property- Specified by:
findByItemAndRelationshipTypein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contextitem- item to filter byrelationshipType- The RelationshipType object to be checked onisLeft- Is item left or rightlimit- paging limitoffset- paging offset- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
findByTypeName
public List<Relationship> findByTypeName(Context context, String typeName) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given typeName- Specified by:
findByTypeNamein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contexttypeName- The leftward or rightward typeName of the relationship type- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
findByTypeName
public List<Relationship> findByTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException
Description copied from interface:RelationshipDAOThis method returns a list of Relationship objects for the given typeName- Specified by:
findByTypeNamein interfaceRelationshipDAO- Parameters:
context- The relevant DSpace contexttypeName- The leftward or rightward typeName of the relationship typelimit- paging limitoffset- paging offset- Returns:
- A list of Relationship objects that have the given RelationshipType object as the relationshipType property
- Throws:
SQLException- If something goes wrong
-
countByRelationshipType
public int countByRelationshipType(Context context, RelationshipType relationshipType) throws SQLException
Description copied from interface:RelationshipDAOCount total number of relationships (rows in relationship table) by a relationship type- Specified by:
countByRelationshipTypein interfaceRelationshipDAO- Parameters:
context- contextrelationshipType- relationship type to filter by- Returns:
- total count
- Throws:
SQLException- if database error
-
countRows
public int countRows(Context context) throws SQLException
Description copied from interface:RelationshipDAOCount total number of relationships (rows in relationship table)- Specified by:
countRowsin interfaceRelationshipDAO- Parameters:
context- context- Returns:
- total count
- Throws:
SQLException- if database error
-
countByItemAndRelationshipType
public int countByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, boolean isLeft) throws SQLException
Description copied from interface:RelationshipDAOCount total number of relationships (rows in relationship table) by an item and a relationship type and a boolean indicating whether the item should be the leftItem or the rightItem- Specified by:
countByItemAndRelationshipTypein interfaceRelationshipDAO- Parameters:
context- contextitem- item to filter byrelationshipType- relationship type to filter byisLeft- Indicating whether the counted Relationships should have the given Item on the left side or not- Returns:
- total count
- Throws:
SQLException- if database error
-
countByTypeName
public int countByTypeName(Context context, String typeName) throws SQLException
Description copied from interface:RelationshipDAOCount total number of relationships (rows in relationship table) given a typeName- Specified by:
countByTypeNamein interfaceRelationshipDAO- Parameters:
context- contexttypeName- the relationship typeName to filter by- Returns:
- total count
- Throws:
SQLException- if database error
-
findByItemAndRelationshipTypeAndList
public List<Relationship> findByItemAndRelationshipTypeAndList(Context context, UUID focusUUID, RelationshipType relationshipType, List<UUID> items, boolean isLeft, int offset, int limit) throws SQLException
Description copied from interface:RelationshipDAOThis method is used to retrieve relationships that match focusItem on the one hand and matches list of related items elsewhere.- Specified by:
findByItemAndRelationshipTypeAndListin interfaceRelationshipDAO- Parameters:
context- DSpace context objectfocusUUID- UUID of Item that will match left side if the param isLeft is true otherwise right siderelationshipType- Relationship type to filter byitems- List of UUID that will use to filter other side respect the focusUUIDisLeft- Indicating whether the counted Relationships should have the given Item on the left side or notoffset- paging offsetlimit- paging limit- Returns:
- Throws:
SQLException- If database error
-
countByItemAndRelationshipTypeAndList
public int countByItemAndRelationshipTypeAndList(Context context, UUID focusUUID, RelationshipType relationshipType, List<UUID> items, boolean isLeft) throws SQLException
Description copied from interface:RelationshipDAOCount total number of relationships that match focusItem on the one hand and matches list of related items elsewhere.- Specified by:
countByItemAndRelationshipTypeAndListin interfaceRelationshipDAO- Parameters:
context- DSpace context objectfocusUUID- UUID of Item that will match left side if the param isLeft is true otherwise right siderelationshipType- Relationship type to filter byitems- List of UUID that will use to filter other side respect the focusUUIDisLeft- Indicating whether the counted Relationships should have the given Item on the left side or not- Returns:
- Throws:
SQLException- If database error
-
-