From fa39dff9fb47bb1552b0b6ae8956c8da207d2465 Mon Sep 17 00:00:00 2001 From: Newatia Date: Mon, 27 Sep 2021 14:05:47 -0400 Subject: [PATCH 1/3] made context plural --- .../application/models/ApplicationCommanData.java | 6 ++++-- .../application/models/ApplicationIngredient.java | 4 ++-- .../services/ApplicationEntityService.java | 2 +- .../applicationall/models/ApplicationAll.java | 5 ++++- .../applicationall/models/ProductSrsAll.java | 11 +++++++---- .../services/ApplicationAllEntityService.java | 2 +- .../services/ApplicationDarrtsEntityService.java | 2 +- .../services/SearchCountEntityService.java | 2 +- 8 files changed, 21 insertions(+), 13 deletions(-) diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationCommanData.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationCommanData.java index acba3db..fa10d9d 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationCommanData.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationCommanData.java @@ -25,23 +25,25 @@ public class ApplicationCommanData extends AbstractGsrsEntity { // @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "appSeq") // public Long id; + @Indexable(facet = true, name = "Record Created By") @Column(name = "CREATED_BY") private String createdBy; + @Indexable(name = "Record Last Edited By") @Column(name = "MODIFIED_BY") private String modifiedBy; @JsonSerialize(using = GsrsDateSerializer.class) @JsonDeserialize(using = GsrsDateDeserializer.class) @CreatedDate - @Indexable( name = "Create Date", sortable=true) + @Indexable( name = "Record Create Date", sortable=true) @Column(name = "CREATE_DATE") private Date creationDate; @JsonSerialize(using = GsrsDateSerializer.class) @JsonDeserialize(using = GsrsDateDeserializer.class) @LastModifiedDate - @Indexable( name = "Last Modified Date", sortable=true) + @Indexable( name = "Record Last Edited", sortable=true) @Column(name = "MODIFY_DATE") private Date lastModifiedDate; diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationIngredient.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationIngredient.java index d1bf724..ba7b735 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationIngredient.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/models/ApplicationIngredient.java @@ -99,7 +99,7 @@ public class ApplicationIngredient extends AbstractGsrsEntity { @Column(name = "CREATED_BY") public String createdBy; - @Indexable(facet = true, name = "Ingredient Last Modified By") + @Indexable(facet = true, name = "Ingredient Last Edited By") @Column(name = "MODIFIED_BY") public String modifiedBy; @@ -113,7 +113,7 @@ public class ApplicationIngredient extends AbstractGsrsEntity { @JsonSerialize(using = GsrsDateSerializer.class) @JsonDeserialize(using = GsrsDateDeserializer.class) @LastModifiedDate - @Indexable( name = "Ingredient Last Modified Date", sortable=true) + @Indexable( name = "Ingredient Last Edited", sortable=true) @Column(name = "MODIFY_DATE") private Date lastModifiedDate; diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/services/ApplicationEntityService.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/services/ApplicationEntityService.java index a120c6d..91c74e2 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/services/ApplicationEntityService.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/application/services/ApplicationEntityService.java @@ -27,7 +27,7 @@ @Service public class ApplicationEntityService extends AbstractGsrsEntityService { - public static final String CONTEXT = "application"; + public static final String CONTEXT = "applications"; public ApplicationEntityService() { super(CONTEXT, IdHelpers.NUMBER, null, null, null); diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ApplicationAll.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ApplicationAll.java index ae5f362..9f4208e 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ApplicationAll.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ApplicationAll.java @@ -6,6 +6,8 @@ import ix.core.models.Indexable; import ix.core.models.IndexableRoot; import lombok.Data; +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; import javax.persistence.*; import java.util.ArrayList; @@ -60,9 +62,10 @@ public String getId() { } @JoinColumn(name = "APPLICATION_ID", referencedColumnName = "APPLICATION_ID") - @OneToMany(cascade = CascadeType.ALL) + @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) public List applicationProductList = new ArrayList<>(); + @LazyCollection(LazyCollectionOption.FALSE) @Indexable(indexed=false) @OneToMany(fetch=FetchType.LAZY, cascade=CascadeType.ALL) @JoinColumn(name="APPLICATION_ID", referencedColumnName="APPLICATION_ID") diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java index 385e29a..86b9c90 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java @@ -2,6 +2,8 @@ import gsrs.model.AbstractGsrsEntity; import lombok.Data; +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; import javax.persistence.*; import java.util.ArrayList; @@ -22,13 +24,14 @@ public class ProductSrsAll extends AbstractGsrsEntity { @Column(name="DOSAGE_FORM") public String dosageForm; + @LazyCollection(LazyCollectionOption.FALSE) @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") - @OneToMany(cascade = CascadeType.ALL) - public List applicationIngredientList = new ArrayList<>(); + @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) + public List applicationProductNameList = new ArrayList<>(); @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") - @OneToMany(cascade = CascadeType.ALL) - public List applicationProductNameList = new ArrayList<>(); + @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) + public List applicationIngredientList = new ArrayList<>(); public ProductSrsAll () {} diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/services/ApplicationAllEntityService.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/services/ApplicationAllEntityService.java index ddb6a71..fa5caf9 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/services/ApplicationAllEntityService.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/services/ApplicationAllEntityService.java @@ -24,7 +24,7 @@ @Service public class ApplicationAllEntityService extends AbstractGsrsEntityService { - public static final String CONTEXT = "applicationall"; + public static final String CONTEXT = "applicationsall"; public ApplicationAllEntityService() { super(CONTEXT, IdHelpers.STRING_NO_WHITESPACE, null, null, null); diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/services/ApplicationDarrtsEntityService.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/services/ApplicationDarrtsEntityService.java index 03a78e1..07ffb72 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/services/ApplicationDarrtsEntityService.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/services/ApplicationDarrtsEntityService.java @@ -25,7 +25,7 @@ @Service public class ApplicationDarrtsEntityService extends AbstractGsrsEntityService { - public static final String CONTEXT = "applicationdarrts"; + public static final String CONTEXT = "applicationsdarrts"; public ApplicationDarrtsEntityService() { super(CONTEXT, IdHelpers.STRING_NO_WHITESPACE, null, null, null); diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/searchcount/services/SearchCountEntityService.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/searchcount/services/SearchCountEntityService.java index 7e43afc..8e509c6 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/searchcount/services/SearchCountEntityService.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/searchcount/services/SearchCountEntityService.java @@ -23,7 +23,7 @@ @Service public class SearchCountEntityService extends AbstractGsrsEntityService { - public static final String CONTEXT = "searchcount"; + public static final String CONTEXT = "searchcounts"; public SearchCountEntityService() { super(CONTEXT, IdHelpers.STRING_NO_WHITESPACE, null, null, null); From 10a60dee4e390fbfb6c0226ffb603a4cc51e1a2e Mon Sep 17 00:00:00 2001 From: Newatia Date: Tue, 28 Sep 2021 14:27:06 -0400 Subject: [PATCH 2/3] fixed darrts LazyCollectionOption --- .../controllers/ApplicationAllController.java | 6 +++++- .../application/applicationall/models/ProductSrsAll.java | 8 ++++---- .../applicationdarrts/models/ApplicationDarrts.java | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/controllers/ApplicationAllController.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/controllers/ApplicationAllController.java index 9021935..0bdc42d 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/controllers/ApplicationAllController.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/controllers/ApplicationAllController.java @@ -55,18 +55,22 @@ public class ApplicationAllController extends EtagLegacySearchEntityController applicationIngredientList = new ArrayList<>(); + @LazyCollection(LazyCollectionOption.FALSE) @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) public List applicationProductNameList = new ArrayList<>(); - @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") - @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) - public List applicationIngredientList = new ArrayList<>(); - public ProductSrsAll () {} } diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/models/ApplicationDarrts.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/models/ApplicationDarrts.java index bad4220..0f2325e 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/models/ApplicationDarrts.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationdarrts/models/ApplicationDarrts.java @@ -4,6 +4,8 @@ import ix.core.models.Backup; import ix.core.models.IndexableRoot; import lombok.Data; +import org.hibernate.annotations.LazyCollection; +import org.hibernate.annotations.LazyCollectionOption; import javax.persistence.*; import java.util.ArrayList; @@ -55,14 +57,15 @@ public class ApplicationDarrts extends AbstractGsrsEntity { @Column(name="ROUTE_OF_ADMIN") public String routeOfAdmin; - @OneToMany(cascade = CascadeType.ALL) + @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumns({ @JoinColumn(name="APP_TYPE", referencedColumnName = "APP_TYPE", insertable = false, updatable = false ), @JoinColumn(name="APP_NUMBER", referencedColumnName = "APP_NUMBER", insertable = false, updatable = false) }) public List ingredientList = new ArrayList(); - @OneToMany(cascade = CascadeType.ALL) + @LazyCollection(LazyCollectionOption.FALSE) + @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumns({ @JoinColumn(name="APP_TYPE", referencedColumnName = "APP_TYPE", insertable = false, updatable = false ), @JoinColumn(name="APP_NUMBER", referencedColumnName = "APP_NUMBER", insertable = false, updatable = false) From afc161a1c0e1a5efaf97b98c0fd28e19bd79fb3d Mon Sep 17 00:00:00 2001 From: Newatia Date: Tue, 28 Sep 2021 20:13:16 -0400 Subject: [PATCH 3/3] fixed application all reindexing --- .../application/applicationall/models/ProductSrsAll.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java index f6d8247..8ed1966 100644 --- a/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java +++ b/gsrs-module-applications-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/application/applicationall/models/ProductSrsAll.java @@ -26,12 +26,13 @@ public class ProductSrsAll extends AbstractGsrsEntity { @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) - public List applicationIngredientList = new ArrayList<>(); + public List applicationProductNameList = new ArrayList<>(); @LazyCollection(LazyCollectionOption.FALSE) @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID") @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) - public List applicationProductNameList = new ArrayList<>(); + public List applicationIngredientList = new ArrayList<>(); + public ProductSrsAll () {}