From e069a14b5556883cd9dfc979fa202558408e7c11 Mon Sep 17 00:00:00 2001 From: annabakouli Date: Mon, 11 Dec 2017 13:05:30 +0200 Subject: [PATCH] changed fetch strategies for queries to improve performance on some queries --- dmp-backend/src/main/java/entities/DatasetProfile.java | 4 ++-- dmp-backend/src/main/java/models/dataset/Dataset.java | 2 +- dmp-backend/src/main/java/rest/entities/DatasetProfiles.java | 1 + .../dynamic-field-boolean-decision.component.html | 4 ++-- dmp-frontend/src/app/form/pagination/pagination-service.ts | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dmp-backend/src/main/java/entities/DatasetProfile.java b/dmp-backend/src/main/java/entities/DatasetProfile.java index 5a0d0a69f..9f466e308 100644 --- a/dmp-backend/src/main/java/entities/DatasetProfile.java +++ b/dmp-backend/src/main/java/entities/DatasetProfile.java @@ -47,13 +47,13 @@ public class DatasetProfile implements Serializable { private Set dataset; - @OneToOne(fetch = FetchType.EAGER) + @OneToOne(fetch = FetchType.LAZY) // @Cascade(value=org.hibernate.annotations.CascadeType.ALL) @JoinColumn(name = "\"Ruleset\"", nullable = true) private DatasetProfileRuleset ruleset; - @OneToOne(fetch = FetchType.EAGER) + @OneToOne(fetch = FetchType.LAZY) // @Cascade(value=org.hibernate.annotations.CascadeType.ALL) @JoinColumn(name = "\"Viewstyle\"", nullable = true) private DatasetProfileViewstyle viewstyle; diff --git a/dmp-backend/src/main/java/models/dataset/Dataset.java b/dmp-backend/src/main/java/models/dataset/Dataset.java index 8001e9817..8f41c0f36 100644 --- a/dmp-backend/src/main/java/models/dataset/Dataset.java +++ b/dmp-backend/src/main/java/models/dataset/Dataset.java @@ -106,7 +106,7 @@ public class Dataset implements DataModel{ this.label = entity.getLabel(); this.properties = entity.getProperties(); this.reference = entity.getReference(); - this.dmp = entity.getDmp(); + //this.dmp = entity.getDmp(); this.description = entity.getDescription(); this.profile = entity.getProfile(); this.registries = new DomainModelConverter().fromDataModel(entity.getRegistries().stream().collect(Collectors.toList()), Registry.class); diff --git a/dmp-backend/src/main/java/rest/entities/DatasetProfiles.java b/dmp-backend/src/main/java/rest/entities/DatasetProfiles.java index da1bd462e..ec4b27265 100644 --- a/dmp-backend/src/main/java/rest/entities/DatasetProfiles.java +++ b/dmp-backend/src/main/java/rest/entities/DatasetProfiles.java @@ -100,6 +100,7 @@ public class DatasetProfiles { try { List allDatasetProfiles = datasetProfileDao.getAll(); + return new ResponseEntity(SerializerProvider.toJson(allDatasetProfiles), HttpStatus.OK); } catch(Exception ex) { diff --git a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component.html b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component.html index dd0eaa6ad..014de001c 100644 --- a/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component.html +++ b/dmp-frontend/src/app/form/dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component.html @@ -1,5 +1,5 @@
- +
- +
\ No newline at end of file diff --git a/dmp-frontend/src/app/form/pagination/pagination-service.ts b/dmp-frontend/src/app/form/pagination/pagination-service.ts index 768a1ee42..31b452b2b 100644 --- a/dmp-frontend/src/app/form/pagination/pagination-service.ts +++ b/dmp-frontend/src/app/form/pagination/pagination-service.ts @@ -13,6 +13,6 @@ export class PaginationService { } public isElementVisible(elementPage: number):boolean { - return elementPage == this.currentPageIndex ; //TODO + return elementPage == this.currentPageIndex ; //TODO } } \ No newline at end of file