Skip to content

Instantly share code, notes, and snippets.

@atesibrahim
Last active June 30, 2022 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atesibrahim/342732aa1dbda13811dced1ba13709cd to your computer and use it in GitHub Desktop.
Save atesibrahim/342732aa1dbda13811dced1ba13709cd to your computer and use it in GitHub Desktop.
@Repository
public interface ProductRepository extends JpaRepository<Product, Integer> {
@Transactional
@Modifying
@Query(value = "update product " +
"set name = :name " +
"where id = :productId", nativeQuery = true)
void updateName(@Param("productId") Integer productId, @Param("name") String name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment