Skip to content

Commit

Permalink
added new model file
Browse files Browse the repository at this point in the history
  • Loading branch information
Newatia authored and Newatia committed May 1, 2024
1 parent dd44d03 commit 2c688c0
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
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

0 comments on commit 2c688c0

Please sign in to comment.