Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMP-4701: Performance Testing - Add Audio - Test Harness - Post /audios/metadata - could not execute statement [ERROR: duplicate key value violates unique constraint "hearing_media_ae_pk" #2553

Merged
merged 7 commits into from
Feb 5, 2025

Conversation

Ben-Edwards-cgi
Copy link
Contributor

Links

Jira

Change description

Summary of Git Diff

This Git diff shows modifications made to the AudioUploadServiceImpl.java and HearingEntity.java files in the HMCTS DARTS project. The changes primarily involve method updates to improve functionality and clarity regarding media handling and hearing associations.

Highlights

AudioUploadServiceImpl.java

  • Change in media saving method:
    • The method mediaRepository.save(newMediaEntity); has been replaced with newMediaEntity = mediaRepository.saveAndFlush(newMediaEntity); to ensure that changes are immediately flushed to the database.

HearingEntity.java

  • Enhanced media addition logic:
    • The method addMedia(MediaEntity mediaEntity) was updated to improve the check for existing media in the list. It now uses the containsMedia(mediaEntity) method for better clarity.
    • The check for adding the hearing to the mediaEntity's hearing list has been refined with a more readable conditional structure.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

@Ben-Edwards-cgi Ben-Edwards-cgi requested review from a team as code owners February 5, 2025 15:04
@Ben-Edwards-cgi Ben-Edwards-cgi requested review from davet1985, jackmaloney, hemantasharma1129, Abhivan, SalimKainos and ieuanb74 and removed request for a team February 5, 2025 15:04
@Ben-Edwards-cgi Ben-Edwards-cgi enabled auto-merge (squash) February 5, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants