I have a table that contains mamy columns and I want to update the one or few columns of the row without effecting remaining columns I can write query:
update table as t set t.a=:a set t.b=:b where t.id=1
But seen I dont know which columns will be selected to update, and I think it is not a good idea to write every query for every scenarios. Well, I have to write query for every scenarios, but I am looking for a better way to update the table dynamically. I am thinking criteria would be a good choice. But the problem is that I have no idea how to write criteria update specific column. My code now can update the column but it would set other column to null or empty.
What would be the good way to update specific columns without changing other columns?