<repo_name>davve94/WorkoutBackend<file_sep>/src/main/java/db/Entities/WorkoutPlan.java
package db.Entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.List;

@Entity
public class WorkoutPlan {

    @Id
    @GeneratedValue
    private Integer id;
    private String timestamp;
    @OneToMany
    private List<Workout> workout;
    private String description;

    public WorkoutPlan(Integer id, String timestamp, List<Workout> workout, String description) {
        this.id = id;
        this.timestamp = timestamp;
        this.workout = workout;
        this.description = description;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public List<Workout> getWorkout() {
        return workout;
    }

    public void setWorkout(List<Workout> workout) {
        this.workout = workout;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
<file_sep>/src/main/java/db/Entities/Food.java
package db.Entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class Food {

    @Id
    @GeneratedValue
    private Integer id;
    private String name;
    @ManyToOne
    private FoodCategory foodCategory;
    private String ingredients;

    public Food(Integer id, String name, FoodCategory foodCategory, String ingredients) {
        this.id = id;
        this.name = name;
        this.foodCategory = foodCategory;
        this.ingredients = ingredients;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FoodCategory getFoodCategory() {
        return foodCategory;
    }

    public void setFoodCategory(FoodCategory foodCategory) {
        this.foodCategory = foodCategory;
    }

    public String getIngredients() {
        return ingredients;
    }

    public void setIngredients(String ingredients) {
        this.ingredients = ingredients;
    }
}
<file_sep>/src/main/java/db/Entities/FoodPlan.java
package db.Entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.List;

@Entity
public class FoodPlan {

    @Id
    @GeneratedValue
    private Integer id;
    private String timestamp;
    @OneToMany
    private List<Food> food;
    private String description;

    public FoodPlan(Integer id, String timestamp, List<Food> food, String description) {
        this.id = id;
        this.timestamp = timestamp;
        this.food = food;
        this.description = description;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public List<Food> getFood() {
        return food;
    }

    public void setFood(List<Food> food) {
        this.food = food;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
