diff --git a/build.gradle b/build.gradle index 6833345..3e90001 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,8 @@ repositories { } dependencies { + // https://mvnrepository.com/artifact/commons-io/commons-io + implementation group: 'commons-io', name: 'commons-io', version: '2.6' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'com.h2database:h2:2.1.210' diff --git a/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Category.java b/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Category.java index 1ce20ed..ec7a0ef 100644 --- a/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Category.java +++ b/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Category.java @@ -10,9 +10,6 @@ public class Category { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @OneToMany(mappedBy = "category") - private List productList; - @Column private String name; diff --git a/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Manufacturer.java b/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Manufacturer.java index 55ca96a..b9fb540 100644 --- a/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Manufacturer.java +++ b/src/main/java/ru/ulstu/is/sbapp/HardwareShop/models/Manufacturer.java @@ -10,7 +10,8 @@ public class Manufacturer { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @ManyToMany(mappedBy = "manufacturerList") + @ManyToMany(fetch = FetchType.EAGER, + mappedBy = "manufacturerList") private List productList; @Column