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

added Solution #19

Merged
merged 1 commit into from
May 16, 2024
Merged
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
@@ -0,0 +1,67 @@
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")
public class ImpuritiesSolution extends ImpuritiesCommonData {

@Id
@SequenceGenerator(name = "impSolSeq", sequenceName = "SRSCID_SQ_IMPURITIES_SOLUTION_ID", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "impSolSeq")
@Column(name = "ID")
public Long id;

@Column(name = "SOLUTION_DESCRIPTION", length=4000)
public String solutionDescription;

@Column(name = "SOLUTION_LETTER", length=4000)
public String solutionLetter;

// 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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@SingleParent
@Data
@Entity
@Table(name="SRSCID_IMPURITIES_SOLUTION_TABLE")
@Table(name = "SRSCID_IMPURITIES_SOLUTION_TABLE")
public class ImpuritiesSolutionTable extends ImpuritiesCommonData {

@Id
Expand All @@ -44,22 +44,46 @@ public class ImpuritiesSolutionTable extends ImpuritiesCommonData {
@Column(name = "ID")
public Long id;

@Column(name = "SOLUTION_TIME", length=500)
@Column(name = "SOLUTION_TIME")
public String solutionTime;

@Column(name = "SOLUTION_A_PERCENT", length=100)
@Column(name = "SOLUTION_A_PERCENT")
public String solutionAPercent;

@Column(name = "SOLUTION_B_PERCENT", length=100)
@Column(name = "SOLUTION_B_PERCENT")
public String solutionBPercent;

@Column(name = "SOLUTION_C_PERCENT")
public String solutionCPercent;

@Column(name = "SOLUTION_D_PERCENT")
public String solutionDPercent;

@Column(name = "SOLUTION_E_PERCENT")
public String solutionEPercent;

@Column(name = "SOLUTION_F_PERCENT")
public String solutionFPercent;

@Column(name = "SOLUTION_G_PERCENT")
public String solutionGPercent;

@Column(name = "SOLUTION_H_PERCENT")
public String solutionHPercent;

@Column(name = "SOLUTION_I_PERCENT")
public String solutionIPercent;

@Column(name = "SOLUTION_J_PERCENT")
public String solutionJPercent;

// Set PARENT Class, ImpuritiesTesting
@Indexable(indexed=false)
@Indexable(indexed = false)
@ParentReference
@EqualsAndHashCode.Exclude
@JsonIgnore
@ManyToOne(cascade = CascadeType.PERSIST)
@JoinColumn(name="IMPURITIES_TEST_ID")
@JoinColumn(name = "IMPURITIES_TEST_ID")
public ImpuritiesTesting owner;

// Set PARENT Class, ImpuritiesTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ public class ImpuritiesTesting extends ImpuritiesCommonData {
@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;
Expand Down Expand Up @@ -158,6 +152,23 @@ public void setImpuritiesElutionSolventList(List<ImpuritiesElutionSolvent> impur
}
}

// Set CHILDREN Class, ImpuritiesSolution
@ToString.Exclude
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "owner")
public List<ImpuritiesSolution> impuritiesSolutionList = new ArrayList<ImpuritiesSolution>();

// Set CHILDREN Class, ImpuritiesSolution
public void setImpuritiesSolutionList(List<ImpuritiesSolution> impuritiesSolutionList) {
this.impuritiesSolutionList = impuritiesSolutionList;
if (impuritiesSolutionList != null) {
for (ImpuritiesSolution imp : impuritiesSolutionList)
{
imp.setOwner(this);
}
}
}

// Set CHILDREN Class, ImpuritiesSolutionTable
@ToString.Exclude
@LazyCollection(LazyCollectionOption.FALSE)
Expand Down
Loading