I am writing a Spring boot application linked to MySQL, in one of my packages:
com.Employee.DataManagement.salaries
I misspelled a property's name:
@Column(name = "from_date")
java.sql.Date fromeDate
As you can see, there is an extra "e" in the name. But I didn't realize it at that time and run the main java file(the one with annotation @SpringBootApplication) for a few times. Then I removed the extra "e" and the property becomes this:
@Column(name = "from_date")
java.sql.Date fromDate
Setter and Getter looks like this:
public Date getFromeDate() {
return fromDate;
}
public void setFromeDate(Date fromDate) {
this.fromDate = fromDate;
}
However, when I run the java file again, the old property name won't go away. The are some screenshot:
When I use GET and get the response, the from date in JSON always display as the previous name.
When I want to POST new data into the database, the example given by Swagger is like this:
But in the RequestBody I can ignore the misspell property and only use the correct one, write like this:
{
"embeddedKeyId": {
"employee": {
"emp_no": 123123
},
"fromDate": "2012-10-27",
},
"salary": 450,
"toDate": "2333-08-09"
}
But the output will still display as the old property name.
I searched through the project to see if I forgot to change some property name, but I got nothing.
Lastly, here is the screenshot of the salaries table in database