Interface RelationshipTypeService

All Superinterfaces:
DSpaceCRUDService<RelationshipType>
All Known Implementing Classes:
RelationshipTypeServiceImpl

public interface RelationshipTypeService extends DSpaceCRUDService<RelationshipType>
This Service uses DAOs to access information on the database objects for the RelationshipTypes
  • Method Details

    • create

      RelationshipType create(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException
      This method creates the given RelationshipType object in the database and returns it
      Parameters:
      context - The relevant DSpace context
      relationshipType - The RelationshipType to be created in the database
      Returns:
      The newly created RelationshipType
      Throws:
      SQLException - If something goes wrong
      AuthorizeException - If something goes wrong with authorizations
    • findbyTypesAndTypeName

      RelationshipType findbyTypesAndTypeName(Context context, EntityType leftType, EntityType rightType, String leftwardType, String rightwardType) throws SQLException
      Retrieves a RelationshipType for which the given parameters all match the one in the returned RelationshipType
      Parameters:
      context - The relevant DSpace context
      leftType - The rightType EntityType that needs to match for the returned RelationshipType
      rightType - The rightType EntityType that needs to match for the returned RelationshipType
      leftwardType - The leftwardType String that needs to match for the returned RelationshipType
      rightwardType - The rightwardType String that needs to match for the returned RelationshipType
      Returns:
      Throws:
      SQLException - If something goes wrong
    • findAll

      List<RelationshipType> findAll(Context context) throws SQLException
      Retrieves all RelationshipType objects currently in the system
      Parameters:
      context - The relevant DSpace context
      Returns:
      The list of all RelationshipType objects currently in the system
      Throws:
      SQLException - If something goes wrong
    • findAll

      List<RelationshipType> findAll(Context context, Integer limit, Integer offset) throws SQLException
      Retrieves all RelationshipType objects currently in the system
      Parameters:
      context - The relevant DSpace context
      limit - paging limit
      offset - paging offset
      Returns:
      The list of all RelationshipType objects currently in the system
      Throws:
      SQLException - If something goes wrong
    • findByLeftwardOrRightwardTypeName

      List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName) throws SQLException
      Retrieves all RelationshipType objects that have a left or right type that is equal to the given String
      Parameters:
      context - The relevant DSpace context
      typeName - The label that has to match
      Returns:
      The list of all RelationshipType objects that have a left or right label that is equal to the given label param
      Throws:
      SQLException - If something goes wrong
    • findByLeftwardOrRightwardTypeName

      List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException
      Retrieves all RelationshipType objects that have a left or right label that is equal to the given String
      Parameters:
      context - The relevant DSpace context
      typeName - The typeName that has to match
      limit - paging limit
      offset - paging offset
      Returns:
      The list of all RelationshipType objects that have a left or right label that is equal to the given label param
      Throws:
      SQLException - If something goes wrong
    • findByEntityType

      List<RelationshipType> findByEntityType(Context context, EntityType entityType) throws SQLException
      Returns a list of RelationshipType objects for which the given EntityType is equal to either the leftType or the rightType
      Parameters:
      context - The relevant DSpace context
      entityType - The EntityType object used to check the leftType and rightType properties
      Returns:
      A list of RelationshipType objects for which the leftType or rightType property are equal to the given EntityType object
      Throws:
      SQLException - If something goes wrong
    • findByEntityType

      List<RelationshipType> findByEntityType(Context context, EntityType entityType, Integer limit, Integer offset) throws SQLException
      Returns a list of relationship types that matches provided EntityType object on any side of relationship
      Parameters:
      context - The relevant DSpace context
      entityType - The EntityType object that will be used to check on
      limit - Paging limit
      offset - Paging offset
      Returns:
      Throws:
      SQLException - If database error
    • countByEntityType

      int countByEntityType(Context context, EntityType entityType) throws SQLException
      Count all RelationshipType objects for which the given EntityType is equal to either the leftType or the rightType
      Parameters:
      context - DSpace context object
      entityType - The EntityType object used to check the leftType and rightType properties
      Returns:
      Total RelationshipType objects
      Throws:
      SQLException - If database error
    • findByEntityType

      List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft) throws SQLException
      This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType
      Parameters:
      context - The relevant DSpace context
      entityType - The EntityType object that will be used to check on
      isLeft - Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.
      Returns:
      The list of RelationshipType objects that have the given EntityType object as either a leftType or rightType
      Throws:
      SQLException - If something goes wrong
    • findByEntityType

      List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft, Integer limit, Integer offset) throws SQLException
      This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType
      Parameters:
      context - The relevant DSpace context
      entityType - The EntityType object that will be used to check on
      isLeft - Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.
      limit - paging limit
      offset - paging offset
      Returns:
      The list of RelationshipType objects that have the given EntityType object as either a leftType or rightType
      Throws:
      SQLException - If something goes wrong
    • create

      RelationshipType create(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger) throws SQLException, AuthorizeException
      This method will support the creation of a RelationshipType object with the given parameters
      Parameters:
      context - The relevant DSpace context
      leftEntityType - The leftEntityType EntityType object for this relationshipType
      rightEntityType - The rightEntityType EntityType object for this relationshipType
      leftwardType - The leftwardType String object for this relationshipType
      rightwardType - The rightwardType String object for this relationshipType
      leftCardinalityMinInteger - The leftCardinalityMinInteger Integer object for this relationshipType
      leftCardinalityMaxInteger - The leftCardinalityMaxInteger Integer object for this relationshipType
      rightCardinalityMinInteger - The rightCardinalityMinInteger Integer object for this relationshipType
      rightCardinalityMaxInteger - The rightCardinalityMaxInteger Integer object for this relationshipType
      Returns:
      The created RelationshipType object for these properties
      Throws:
      SQLException - If something goes wrong
      AuthorizeException - If something goes wrong
    • create

      RelationshipType create(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger, Boolean copyToLeft, Boolean copyToRight, RelationshipType.Tilted tilted) throws SQLException, AuthorizeException
      This method will support the creation of a RelationshipType object with the given parameters
      Parameters:
      context - The relevant DSpace context
      leftEntityType - The leftEntityType EntityType object for this relationshipType
      rightEntityType - The rightEntityType EntityType object for this relationshipType
      leftwardType - The leftwardType String object for this relationshipType
      rightwardType - The rightwardType String object for this relationshipType
      leftCardinalityMinInteger - The leftCardinalityMinInteger Integer object for this relationshipType
      leftCardinalityMaxInteger - The leftCardinalityMaxInteger Integer object for this relationshipType
      rightCardinalityMinInteger - The rightCardinalityMinInteger Integer object for this relationshipType
      rightCardinalityMaxInteger - The rightCardinalityMaxInteger Integer object for this relationshipType
      Returns:
      The created RelationshipType object for these properties
      Throws:
      SQLException - If something goes wrong
      AuthorizeException - If something goes wrong