0

Please check the below query I am trying to update a row by the composite key

my key combination is like:

int id  
int versionId
String languageId

and query is:

@Transactional
@Modifying
@Query("update languageEntity l set l.language = :language where l.languageId = :languageId")

int UpdateProcessLanguage(@Param("language ") String processDesTranslation, @Param("languageId ") UserLanguageId languageId);

I am not getting any exception. function is returning 0, means no row effected.

please check what is worng.

M Reza
  • 16,461
  • 14
  • 61
  • 67
user3364549
  • 207
  • 1
  • 4
  • 10

2 Answers2

0

It's hard to say without knowing the data. As a first step I would log the generated SQL statements (see how to log sql statements in spring-boot) and check if they look right.

tine
  • 40
  • 1
0

Why you dont wan't to use save() method for that? Just change language property on your object and pass it to the save method. It will update the row.

Moler
  • 799
  • 2
  • 7
  • 16