From 2c688c0af199ff1a1e1924ddf3cf49a77424dd40 Mon Sep 17 00:00:00 2001 From: Newatia Date: Wed, 1 May 2024 16:30:21 -0400 Subject: [PATCH] added new model file --- .../models/ImpuritiesSolutionTable.java | 70 +++++++++++++++++++ .../impurities/models/ImpuritiesTesting.java | 26 +++++++ 2 files changed, 96 insertions(+) create mode 100644 gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesSolutionTable.java diff --git a/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesSolutionTable.java b/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesSolutionTable.java new file mode 100644 index 0000000..5b2d26a --- /dev/null +++ b/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesSolutionTable.java @@ -0,0 +1,70 @@ +package gov.hhs.gsrs.impurities.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import gsrs.GsrsEntityProcessorListener; +import gsrs.model.AbstractGsrsEntity; +import gsrs.model.AbstractGsrsManualDirtyEntity; +import ix.core.models.Indexable; +import ix.core.models.IxModel; +import ix.core.SingleParent; +import ix.core.models.ParentReference; +import ix.core.search.text.TextIndexerEntityListener; +import ix.ginas.models.serialization.GsrsDateDeserializer; +import ix.ginas.models.serialization.GsrsDateSerializer; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; +import org.springframework.data.annotation.CreatedDate; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.persistence.*; + +import java.util.Date; +import java.util.List; +import java.util.ArrayList; + +@SingleParent +@Data +@Entity +@Table(name="SRSCID_IMPURITIES_SOLUTION_TABLE") +public class ImpuritiesSolutionTable extends ImpuritiesCommonData { + + @Id + @SequenceGenerator(name = "impSolTableSeq", sequenceName = "SRSCID_SQ_IMPURITIES_SOL_TABLE_ID", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "impSolTableSeq") + @Column(name = "ID") + public Long id; + + @Column(name = "SOLUTION_TIME", length=500) + public String solutionTime; + + @Column(name = "SOLUTION_A_PERCENT", length=100) + public String solutionAPercent; + + @Column(name = "SOLUTION_B_PERCENT", length=100) + public String solutionBPercent; + + // Set PARENT Class, ImpuritiesTesting + @Indexable(indexed=false) + @ParentReference + @EqualsAndHashCode.Exclude + @JsonIgnore + @ManyToOne(cascade = CascadeType.PERSIST) + @JoinColumn(name="IMPURITIES_TEST_ID") + public ImpuritiesTesting owner; + + // Set PARENT Class, ImpuritiesTesting + public void setOwner(ImpuritiesTesting impuritiesTesting) { + this.owner = impuritiesTesting; + } + +} diff --git a/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesTesting.java b/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesTesting.java index 08ccf63..2551763 100644 --- a/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesTesting.java +++ b/gsrs-module-impurities-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/impurities/models/ImpuritiesTesting.java @@ -107,6 +107,15 @@ public class ImpuritiesTesting extends ImpuritiesCommonData { @Column(name = "SYSTEM_SUITABILITY_SOLUTION", length=500) public String systemSuitabilitySolution; + @Column(name = "OTHER_SOLUTION", length=2000) + public String otherSolution; + + @Column(name = "SOLUTION_A_DESCRIPTION", length=2000) + public String solutionADescription; + + @Column(name = "SOLUTION_B_DESCRIPTION", length=2000) + public String solutionBDescription; + // Suitability Requirements Resolution @Column(name = "SUITABILITY_REQ_RESOLUTION", length=500) public String suitabilityReqResolution; @@ -149,6 +158,23 @@ public void setImpuritiesElutionSolventList(List impur } } + // Set CHILDREN Class, ImpuritiesSolutionTable + @ToString.Exclude + @LazyCollection(LazyCollectionOption.FALSE) + @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "owner") + public List impuritiesSolutionTableList = new ArrayList(); + + // Set CHILDREN Class, ImpuritiesSolutionTable + public void setImpuritiesSolutionTableList(List impuritiesSolutionTableList) { + this.impuritiesSolutionTableList = impuritiesSolutionTableList; + if (impuritiesSolutionTableList != null) { + for (ImpuritiesSolutionTable imp : impuritiesSolutionTableList) + { + imp.setOwner(this); + } + } + } + // Set CHILDREN Class, ImpuritiesDetails @ToString.Exclude @LazyCollection(LazyCollectionOption.FALSE)