I have the following entity in SpringBoot and I would like to create a new entity which has the userID of the registered user and the name of the registered/logged in user as instance fields/table columns.
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="User")
public class WebUser {
@Id
@GeneratedValue
private Long userID;
@NonNull
private String name;
@NonNull
private String email;
@NonNull
private String password;
}
How would I go about doing this using a form in SpringBoot and JPA entity? I am struggling, I tried to create a form with hidden input fields using @OneToMany annotation but the userID and name were null.
Thanks for any help