skip to Main Content

Triple nested JPA Entity to JSON – Spring Boot Project

So, I have 3 @Entity classes class Campaign { @Id private long campaignId; //Other fields @OneToMany(mappedBy = "campaign",cascade=CascadeType.ALL) private Set<Question> questions; } class Question { @Id private long questionId; //Other fields @OneToMany(mappedBy = "question",cascade=CascadeType.ALL) private Set<Choices> choices; @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="CAMPAIGN_ID") private…

VIEW QUESTION

java.lang.NullPointerException: Cannot invoke "com.example.repository.StudentRepository.save(Object)" because "this.studentRepository" is null – Mysql

`HTTP Status 500 – Internal Server Error Type Exception Report Message Request processing failed: java.lang.NullPointerException: Cannot invoke "com.example.repository.StudentRepository.save(Object)" because "this.studentRepository" is null Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception jakarta.servlet.ServletException: Request processing…

VIEW QUESTION
Back To Top
Search