I have a table already existing in postgres db, say Students which is having around 30 columns. In my springboot code, however I am only updating the values of just 3 columns in the table. Currently I tried creating an entity class with just 3 columns - with its getters and setters and tried to run the springboot application, but it has overwritten the db table and now the db table is only having 3 columns in it. Do I have to write the entity class for the entire 30 columns in the code too? How can I just keep few columns I require to edit/update in the entity class while keeping all the other fields unaffected? Can you please give a sample service class, controller class, repository and entity class for me to fetch just the details of one student id from an existing table? (A get request which retrieves the details of one student).
@Entity
@Table(name = "Students")
public class Cl_Students {
@Id
@GeneratedValue(generator = "uuid")
private String id;
@Column(name="student_name")
private String st_name;
@Column(name="student_marks")
private String st_marks;
}