From d1d69ee014e9d5e20fe59d42b573ad93e6702998 Mon Sep 17 00:00:00 2001 From: andrej romanov <50377758+auumgn@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:17:18 +0200 Subject: [PATCH 1/7] add generated by script column --- .../orcid/pojo/ajaxForm/ProfileEmailDomain.java | 7 +++++++ .../jpa/entities/ProfileEmailDomainEntity.java | 10 ++++++++++ .../src/main/resources/db-master.xml | 1 + ...by_script_column_to_profile_email_domain.xml | 17 +++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 orcid-persistence/src/main/resources/db/updates/add_generated_by_script_column_to_profile_email_domain.xml diff --git a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/ProfileEmailDomain.java b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/ProfileEmailDomain.java index 422442a130..ae689fc7fa 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/ProfileEmailDomain.java +++ b/orcid-core/src/main/java/org/orcid/pojo/ajaxForm/ProfileEmailDomain.java @@ -15,12 +15,15 @@ public class ProfileEmailDomain { private Date lastModified; + private Boolean generatedByScript; + public static ProfileEmailDomain valueOf(ProfileEmailDomainEntity ed) { ProfileEmailDomain emailDomain = new ProfileEmailDomain(); if (ed != null) { emailDomain.setValue(ed.getEmailDomain()); emailDomain.setVisibility(ed.getVisibility()); + emailDomain.setGeneratedByScript(ed.getGeneratedByScript()); if (ed.getDateCreated() != null) { Date createdDate = new Date(); @@ -77,4 +80,8 @@ public Date getLastModified() { public void setLastModified(Date lastModified) { this.lastModified = lastModified; } + + public Boolean getGeneratedByScript() { return generatedByScript; } + + public void setGeneratedByScript(Boolean generatedByScript) { this.generatedByScript = generatedByScript; } } diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java index 50da86cd52..7e0584d136 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/ProfileEmailDomainEntity.java @@ -18,6 +18,7 @@ public class ProfileEmailDomainEntity extends BaseEntity { private String emailDomain; private String visibility; private Date dateCreated; + private Boolean generatedByScript; @Id @Column(name = "id") @@ -67,6 +68,15 @@ public void setDateCreated(Date dateCreated) { this.dateCreated = dateCreated; } + @Column(name = "generated_by_script") + public Boolean getGeneratedByScript() { + return generatedByScript; + } + + public void setGeneratedByScript(Boolean generatedByScript) { + this.generatedByScript = generatedByScript; + } + @Override public boolean equals(Object obj) { diff --git a/orcid-persistence/src/main/resources/db-master.xml b/orcid-persistence/src/main/resources/db-master.xml index 2d893fead1..59c6f0f600 100644 --- a/orcid-persistence/src/main/resources/db-master.xml +++ b/orcid-persistence/src/main/resources/db-master.xml @@ -289,6 +289,7 @@ +