Class RelationshipDAOImpl

    • Constructor Detail

      • RelationshipDAOImpl

        public RelationshipDAOImpl()
    • Method Detail

      • findByItem

        public List<Relationship> findByItem​(Context context,
                                             Item item)
                                      throws SQLException
        Description copied from interface: RelationshipDAO
        This method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItem
        Specified by:
        findByItem in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - 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
      • findByItem

        public List<Relationship> findByItem​(Context context,
                                             Item item,
                                             Integer limit,
                                             Integer offset)
                                      throws SQLException
        Description copied from interface: RelationshipDAO
        This method returns a list of Relationship objects that have the given Item object as a leftItem or a rightItem
        Specified by:
        findByItem in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - The item that should be either a leftItem or a rightItem of all the Relationship objects in the returned list
        limit - paging limit
        offset - paging offset
        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: RelationshipDAO
        This method returns a count of Relationship objects that have the given Item object as a leftItem or a rightItem
        Specified by:
        countByItem in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - 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: RelationshipDAO
        This method returns the next leftplace integer to use for a relationship with this item as the leftItem
        Specified by:
        findNextLeftPlaceByLeftItem in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - 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: RelationshipDAO
        This method returns the next rightplace integer to use for a relationship with this item as the rightItem
        Specified by:
        findNextRightPlaceByRightItem in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - 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: RelationshipDAO
        This 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:
        findByRelationshipType in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        relationshipType - 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: RelationshipDAO
        This 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:
        findByRelationshipType in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        relationshipType - The RelationshipType object to be checked on
        limit - paging limit
        offset - 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: RelationshipDAO
        This 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:
        findByItemAndRelationshipType in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - item to filter by
        relationshipType - The RelationshipType object to be checked on
        limit - paging limit
        offset - 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: RelationshipDAO
        This 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:
        findByItemAndRelationshipType in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        item - item to filter by
        relationshipType - The RelationshipType object to be checked on
        isLeft - Is item left or right
        limit - paging limit
        offset - 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: RelationshipDAO
        This method returns a list of Relationship objects for the given typeName
        Specified by:
        findByTypeName in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        typeName - 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: RelationshipDAO
        This method returns a list of Relationship objects for the given typeName
        Specified by:
        findByTypeName in interface RelationshipDAO
        Parameters:
        context - The relevant DSpace context
        typeName - The leftward or rightward typeName of the relationship type
        limit - paging limit
        offset - paging offset
        Returns:
        A list of Relationship objects that have the given RelationshipType object as the relationshipType property
        Throws:
        SQLException - If something goes wrong
      • countByItemAndRelationshipType

        public int countByItemAndRelationshipType​(Context context,
                                                  Item item,
                                                  RelationshipType relationshipType)
                                           throws SQLException
        Description copied from interface: RelationshipDAO
        Count total number of relationships (rows in relationship table) by an item and a relationship type
        Specified by:
        countByItemAndRelationshipType in interface RelationshipDAO
        Parameters:
        context - context
        item - item to filter by
        relationshipType - relationship type to filter by
        Returns:
        total count
        Throws:
        SQLException - if database error
      • countByTypeName

        public int countByTypeName​(Context context,
                                   String typeName)
                            throws SQLException
        Description copied from interface: RelationshipDAO
        Count total number of relationships (rows in relationship table) given a typeName
        Specified by:
        countByTypeName in interface RelationshipDAO
        Parameters:
        context - context
        typeName - the relationship typeName to filter by
        Returns:
        total count
        Throws:
        SQLException - if database error