From 3aae85db1c1fad0e3710d50280b01b59ea6888c0 Mon Sep 17 00:00:00 2001 From: valeriovinciarelli Date: Wed, 31 May 2023 18:54:55 +0200 Subject: [PATCH] update --- .../dbapiimplementation/CategoryDBAPI.java | 3 +++ .../epos/handler/dbapi/model/EDMCategory.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/epos/handler/dbapi/dbapiimplementation/CategoryDBAPI.java b/src/main/java/org/epos/handler/dbapi/dbapiimplementation/CategoryDBAPI.java index 9becf40..61ede63 100644 --- a/src/main/java/org/epos/handler/dbapi/dbapiimplementation/CategoryDBAPI.java +++ b/src/main/java/org/epos/handler/dbapi/dbapiimplementation/CategoryDBAPI.java @@ -119,6 +119,9 @@ protected Category mapFromDB(Object edmObject) { o.setName(edm.getName()); o.setDescription(edm.getDescription()); + edm.getIspartofCategoriesById_0().isEmpty(); + edm.getIspartofCategoriesById().isEmpty(); + if(edm.getIspartofCategoriesById_0().size()==1) o.setBroader(((List)edm.getIspartofCategoriesById_0()).get(0).getCategory1Id()); diff --git a/src/main/java/org/epos/handler/dbapi/model/EDMCategory.java b/src/main/java/org/epos/handler/dbapi/model/EDMCategory.java index 2f2822a..1afa2f4 100644 --- a/src/main/java/org/epos/handler/dbapi/model/EDMCategory.java +++ b/src/main/java/org/epos/handler/dbapi/model/EDMCategory.java @@ -91,7 +91,7 @@ public int hashCode() { return Objects.hash(id, description, name); } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getDataproductCategoriesById() { return dataproductCategoriesById; } @@ -100,7 +100,7 @@ public void setDataproductCategoriesById(Collection data this.dataproductCategoriesById = dataproductCategoriesById; } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getEquipmentCategoriesById() { return equipmentCategoriesById; } @@ -109,7 +109,7 @@ public void setEquipmentCategoriesById(Collection equipmen this.equipmentCategoriesById = equipmentCategoriesById; } - @OneToMany(mappedBy = "categoryByCategory1Id",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategory1Id",fetch=FetchType.LAZY) public Collection getIspartofCategoriesById() { return ispartofCategoriesById; } @@ -118,7 +118,7 @@ public void setIspartofCategoriesById(Collection ispartofCa this.ispartofCategoriesById = ispartofCategoriesById; } - @OneToMany(mappedBy = "categoryByCategory2Id",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategory2Id",fetch=FetchType.LAZY) public Collection getIspartofCategoriesById_0() { return ispartofCategoriesById_0; } @@ -127,7 +127,7 @@ public void setIspartofCategoriesById_0(Collection ispartof this.ispartofCategoriesById_0 = ispartofCategoriesById_0; } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getPublicationCategoriesById() { return publicationCategoriesById; } @@ -136,7 +136,7 @@ public void setPublicationCategoriesById(Collection publ this.publicationCategoriesById = publicationCategoriesById; } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getServiceCategoriesById() { return serviceCategoriesById; } @@ -145,7 +145,7 @@ public void setServiceCategoriesById(Collection serviceCateg this.serviceCategoriesById = serviceCategoriesById; } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getSoftwareapplicationCategoriesById() { return softwareapplicationCategoriesById; } @@ -154,7 +154,7 @@ public void setSoftwareapplicationCategoriesById(Collection getSoftwaresourcecodeCategoriesById() { return softwaresourcecodeCategoriesById; } @@ -163,7 +163,7 @@ public void setSoftwaresourcecodeCategoriesById(Collection getWebserviceCategoriesById() { return webserviceCategoriesById; } @@ -172,7 +172,7 @@ public void setWebserviceCategoriesById(Collection webser this.webserviceCategoriesById = webserviceCategoriesById; } - @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.EAGER) + @OneToMany(mappedBy = "categoryByCategoryId",fetch=FetchType.LAZY) public Collection getFacilityCategoriesById() { return facilityCategoriesById; }