I am migrating my spring mvc codebase to Spring Boot based Rest APIs, earlier we were using jdbcTemplate
and writing sql queries for almost everything. But now we have started using Spring Data JPA and life is easy.
Everything was going smooth till I got stuck on this query in my old codebase.
INSERT INTO recycletag (id,tagid,isassign)
VALUES (?,?,?) ON DUPLICATE KEY UPDATE isassign = VALUES(isassign)
It was easy to save
the entity using Spring Data JPA but how to replicate this operation using Spring Data JPA?