Good morning everyone. I need a help from you guys. I'm developing a service using Kotlin and Spring with MySQL database, and Spring JPA, in my service I have some custom queries in my database like this one:
@Modifying
@Transactional
@Query("DELETE FROM CollectionComicBook WHERE comic_book_id = ?1")
fun deleteByComicBookId(comicBookId: Long): Int
When I run this query it works ok, I can see in my database that the value is being deleted, however my service return this error:
"Modifying queries can only use void or int/Integer as return type!; nested exception is java.lang.IllegalArgumentException: Modifying queries can only use void or int/Integer as return type!
I've tried to change the return type to Long, Integer (from java), Unit and also leave it blank, but I'm still getting this error. I don't know what I can do to solve this. Anyone can help me with this?