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

BI-2476 Create Single and Batch Delete End Points for Germplasm #47

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

dmeidlin
Copy link

@dmeidlin dmeidlin commented Feb 13, 2025

Story: BI-2476

This pull request implements a "soft delete" functionality for germplasm data, meaning that instead of permanently deleting germplasm records, they are marked as deleted. This provides a mechanism for data recovery and avoids data loss. A hard delete option is also implemented. The pull request also fixes a typo in the PedigreeEdgeEntity related to connectedNode.

Key Changes:

Germplasm Deletion Endpoint: Adds a new API endpoint to delete germplasm records. The endpoint supports both hard deletes (permanent deletion) and soft deletes.
Soft Delete Implementation: Introduces a softDeleted boolean field to the GermplasmEntity to indicate whether a record has been soft deleted. The entity is also updated with a @where clause so that only non-deleted entities are returned by default.
Database Migration: Adds SQL migration scripts to add the soft_deleted column to the germplasm table.
Repository Updates: The GermplasmRepository is updated with new methods to perform the soft delete.
Controller Updates: The GermplasmApiController is updated to implement batch deletes.
Typo Fix: Corrects a typo in the PedigreeEdgeEntity class, replacing conncetedNode with connectedNode. This change is reflected in the corresponding database migration and JPQL queries.
Component Factory Updates: Updated the GermplasmComponent to use the correct service methods for batch soft and hard deletes.

The following associated entities will cascade delete when a germplasm record is soft- or hard-deleted:

Germplasm Children

  • seed_lot_content_mixture
  • reference_set
  • observation_unit
  • cross_parent
  • pedigree_node
  • germplasm_taxon
  • germplasm_synonym
  • germplasm_search_results
  • germplasm_origin
  • germplasm_institute
  • germplasm_entity_type_of_germplasm_storage_code
  • germplasm_external_references
  • germplasm_attribute_value
  • germplasm_donor

Observation Unit Children

  • image
  • event_observation_units
  • observation_unit_treatment
  • observation_unit_position
  • observation_unit_level
  • observation
  • observation_unit_external_references

Image Children

  • image_observations
  • image_external_references
  • image_entity_descriptive_ontology_terms

Variant Children

  • variant_entity_filters_failed
  • variant_entity_cipos
  • variant_entity_ciend
  • variant_entity_alternate_bases
  • variant_external_references

Variant Set Children

  • variantset_format
  • variantset_external_references
  • variantset_analysis

Reference Children

  • reference_external_references
  • reference_bases

Reference Set Children

  • variantset
  • variant
  • reference
  • reference_set_external_references

Pedigree Node Child

  • pedigree_edge

Pedigree Edge Child

  • pedigree_edge_external_references

Reference Bases Child

  • reference_bases_external_references

@dmeidlin dmeidlin changed the title BI-2476 Create Single and Batch Delete End Points for Germplasm on Brapi Java Test Server BI-2476 Create Single and Batch Delete End Points for Germplasm Feb 14, 2025
@dmeidlin dmeidlin requested review from a team, nickpalladino and HMS17 and removed request for a team February 14, 2025 20:16
@dmeidlin dmeidlin requested a review from nickpalladino March 3, 2025 20:19
@dmeidlin dmeidlin merged commit ad05e37 into develop Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants