I have a job that runs every midnight and I am using JPA to create tables. I want to assign a default value to a column (for all the rows existing in the current db) every time I start the job and then during the job I will assign that column a different value depending on some logic.
For example:
@Column(name = "delete_YN?")
private String deleteYN = "Y";
//getters setters here
I want this column to have a default value "Y" every time my job starts (each row inserted in the previous run should have the column value as "Y" at the start of the job) and the job assigns the value "N" to the column by some logic. In the end, I would be able to see which rows have the Y value and which ones have the N value to this column. Am I doing this correctly? Is this okay or should use the columnDefinition annotation? What exactly is the difference between this and the columnDefinition annotation?