Skip to content

Commit

Permalink
feature/MODELINKS-248 split relationship fields to sft and saft
Browse files Browse the repository at this point in the history
  • Loading branch information
ShmElena committed Sep 6, 2024
1 parent 5d35594 commit bb6ae5c
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,13 @@ default void authorityPostProcess(AuthorityDto source, @MappingTarget AuthorityB
AuthorityUtilityMapper.extractAuthorityHeading(source, target);
AuthorityUtilityMapper.extractAuthoritySftHeadings(source, target);
AuthorityUtilityMapper.extractAuthoritySaftHeadings(source, target);
AuthorityUtilityMapper.extractAuthorityAdditionalHeadings(source, target);
}

@AfterMapping
default void authorityDtoPostProcessing(AuthorityBase source, @MappingTarget AuthorityDto target) {
AuthorityUtilityMapper.extractAuthorityDtoHeadingValue(source, target);
AuthorityUtilityMapper.extractAuthorityDtoSftHeadings(source, target);
AuthorityUtilityMapper.extractAuthorityDtoSaftHeadings(source, target);
AuthorityUtilityMapper.extractAuthorityDtoAdditionalHeadings(source, target);
}

default OffsetDateTime map(Timestamp timestamp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class AuthorityBase extends MetadataEntity {
public static final String DELETED_COLUMN = "deleted";

private static final String CONSORTIUM_SOURCE_PREFIX = "CONSORTIUM-";
private static final String ADDITIONAL_HEADINGS_COLUMN = "additional_headings";

@Id
@Column(name = ID_COLUMN, nullable = false)
Expand Down Expand Up @@ -91,10 +90,6 @@ public class AuthorityBase extends MetadataEntity {
@Column(name = DELETED_COLUMN)
private boolean deleted = false;

@Column(name = ADDITIONAL_HEADINGS_COLUMN)
@JdbcTypeCode(SqlTypes.JSON)
private List<HeadingRef> additionalHeadings;

public AuthorityBase(AuthorityBase other) {
super(other);
this.id = other.id;
Expand All @@ -121,9 +116,6 @@ public AuthorityBase(AuthorityBase other) {
.map(AuthorityNote::new)
.toList();
this.deleted = other.deleted;
this.additionalHeadings = Optional.ofNullable(other.getSaftHeadings()).orElse(List.of()).stream()
.map(HeadingRef::new)
.toList();
}

public void makeAsConsortiumShadowCopy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,4 @@ public class AuthorityConstants {
public static final String GEOGRAPHIC_NAME_HEADING = "geographicName";

public static final String GENRE_TERM_HEADING = "genreTerm";

public static final String BROADER_TERM = "broaderTerm";

public static final String NARROWER_TERM = "narrowerTerm";

public static final String EARLIER_HEADING = "earlierHeading";

public static final String LATER_HEADING = "laterHeading";

public static final String SFT_TERM = "sftTerm";

public static final String SAFT_TERM = "saftTerm";
}
2 changes: 0 additions & 2 deletions src/main/resources/db/changelog/changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@
<include file="/changes/v3.0/add-authority-source-protocol.xml" relativeToChangelogFile="true"/>
<include file="/changes/v3.0/add-authority-source-file-optimistic-locking.xml" relativeToChangelogFile="true"/>
<include file="/changes/v3.0/update-auto-linking_enabled.xml" relativeToChangelogFile="true"/>
<include file="/changes/v3.1/add-additional-fields-to-authority.xml" relativeToChangelogFile="true"/>
<include file="/changes/v3.1/add-additional-fields-to-authority-archive.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -203,36 +203,6 @@ properties:
description: Authority Natural ID
metadata:
$ref: '../common/metadata.yaml'
broaderTerm:
type: array
description: Terms that represents broader, more general concepts related to the authority record
items:
type: string
narrowerTerm:
type: array
description: Terms that represents narrower, more specific concepts derived from the authority record
items:
type: string
earlierHeading:
type: array
description: Heading that was previously used to represent the concept or entity described by the authority record. This field is used to track the evolution of terms or headings over time, facilitating the linking of historical and current data.
items:
type: string
laterHeading:
type: array
description: Heading that replaced the current heading used in the authority record. This field helps in maintaining the continuity of catalog records by linking past headings to their more current versions.
items:
type: string
sftTerm:
type: array
description: See from tracing term
items:
type: string
saftTerm:
type: array
description: See also from tracing term
items:
type: string
required:
- source
- naturalId
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ void shouldUpdateAuthority() {
existed.setSftHeadings(List.of(new HeadingRef("personalName", "sft")));
existed.setNotes(List.of(new AuthorityNote(UUID.randomUUID(), "note", true)));
existed.setIdentifiers(List.of(new AuthorityIdentifier("identifier", UUID.randomUUID())));
existed.setAdditionalHeadings(List.of(new HeadingRef("broaderTerm", "broader"),
new HeadingRef("narrowerTerm", "narrower"),
new HeadingRef("earlierHeading", "earlier"),
new HeadingRef("laterHeading", "later"),
new HeadingRef("sftTerm", "sft"),
new HeadingRef("saftTerm", "saft")));
var sourceFileOld = new AuthoritySourceFile();
sourceFileOld.setId(UUID.randomUUID());
existed.setAuthoritySourceFile(sourceFileOld);
Expand All @@ -151,12 +145,6 @@ void shouldUpdateAuthority() {
modified.setSftHeadings(List.of(new HeadingRef("personalNameNew", "sftNew")));
modified.setNotes(List.of(new AuthorityNote(UUID.randomUUID(), "noteNew", true)));
modified.setIdentifiers(List.of(new AuthorityIdentifier("identifierNew", UUID.randomUUID())));
modified.setAdditionalHeadings(List.of(new HeadingRef("broaderTerm", "broaderNew"),
new HeadingRef("narrowerTerm", "narrowerNew"),
new HeadingRef("earlierHeading", "earlierNew"),
new HeadingRef("laterHeading", "laterNew"),
new HeadingRef("sftTerm", "sftNew"),
new HeadingRef("saftTerm", "saftNew")));
var sourceFileNew = new AuthoritySourceFile();
sourceFileNew.setId(UUID.randomUUID());
modified.setAuthoritySourceFile(sourceFileNew);
Expand Down

0 comments on commit bb6ae5c

Please sign in to comment.