is that possible to returns updated entity by custom update method instead of numbers of affected rows? How can I achieve this?
I would like to have sth like this:
public interface DataRepository extends CrudRepository<Data, Long> {
@Modifying
@Query(value="UPDATE data SET max_version = max_version + 1 WHERE id = 'A'", nativeQuery=true)
Data updateDataByType();
}
instead of this
public interface DataRepository extends CrudRepository<Data, Long> {
@Modifying
@Query(value="UPDATE data SET max_version = max_version + 1 WHERE id = 'A'", nativeQuery=true)
Integer updateDataByType();
}
question from:
https://stackoverflow.com/questions/65857953/custom-update-in-crudrepository 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…