I'm working on a Spring Boot project using Spring Data JPA + Hibernate for data access, but I'm having a strange problem.
In my Entity class I specified these columns:
@Entity
@Table(name = "Subjects")
public class Subject {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
@Column(name="InsertionDate")
private Date insertDate;
// get + set...
}
When I try to execute repo.findAll()
I get this exception:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'insertion_date'.
What's wrong in my configuration? Why is Hibernate searching for 'insertion_date'
instead of 'InsertionDate'
? How can I configure the right column name?