Linking subsets and datasets with accessions
Dataset currently uses a list of AccessionIdentifier
records to specify which accessions (by instcode, accenumb, genus or doi) are referenced in the dataset.
Subset, on the other hand, uses a list of AccessionId
so that even if the accession is deleted from Genesys (and is removed from Accession
and added to AccessionHistoric
) the subset still maintains the reference to the original record. This was a good idea originally, but it fails in the case where an accession is reuploaded to Genesys -- Subset will not link to the correct record anymore.
Properly referencing accessions
- Rename and move
org.genesys.catalog.model.dataset.AccessionIdentifier
toorg.genesys2.server.model.genesys.AccessionRef
. - Change
private AccessionId accession
toprivate Accession accession
- We can now use
AccessionFilter
inDatasetFilter
!
Serialization
Serialize property accession
of AccessionRef
as @JsonUnwrapped
. This will embed all key data from Accession
into this object (hope that works).
AspectJ
- When an accession is deleted from
Accession
(tableaccession
) the code should update allAccessionRef#accession
tonull
. - When an accession is saved to
Accession
(tableaccession
) the code should updateAccessionRef#accession
where a match is found.
Subset update
Replace private List<AccessionId> accessions
with private List<AccessionRef> accessions
.
This allows us to have Subsets that "reference" an accession that does not have passport data in Genesys, but it will in the future. It also allows users to delete an accession (rarely) and re-upload it to the system.
Liquibase
RenameinverseJoinColumns = @JoinColumn(name = "acce_id")
toa_id
.- Migrate all existing data