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 new model file solution table #18

Merged
merged 1 commit into from
May 1, 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,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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -149,6 +158,23 @@ public void setImpuritiesElutionSolventList(List<ImpuritiesElutionSolvent> impur
}
}

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

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

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