so i have a form that submits to a route that i made, and is supposed to save something to the repository. however, the class that it saves the route to has a parameter that is a java object and is important to saving it, but i dont know how to represent this in my form
my class
@Entity
public class Review {
@ManyToOne
@JoinColumn(name = "rmcClass_id")
@JsonBackReference
private RMCClass rmcClass;
private StarValue interesting;
private StarValue hard;
private StarValue homework;
private StarValue exams;
// lots of stuff omitted
}
the one i'm having trouble with is RMCClass, as StarValue is an enum that I could represent with its string values
When I create the form, I send an attribute with the class, but this doesnt get passed on to the submission endpoint
I tried doing this, but it errors out
<input type="hidden" th:value="${class.getId()}" th:field="*{rmcClass}" />
so what would be the proper way to pass on the manytoone object to my submission endpoint so it can save it in the database?