Skip to content
Snippets Groups Projects
Commit 6b5b16b5 authored by Birk Øvstetun Narvhus's avatar Birk Øvstetun Narvhus
Browse files

fixed fridge endpoint

parent 5237630e
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@ package ntnu.idatt2016.v233.SmartMat.entity.fridgeProduct;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonIncludeProperties;
import jakarta.persistence.*;
import lombok.*;
import ntnu.idatt2016.v233.SmartMat.entity.group.Fridge;
......@@ -28,7 +30,7 @@ public class FridgeProductAsso {
@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
@JoinColumn(name = "ean")
@JsonIgnore
@JsonIncludeProperties({"HibernateLazyInitializer", "handler", "name", "description", "price", "image", "allergies"})
private Product ean;
@Column(name = "purchase_date")
......
......@@ -2,6 +2,7 @@ package ntnu.idatt2016.v233.SmartMat.entity.product;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIncludeProperties;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -73,6 +74,7 @@ public class Product{
@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
fetch = FetchType.LAZY, mappedBy = "products")
@JsonIgnoreProperties({"products", "users"})
@JsonIgnore
List<Allergy> allergies;
@OneToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment