You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs seem to suggest I can define a custom delete method on my repository in the same way I can define a custom query method. For example:
@Table
data class Entity(val name: String, @Id val id: UUID? = null)
interface EntityRepository : CrudRepository<Entity, UUID> {
fun deleteByName(name: String)
}
However, calling the method doesn't delete anything. Enabling debug logging for Spring Data, it looks like Spring is attempting to query instead of delete:
SELECT "ENTITY"."ID" AS "ID", "ENTITY"."NAME" AS "NAME" FROM "ENTITY" WHERE "ENTITY"."NAME" = ?
Is this actually supported? The docs are slightly vague in the sense that they only really mention it in passing.
You are referring to the general section of the documentation, describing the general behaviour of Spring Data modules.
Not everything described there is fully supported by all modules.
And delete for query derivation is indeed not supported in the current version of Spring Data.
The docs seem to suggest I can define a custom delete method on my repository in the same way I can define a custom query method. For example:
However, calling the method doesn't delete anything. Enabling debug logging for Spring Data, it looks like Spring is attempting to query instead of delete:
Is this actually supported? The docs are slightly vague in the sense that they only really mention it in passing.
Reproducable example: https://github.com/chris-unlikelyai/springdataissue2
The text was updated successfully, but these errors were encountered: