mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
DS-4224 Catch up with master
This commit is contained in:
@@ -172,18 +172,18 @@ public class EntityServiceImpl implements EntityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RelationshipType> getRelationshipTypesByLabel(Context context, String label) throws SQLException {
|
public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type) throws SQLException {
|
||||||
|
|
||||||
return getRelationshipTypesByLabel(context, label, -1, -1);
|
return getRelationshipTypesByTypeName(context, type, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String label,
|
public List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type,
|
||||||
Integer limit, Integer offset) throws SQLException {
|
Integer limit, Integer offset) throws SQLException {
|
||||||
List<RelationshipType> listToReturn = new LinkedList<>();
|
List<RelationshipType> listToReturn = new LinkedList<>();
|
||||||
for (RelationshipType relationshipType : relationshipTypeService.findAll(context, limit, offset)) {
|
for (RelationshipType relationshipType : relationshipTypeService.findAll(context, limit, offset)) {
|
||||||
if (StringUtils.equals(relationshipType.getLeftwardType(),label) ||
|
if (StringUtils.equals(relationshipType.getLeftwardType(),type) ||
|
||||||
StringUtils.equals(relationshipType.getRightwardType(),label)) {
|
StringUtils.equals(relationshipType.getRightwardType(),type)) {
|
||||||
listToReturn.add(relationshipType);
|
listToReturn.add(relationshipType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -65,13 +65,14 @@ public class RelationshipTypeServiceImpl implements RelationshipTypeService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String label) throws SQLException {
|
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String label) throws SQLException {
|
||||||
return findByLeftOrRightLabel(context, label, -1, -1);
|
return findByLeftwardOrRightwardTypeName(context, label, -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String label, Integer limit, Integer offset)
|
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String label, Integer limit,
|
||||||
|
Integer offset)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
return relationshipTypeDAO.findByLeftOrRightLabel(context, label, limit, offset);
|
return relationshipTypeDAO.findByLeftwardOrRightwardTypeName(context, label, limit, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -60,7 +60,8 @@ public interface RelationshipTypeDAO extends GenericDAO<RelationshipType> {
|
|||||||
* @return A list of RelationshipType objects that have the given label as either the leftLabel or rightLabel
|
* @return A list of RelationshipType objects that have the given label as either the leftLabel or rightLabel
|
||||||
* @throws SQLException If something goes wrong
|
* @throws SQLException If something goes wrong
|
||||||
*/
|
*/
|
||||||
List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String type, Integer limit, Integer offset)
|
List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String type, Integer limit,
|
||||||
|
Integer offset)
|
||||||
throws SQLException;
|
throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -46,7 +46,8 @@ public class RelationshipTypeDAOImpl extends AbstractHibernateDAO<RelationshipTy
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String type, Integer limit, Integer offset)
|
public List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String type, Integer limit,
|
||||||
|
Integer offset)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
|
||||||
CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context);
|
CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context);
|
||||||
|
@@ -190,25 +190,25 @@ public interface EntityService {
|
|||||||
* Retrieves a list of RelationshipType objects for which either their left or right label is equal to the
|
* Retrieves a list of RelationshipType objects for which either their left or right label is equal to the
|
||||||
* label parameter that's being passed along
|
* label parameter that's being passed along
|
||||||
* @param context The relevant DSpace context
|
* @param context The relevant DSpace context
|
||||||
* @param label The label for which the relationshiptype's labels must be checked
|
* @param type The label for which the relationshiptype's labels must be checked
|
||||||
* @return The list of relationshiptypes that each contain a left or right label that is equal
|
* @return The list of relationshiptypes that each contain a left or right label that is equal
|
||||||
* to the given label parameter
|
* to the given label parameter
|
||||||
* @throws SQLException If something goes wrong
|
* @throws SQLException If something goes wrong
|
||||||
*/
|
*/
|
||||||
List<RelationshipType> getRelationshipTypesByTypeName(Context context, String label) throws SQLException;
|
List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type) throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of RelationshipType objects for which either their left or right label is equal to the
|
* Retrieves a list of RelationshipType objects for which either their left or right label is equal to the
|
||||||
* label parameter that's being passed along
|
* label parameter that's being passed along
|
||||||
* @param context The relevant DSpace context
|
* @param context The relevant DSpace context
|
||||||
* @param label The label for which the relationshiptype's labels must be checked
|
* @param type The label for which the relationshiptype's labels must be checked
|
||||||
* @param limit paging limit
|
* @param limit paging limit
|
||||||
* @param offset paging offset
|
* @param offset paging offset
|
||||||
* @return The list of relationshiptypes that each contain a left or right label that is equal
|
* @return The list of relationshiptypes that each contain a left or right label that is equal
|
||||||
* to the given label parameter
|
* to the given label parameter
|
||||||
* @throws SQLException If something goes wrong
|
* @throws SQLException If something goes wrong
|
||||||
*/
|
*/
|
||||||
List<RelationshipType> getRelationshipTypesByLabel(Context context, String label,
|
List<RelationshipType> getRelationshipTypesByTypeName(Context context, String type,
|
||||||
Integer limit, Integer offset) throws SQLException;
|
Integer limit, Integer offset) throws SQLException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -85,7 +85,8 @@ public interface RelationshipTypeService extends DSpaceCRUDService<RelationshipT
|
|||||||
* that is equal to the given label param
|
* that is equal to the given label param
|
||||||
* @throws SQLException If something goes wrong
|
* @throws SQLException If something goes wrong
|
||||||
*/
|
*/
|
||||||
List<RelationshipType> findByLeftOrRightLabel(Context context, String label, Integer limit, Integer offset)
|
List<RelationshipType> findByLeftwardOrRightwardTypeName(Context context, String label, Integer limit,
|
||||||
|
Integer offset)
|
||||||
throws SQLException;
|
throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -144,7 +144,7 @@ public class RelationshipTypeDAOImplTest extends AbstractIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testFindByLeftOrRightLabel() throws Exception {
|
public void testFindByLeftOrRightLabel() throws Exception {
|
||||||
assertEquals("TestFindByLeftOrRightLabel 0", relationshipTypeList, relationshipTypeService.
|
assertEquals("TestFindByLeftOrRightLabel 0", relationshipTypeList, relationshipTypeService.
|
||||||
findByLeftOrRightLabel(context, "isAuthorOfPublication", -1, -1));
|
findByLeftwardOrRightwardTypeName(context, "isAuthorOfPublication", -1, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user