Package org.dspace.content
Class RelationshipTypeServiceImpl
java.lang.Object
org.dspace.content.RelationshipTypeServiceImpl
- All Implemented Interfaces:
RelationshipTypeService,DSpaceCRUDService<RelationshipType>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountByEntityType(Context context, EntityType entityType) Count all RelationshipType objects for which the given EntityType is equal to either the leftType or the rightTypecreate(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger) This method will support the creation of a RelationshipType object with the given parameterscreate(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) This method will support the creation of a RelationshipType object with the given parameterscreate(Context context, RelationshipType relationshipType) This method creates the given RelationshipType object in the database and returns itvoiddelete(Context context, RelationshipType relationshipType) Retrieves all RelationshipType objects currently in the systemRetrieves all RelationshipType objects currently in the systemfindByEntityType(Context context, EntityType entityType) Returns a list of RelationshipType objects for which the given EntityType is equal to either the leftType or the rightTypefindByEntityType(Context context, EntityType entityType, boolean isLeft) This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightTypefindByEntityType(Context context, EntityType entityType, boolean isLeft, Integer limit, Integer offset) This method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightTypefindByEntityType(Context context, EntityType entityType, Integer limit, Integer offset) Returns a list of relationship types that matches provided EntityType object on any side of relationshipfindByLeftwardOrRightwardTypeName(Context context, String typeName) Retrieves all RelationshipType objects that have a left or right type that is equal to the given StringfindByLeftwardOrRightwardTypeName(Context context, String typeName, Integer limit, Integer offset) Retrieves all RelationshipType objects that have a left or right label that is equal to the given StringfindbyTypesAndTypeName(Context context, EntityType leftType, EntityType rightType, String leftwardType, String rightwardType) Retrieves a RelationshipType for which the given parameters all match the one in the returned RelationshipTypevoidupdate(Context context, List<RelationshipType> relationshipTypes) Persist a collection of model objects.voidupdate(Context context, RelationshipType relationshipType) Persist a model object.
-
Field Details
-
relationshipTypeDAO
-
authorizeService
-
-
Constructor Details
-
RelationshipTypeServiceImpl
public RelationshipTypeServiceImpl()
-
-
Method Details
-
create
- Specified by:
createin interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
create
public RelationshipType create(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException Description copied from interface:RelationshipTypeServiceThis method creates the given RelationshipType object in the database and returns it- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextrelationshipType- The RelationshipType to be created in the database- Returns:
- The newly created RelationshipType
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong with authorizations
-
findbyTypesAndTypeName
public RelationshipType findbyTypesAndTypeName(Context context, EntityType leftType, EntityType rightType, String leftwardType, String rightwardType) throws SQLException Description copied from interface:RelationshipTypeServiceRetrieves a RelationshipType for which the given parameters all match the one in the returned RelationshipType- Specified by:
findbyTypesAndTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftType- The rightType EntityType that needs to match for the returned RelationshipTyperightType- The rightType EntityType that needs to match for the returned RelationshipTypeleftwardType- The leftwardType String that needs to match for the returned RelationshipTyperightwardType- The rightwardType String that needs to match for the returned RelationshipType- Returns:
- Throws:
SQLException- If something goes wrong
-
findAll
Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects currently in the system- Specified by:
findAllin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace context- Returns:
- The list of all RelationshipType objects currently in the system
- Throws:
SQLException- If something goes wrong
-
findAll
public List<RelationshipType> findAll(Context context, Integer limit, Integer offset) throws SQLException Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects currently in the system- Specified by:
findAllin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextlimit- paging limitoffset- paging offset- Returns:
- The list of all RelationshipType objects currently in the system
- Throws:
SQLException- If something goes wrong
-
findByLeftwardOrRightwardTypeName
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName) throws SQLException Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects that have a left or right type that is equal to the given String- Specified by:
findByLeftwardOrRightwardTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contexttypeName- 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
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String typeName, Integer limit, Integer offset) throws SQLException Description copied from interface:RelationshipTypeServiceRetrieves all RelationshipType objects that have a left or right label that is equal to the given String- Specified by:
findByLeftwardOrRightwardTypeNamein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contexttypeName- The typeName that has to matchlimit- paging limitoffset- 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
public List<RelationshipType> findByEntityType(Context context, EntityType entityType) throws SQLException Description copied from interface:RelationshipTypeServiceReturns a list of RelationshipType objects for which the given EntityType is equal to either the leftType or the rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- 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
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, Integer limit, Integer offset) throws SQLException Description copied from interface:RelationshipTypeServiceReturns a list of relationship types that matches provided EntityType object on any side of relationship- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object that will be used to check onlimit- Paging limitoffset- Paging offset- Returns:
- Throws:
SQLException- If database error
-
findByEntityType
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft) throws SQLException Description copied from interface:RelationshipTypeServiceThis method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object that will be used to check onisLeft- 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
public List<RelationshipType> findByEntityType(Context context, EntityType entityType, boolean isLeft, Integer limit, Integer offset) throws SQLException Description copied from interface:RelationshipTypeServiceThis method will return a list of RelationshipType objects for which the given EntityType object is equal to the leftType or rightType- Specified by:
findByEntityTypein interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextentityType- The EntityType object that will be used to check onisLeft- Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.limit- paging limitoffset- 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
public RelationshipType create(Context context, EntityType leftEntityType, EntityType rightEntityType, String leftwardType, String rightwardType, Integer leftCardinalityMinInteger, Integer leftCardinalityMaxInteger, Integer rightCardinalityMinInteger, Integer rightCardinalityMaxInteger) throws SQLException, AuthorizeException Description copied from interface:RelationshipTypeServiceThis method will support the creation of a RelationshipType object with the given parameters- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftEntityType- The leftEntityType EntityType object for this relationshipTyperightEntityType- The rightEntityType EntityType object for this relationshipTypeleftwardType- The leftwardType String object for this relationshipTyperightwardType- The rightwardType String object for this relationshipTypeleftCardinalityMinInteger- The leftCardinalityMinInteger Integer object for this relationshipTypeleftCardinalityMaxInteger- The leftCardinalityMaxInteger Integer object for this relationshipTyperightCardinalityMinInteger- The rightCardinalityMinInteger Integer object for this relationshipTyperightCardinalityMaxInteger- The rightCardinalityMaxInteger Integer object for this relationshipType- Returns:
- The created RelationshipType object for these properties
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong
-
create
public 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 Description copied from interface:RelationshipTypeServiceThis method will support the creation of a RelationshipType object with the given parameters- Specified by:
createin interfaceRelationshipTypeService- Parameters:
context- The relevant DSpace contextleftEntityType- The leftEntityType EntityType object for this relationshipTyperightEntityType- The rightEntityType EntityType object for this relationshipTypeleftwardType- The leftwardType String object for this relationshipTyperightwardType- The rightwardType String object for this relationshipTypeleftCardinalityMinInteger- The leftCardinalityMinInteger Integer object for this relationshipTypeleftCardinalityMaxInteger- The leftCardinalityMaxInteger Integer object for this relationshipTyperightCardinalityMinInteger- The rightCardinalityMinInteger Integer object for this relationshipTyperightCardinalityMaxInteger- The rightCardinalityMaxInteger Integer object for this relationshipType- Returns:
- The created RelationshipType object for these properties
- Throws:
SQLException- If something goes wrongAuthorizeException- If something goes wrong
-
find
- Specified by:
findin interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLException
-
update
public void update(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException Description copied from interface:DSpaceCRUDServicePersist a model object.- Specified by:
updatein interfaceDSpaceCRUDService<RelationshipType>relationshipType- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
update
public void update(Context context, List<RelationshipType> relationshipTypes) throws SQLException, AuthorizeException Description copied from interface:DSpaceCRUDServicePersist a collection of model objects.- Specified by:
updatein interfaceDSpaceCRUDService<RelationshipType>relationshipTypes- object to be persisted.- Throws:
SQLException- passed through.AuthorizeException- passed through.
-
delete
public void delete(Context context, RelationshipType relationshipType) throws SQLException, AuthorizeException - Specified by:
deletein interfaceDSpaceCRUDService<RelationshipType>- Throws:
SQLExceptionAuthorizeException
-
countByEntityType
Description copied from interface:RelationshipTypeServiceCount all RelationshipType objects for which the given EntityType is equal to either the leftType or the rightType- Specified by:
countByEntityTypein interfaceRelationshipTypeService- Parameters:
context- DSpace context objectentityType- The EntityType object used to check the leftType and rightType properties- Returns:
- Total RelationshipType objects
- Throws:
SQLException- If database error
-