To finish up my API I need to update an element of my Database using Hibernate-Criteria.
So in my database there is any entity called Task. I get this Taks using Hibernate .createQuery and I make some modifications. The Task objekt will have an id and also some other values.
I want to update the respective object in my database but how can I pass the index
public void megreTask(Task entity, String id) {
getSession().merge(entity); // how to pass id ?
}
As you can see from the example above I seem only to be able to find the .merge() method, which only allows me to pass in an object but not the id.
How can update my entity in the database. I've already done a fair bit of SpringBoot and I just want something simmilar to the put method?