-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODLD-643: Preservation of MARC fields that are not rendered in the UI (
#94)
- Loading branch information
1 parent
91ae039
commit 8e38c53
Showing
9 changed files
with
207 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/org/folio/linked/data/model/entity/RawMarc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.folio.linked.data.model.entity; | ||
|
||
import static lombok.AccessLevel.PROTECTED; | ||
|
||
import com.vladmihalcea.hibernate.type.json.JsonBinaryType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.MapsId; | ||
import jakarta.persistence.OneToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import lombok.experimental.Accessors; | ||
import org.hibernate.annotations.Type; | ||
|
||
@Entity | ||
@Data | ||
@NoArgsConstructor(access = PROTECTED) | ||
@Accessors(chain = true) | ||
@Table(name = "raw_marcs") | ||
@EqualsAndHashCode(of = "id") | ||
public class RawMarc { | ||
|
||
@Id | ||
@Column(name = "resource_hash") | ||
private Long id; | ||
|
||
@Column(columnDefinition = "json") | ||
@Type(JsonBinaryType.class) | ||
private String content; | ||
|
||
@OneToOne | ||
@MapsId | ||
@JoinColumn(name = "resource_hash") | ||
@ToString.Exclude | ||
private Resource resource; | ||
|
||
public RawMarc(Resource resource) { | ||
this.resource = resource; | ||
this.id = resource.getId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/changelog/scripts/v-1.0.0/resource_graph/tables/raw_marcs.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
create table if not exists raw_marcs ( | ||
resource_hash bigint primary key references resources(resource_hash), | ||
content jsonb null | ||
); | ||
|
||
comment on table raw_marcs is 'Store unmapped MARC records associated with an Instance resource. Applicable only for Instance resources'; | ||
comment on column raw_marcs.resource_hash is 'The unique hash identifier for the resource'; | ||
comment on column raw_marcs.content is 'JSON representation of MARC record'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters