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

MODLD-620: Preservation of MARC fields that are not rendered in the UI #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public class Resource implements Persistable<Long> {
@Type(JsonBinaryType.class)
private JsonNode doc;

@Column(columnDefinition = "json")
@Type(JsonBinaryType.class)
private String rawData;

private Date indexDate;

private boolean active = true;
Expand Down Expand Up @@ -128,6 +132,7 @@ public Resource(@NonNull Resource that) {
this.id = that.id;
this.label = that.label;
this.doc = (JsonNode) ofNullable(that.getDoc()).map(JsonNode::deepCopy).orElse(null);
this.rawData = that.rawData;
this.folioMetadata = that.folioMetadata;
this.indexDate = that.indexDate;
this.types = new LinkedHashSet<>(that.getTypes());
Expand All @@ -152,6 +157,7 @@ public static Resource copyWithNoEdges(@NonNull Resource that) {
.setId(that.id)
.setLabel(that.label)
.setDoc((JsonNode) ofNullable(that.getDoc()).map(JsonNode::deepCopy).orElse(null))
.setRawData(that.rawData)
.setIndexDate(that.indexDate)
.setTypes(new LinkedHashSet<>(that.getTypes()))
.setIncomingEdges(new LinkedHashSet<>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
CREATE TABLE if not exists resources (
resource_hash bigint not null primary key,
doc jsonb null,
raw_data jsonb null,
label text null,
resource_uri text,
created_event_id bigint null,
Expand All @@ -23,6 +24,7 @@ create index if not exists resources_active_idx on resources(active);
comment on table resources is 'All resources in a graph and their non-link data';
comment on column resources.resource_hash is 'The unique hash identifier for the resource';
comment on column resources.doc is 'JSON representation of literal properties for the resource';
comment on column resources.raw_data is 'JSON representation of unmapped MARC data related to the resource';
comment on column resources.label is 'Descriptive label for the resource';
comment on column resources.created_event_id is 'The event that created the resource';
comment on column resources.updated_event_id is 'The latest event that updated the resource';
Expand Down