Skip to content

Commit

Permalink
chore: Remove delete relationship from service [DHIS2-17713] (#18140)
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante authored Jul 19, 2024
1 parent 9986538 commit 2217b95
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ public interface RelationshipService {
*/
long addRelationship(Relationship relationship);

/**
* Returns a {@link Relationship}.
*
* @param relationship the relationship.
*/
void deleteRelationship(Relationship relationship);

/**
* Returns a {@link Relationship}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public class DefaultRelationshipService implements RelationshipService {
// Implementation methods
// -------------------------------------------------------------------------

@Override
@Transactional
public void deleteRelationship(Relationship relationship) {
relationshipStore.delete(relationship);
}

@Override
@Transactional(readOnly = true)
public Relationship getRelationship(long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public TrackerTypeReport deleteRelationships(List<String> relationships) {
org.hisp.dhis.relationship.Relationship relationship =
relationshipService.getRelationship(uid);

relationshipService.deleteRelationship(relationship);
manager.delete(relationship);

typeReport.getStats().incDeleted();
typeReport.addEntity(objectReport);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void testDeleteSoftDeletedRelationship() {
relationshipService.addRelationship(relationship);
assertNotNull(relationshipService.getRelationship(relationship.getUid()));

relationshipService.deleteRelationship(relationship);
manager.delete(relationship);
assertNull(relationshipService.getRelationship(relationship.getUid()));
assertNotNull(relationshipService.getRelationshipIncludeDeleted(relationship.getUid()));

Expand Down

0 comments on commit 2217b95

Please sign in to comment.