I am trying to retrieve a list from a crudRepository by doing a .findAll() request and then pass it onto a html which lists them in a table. It retrieves the data fine except for the Dates which gives me a strange error. I am using Postgresql.
My create table sql:
--Table:conference_table
CREATE TABLE conference_table (
conference_id SERIAL NOT NULL,
user_id INT NOT NULL,
name VARCHAR(32),
description VARCHAR(255),
startConference DATE,
endConference DATE,
PRIMARY KEY (conference_id),
FOREIGN KEY (user_id) REFERENCES user_table(user_id)
);
In my conference.java I have:
@Column(name = "startConference")
private Date startConference;
@Column(name = "endConference")
private Date endConference;
In my controller class I have the method:
@GetMapping(path="/configure")
public String showConfigurePage(Model model){
List<Conference> conferenceList = conferenceRepository.findAll(); // This gives me the error
model.addAttribute("conferenceList", conferenceList);
return "configure";
}
Error:
org.postgresql.util.PSQLException: ERROR: column conference0_.end_conference does not exist
Hint: Perhaps you meant to reference the column "conference0_.endconference".
Any ideas why this might be happening? I can provide further info if I missed any.