I have 3 class.

Product Class

```
package com.eziz.warehouse;

import com.eziz.clients.Clients;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;

@Entity
@Table(name = "product")
public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long productId;

    @Column(nullable = false, length = 20)
    private String productName;

    @ManyToOne
    @JoinColumn(name = "category_id")
    private ProductCategory productCategory;

    @Column(nullable = false, length = 10)
    private int productCount;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(nullable = false)
    private String productDateCreated;

    @Column(nullable = false)
    private double productPurchasePrice;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getProductCount() {
        return productCount;
    }

    public void setProductCount(int productCount) {
        this.productCount = productCount;
    }

    public String getProductDateCreated() {
        return productDateCreated;
    }

    public void setProductDateCreated(String productDateCreated) {
        this.productDateCreated = productDateCreated;
    }

    public double getProductPurchasePrice() {
        return productPurchasePrice;
    }

    public void setProductPurchasePrice(double productPurchasePrice) {
        this.productPurchasePrice = productPurchasePrice;
    }

    public ProductCategory getProductCategory() {
        return productCategory;
    }

    public void setProductCategory(ProductCategory productCategory) {
        this.productCategory = productCategory;
    }

    @Override
    public String toString() {
        return this.productName;
    }
}

```

ProductCategory Class.

```
package com.eziz.warehouse;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "productcategory")
public class ProductCategory {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long productCategoryId;

    @Column(nullable = false, length = 30)
    private String productCategoryName;

//    @ManyToOne
//    @JoinColumn(name = "productCategory")
//    private Product product;

    @OneToMany(mappedBy = "productCategory")
    private Set<Product> products = new HashSet<>();

    public Long getProductCategoryId() {
        return productCategoryId;
    }

    public void setProductCategoryId(Long productCategoryId) {
        this.productCategoryId = productCategoryId;
    }

    public String getProductCategoryName() {
        return productCategoryName;
    }

    public void setProductCategoryName(String productCategoryName) {
        this.productCategoryName = productCategoryName;
    }

//    public Product getProduct() {
//        return product;
//    }
//
//    public void setProduct(Product product) {
//        this.product = product;
//    }

    public Set<Product> getProducts() {
        return products;
    }

    public void setProducts(Set<Product> products) {
        this.products = products;
    }
}

```

and Request Class.

```
package com.eziz.requestForWarehouse;

import com.eziz.requests.Requests;
import com.eziz.user.User;
import com.eziz.warehouse.Product;
import com.eziz.warehouse.ProductCategory;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

@Entity
@Table(name = "requestWH")
public class RequestWarehouse {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long requestWHId;

    @Column(nullable = false, length = 10)
    private int requestWHCount;

    @Column(nullable = false, length = 15)
    private String requestWHStatus;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(nullable = false)
    private String requestWHDateCreated;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Column(nullable = false)
    private String requestWHExpiryTime;

    @ManyToMany
    @JoinColumn(name = "requestWHProductId")
    private Set<ProductCategory> productCategory = new HashSet<>();

    @ManyToOne
    @JoinColumn(name = "requestWHRequestId")
    private Requests requests;

    public Long getRequestWHId() {
        return requestWHId;
    }

    public void setRequestWHId(Long requestWHId) {
        this.requestWHId = requestWHId;
    }

    public int getRequestWHCount() {
        return requestWHCount;
    }

    public void setRequestWHCount(int requestWHCount) {
        this.requestWHCount = requestWHCount;
    }

    public String getRequestWHStatus() {
        return requestWHStatus;
    }

    public void setRequestWHStatus(String requestWHStatus) {
        this.requestWHStatus = requestWHStatus;
    }

    public String getRequestWHDateCreated() {
        return requestWHDateCreated;
    }

    public void setRequestWHDateCreated(String requestWHDateCreated) {
        this.requestWHDateCreated = requestWHDateCreated;
    }

    public String getRequestWHExpiryTime() {
        return requestWHExpiryTime;
    }

    public void setRequestWHExpiryTime(String requestWHExpiryTime) {
        this.requestWHExpiryTime = requestWHExpiryTime;
    }

//    public ProductCategory getProductCategory() {
//        return productCategory;
//    }
//
//    public void setProductCategory(ProductCategory productCategory) {
//        this.productCategory = productCategory;
//    }

    public Set<ProductCategory> getProductCategory() {
        return productCategory;
    }

    public void setProductCategory(Set<ProductCategory> productCategory) {
        this.productCategory = productCategory;
    }

    public Requests getRequests() {
        return requests;
    }

    public void setRequests(Requests requests) {
        this.requests = requests;
    }
}

```

I need use this in request, first select category and after categoryproducts with select option.

html code:

```
          <div class="form-group">
                    <p align="center" class="font-aziz">Avadanlıq / Detal Kateqoriya</p>
                    <select th:field="*{productCategory}" class="form-control un" id="product" required>
                        <th:block th:each="pro : ${productCategoryList}">
                            <option th:text="${pro.productCategoryName}"
                                    th:value="${pro.productCategoryId}"/>
                        </th:block>
                    </select>
                </div>

<!--                <div class="form-group">-->
<!--                    <p align="center" class="font-aziz">Avadanlıq / Detal</p>-->
<!--                    <select th:field="*{productCategory}" class="form-control un" id="product1" required>-->
<!--                        <th:block th:each="pro : ${productCategoryList.products}">-->
<!--                            <option th:text="${pro.productName}"-->
<!--                                    th:value="${productCategory}"/>-->
<!--                        </th:block>-->
<!--                    </select>-->
<!--                </div>-->

```

and so how i fix this? i am need get products. but using category. I need use this in request, first select category and after categoryproducts with select option.